aboutsummaryrefslogtreecommitdiffhomepage
path: root/services/app/templates/admin_answer_list.html.twig
blob: 5d07d92897ad9527ea5f695164abf17f239c5abf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{% extends '_page.html.twig' %}

{% block content %}
  <p>
    このページは管理画面です。<a href="{{ url_for('answer_list', { qslug: quiz.slug }) }}">通常の回答一覧はこちらを参照してください</a>
  </p>
  <h2>{{ quiz.title }}</h2>
  <p>
    {{ quiz.description }}
  </p>
  <h2>回答一覧</h2>
  <form action="{{ url_for('admin_answer_rerun_all_answers_post', { qslug: quiz.slug }) }}" method=POST>
    <input type="submit" class="btn btn-warning" value="すべての回答に対して全テストケースを再実行">
    <input type="hidden" name="{{ csrf.name_key }}" value="{{ csrf.name }}">
    <input type="hidden" name="{{ csrf.value_key }}" value="{{ csrf.value }}">
  </form>
  <table>
    <thead>
      <tr>
        <th>ランク</th>
        <th>ID</th>
        <th>作者</th>
        <th>サイズ</th>
        <th>投稿日時</th>
        <th>ステータス</th>
      </tr>
    </thead>
    <tbody>
      {% for answer in answers %}
        <tr>
          <td>{{ loop.index }}</td>
          <td><a href="{{ url_for('admin_answer_edit', { qslug: quiz.slug, anum: answer.answer_number }) }}">#{{ answer.answer_number }}</a></td>
          <td>{{ answer.author_name }}{% if answer.author_is_admin %} (staff){% endif %}</td>
          <td>{{ answer.code_size }} byte</td>
          <td>{{ answer.submitted_at|date('Y-m-d H:i:s', 'Asia/Tokyo') }}</td>
          <td>{{ answer.execution_status.value }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>

  <div>
    <canvas id="chart" data-quiz-id="{{ quiz.quiz_id }}"></canvas>
    <script type="module" src="{{ base_path() }}/assets/chart.js"></script>
  </div>
{% endblock %}