plateforme-tfjm2/participation/templates/participation/passage_detail.html

173 lines
7.6 KiB
HTML
Raw Normal View History

2021-01-14 14:59:11 +00:00
{% extends "base.html" %}
2021-01-14 17:43:53 +00:00
{% load django_tables2 i18n %}
2021-01-14 14:59:11 +00:00
{% block content %}
{% trans "any" as any %}
<div class="card bg-body shadow">
2021-01-14 14:59:11 +00:00
<div class="card-header text-center">
<h4>
{{ passage }}
{% if user.registration.is_admin or user.registration in passage.pool.tournament.organizers.all %}
<button class="btn btn-sm btn-secondary"
data-bs-toggle="modal" data-bs-target="#updatePassageModal">
<i class="fas fa-edit"></i>
{% trans "Update" %}
</button>
{% endif %}
</h4>
2021-01-14 14:59:11 +00:00
</div>
<div class="card-body">
<dl class="row">
<dt class="col-sm-3">{% trans "Pool:" %}</dt>
<dd class="col-sm-9"><a href="{{ passage.pool.get_absolute_url }}">{{ passage.pool }}</a></dd>
<dt class="col-sm-3">{% trans "Position:" %}</dt>
<dd class="col-sm-9">{{ passage.position }}</dd>
2021-01-14 14:59:11 +00:00
<dt class="col-sm-3">{% trans "Defender:" %}</dt>
<dd class="col-sm-9"><a href="{{ passage.defender.get_absolute_url }}">{{ passage.defender.team }}</a></dd>
<dt class="col-sm-3">{% trans "Opponent:" %}</dt>
<dd class="col-sm-9"><a href="{{ passage.opponent.get_absolute_url }}">{{ passage.opponent.team }}</a></dd>
<dt class="col-sm-3">{% trans "Reporter:" %}</dt>
<dd class="col-sm-9"><a href="{{ passage.reporter.get_absolute_url }}">{{ passage.reporter.team }}</a></dd>
<dt class="col-sm-3">{% trans "Defended solution:" %}</dt>
2023-02-20 12:42:36 +00:00
<dd class="col-sm-9"><a href="{{ passage.defended_solution.file.url }}">{{ passage.defended_solution }}</a></dd>
2021-01-14 14:59:11 +00:00
2021-04-03 19:59:06 +00:00
<dt class="col-sm-3">{% trans "Defender penalties count:" %}</dt>
<dd class="col-sm-9">{{ passage.defender_penalties }}</dd>
2021-01-14 16:26:08 +00:00
<dt class="col-sm-3">{% trans "Syntheses:" %}</dt>
<dd class="col-sm-9">
{% for synthesis in passage.syntheses.all %}
2023-02-20 12:42:36 +00:00
<a href="{{ synthesis.file.url }}">{{ synthesis }}{% if not forloop.last %}, {% endif %}</a>
2021-01-14 16:26:08 +00:00
{% empty %}
{% trans "No synthesis was uploaded yet." %}
{% endfor %}
</dd>
2021-01-14 14:59:11 +00:00
</dl>
</div>
2021-04-04 11:30:02 +00:00
{% if notes is not None %}
2021-01-14 14:59:11 +00:00
<div class="card-footer text-center">
2021-04-04 11:30:02 +00:00
{% if my_note is not None %}
<button class="btn btn-info" data-bs-toggle="modal" data-bs-target="#{{ my_note.modal_name }}Modal">{% trans "Update notes" %}</button>
2021-04-04 11:30:02 +00:00
{% endif %}
2021-01-14 14:59:11 +00:00
</div>
2021-01-14 16:26:08 +00:00
{% elif user.registration.participates %}
<div class="card-footer text-center">
2023-02-20 13:52:25 +00:00
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadSynthesisModal">{% trans "Upload synthesis" %}</button>
2021-01-14 16:26:08 +00:00
</div>
2021-01-14 14:59:11 +00:00
{% endif %}
</div>
2021-01-14 17:43:53 +00:00
{% if notes %}
<hr>
<h2>{% trans "Notes detail" %}</h2>
{% render_table notes %}
<div class="card bg-body shadow">
2021-01-14 17:43:53 +00:00
<div class="card-body">
<dl class="row">
<dt class="col-sm-8">
{% trans "Average points for the defender writing" %}
({{ passage.defender.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_defender_writing|floatformat }}/20</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Average points for the defender oral" %}
({{ passage.defender.team.trigram }}) :
</dt>
<dd class="col-sm-4">{{ passage.average_defender_oral|floatformat }}/20</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Average points for the opponent writing" %}
({{ passage.opponent.team.trigram }}) :
</dt>
<dd class="col-sm-4">{{ passage.average_opponent_writing|floatformat }}/10</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Average points for the opponent oral" %}
({{ passage.opponent.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_opponent_oral|floatformat }}/10</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Average points for the reporter writing" %}
({{ passage.reporter.team.trigram }}) :
</dt>
<dd class="col-sm-4">{{ passage.average_reporter_writing|floatformat }}/10</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Average points for the reporter oral" %}
({{ passage.reporter.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_reporter_oral|floatformat }}/10</dd>
2021-01-14 17:43:53 +00:00
</dl>
<hr>
<dl class="row">
<dt class="col-sm-8">
{% trans "Defender points" %}
({{ passage.defender.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_defender|floatformat }}/52</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Opponent points" %}
({{ passage.opponent.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_opponent|floatformat }}/29</dd>
2021-01-14 17:43:53 +00:00
<dt class="col-sm-8">
{% trans "Reporter points" %}
({{ passage.reporter.team.trigram }}) :
</dt>
2021-04-10 12:38:15 +00:00
<dd class="col-sm-4">{{ passage.average_reporter|floatformat }}/19</dd>
2021-01-14 17:43:53 +00:00
</dl>
</div>
</div>
{% endif %}
2021-04-04 11:30:02 +00:00
{% if notes is not None %}
2021-01-14 16:26:08 +00:00
{% trans "Update passage" as modal_title %}
{% trans "Update" as modal_button %}
{% url "participation:passage_update" pk=passage.pk as modal_action %}
{% include "base_modal.html" with modal_id="updatePassage" %}
2021-01-14 17:21:22 +00:00
{% for note in notes.data %}
2021-04-04 11:30:02 +00:00
{% trans "Update notes" as modal_title %}
{% trans "Update" as modal_button %}
{% url "participation:update_notes" pk=note.pk as modal_action %}
{% include "base_modal.html" with modal_id=note.modal_name %}
{% endfor %}
2021-01-14 16:26:08 +00:00
{% elif user.registration.participates %}
{% trans "Upload synthesis" as modal_title %}
{% trans "Upload" as modal_button %}
{% url "participation:upload_synthesis" pk=passage.pk as modal_action %}
{% include "base_modal.html" with modal_id="uploadSynthesis" modal_enctype="multipart/form-data" %}
{% endif %}
2021-01-14 14:59:11 +00:00
{% endblock %}
{% block extrajavascript %}
<script>
document.addEventListener('DOMContentLoaded', () => {
2021-04-04 11:30:02 +00:00
{% if notes is not None %}
initModal("updatePassage", "{% url "participation:passage_update" pk=passage.pk %}")
2021-01-14 17:21:22 +00:00
{% for note in notes.data %}
initModal("{{ note.modal_name }}", "{% url "participation:update_notes" pk=note.pk %}")
{% endfor %}
2021-01-14 16:26:08 +00:00
{% elif user.registration.participates %}
initModal("uploadSynthesis", "{% url "participation:upload_synthesis" pk=passage.pk %}")
2021-01-14 16:26:08 +00:00
{% endif %}
2021-01-14 14:59:11 +00:00
});
</script>
{% endblock %}