mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 00:52:03 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			153 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			153 lines
		
	
	
		
			7.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
{% extends "base.html" %}
 | 
						|
 | 
						|
{% load django_tables2 i18n %}
 | 
						|
 | 
						|
{% block content %}
 | 
						|
{% trans "any" as any %}
 | 
						|
    <div class="card bg-body shadow">
 | 
						|
        <div class="card-header text-center">
 | 
						|
            <h4>{{ passage }}</h4>
 | 
						|
        </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>
 | 
						|
 | 
						|
                <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>
 | 
						|
 | 
						|
                {% if passage.observer %}
 | 
						|
                    <dt class="col-sm-3">{% trans "Observer:" %}</dt>
 | 
						|
                    <dd class="col-sm-9"><a href="{{ passage.observer.get_absolute_url }}">{{ passage.observer.team }}</a></dd>
 | 
						|
                {% endif %}
 | 
						|
 | 
						|
                <dt class="col-sm-3">{% trans "Defended solution:" %}</dt>
 | 
						|
                <dd class="col-sm-9"><a href="{{ passage.defended_solution.file.url }}">{{ passage.defended_solution }}</a></dd>
 | 
						|
 | 
						|
                <dt class="col-sm-3">{% trans "Defender penalties count:" %}</dt>
 | 
						|
                <dd class="col-sm-9">{{ passage.defender_penalties }}</dd>
 | 
						|
 | 
						|
                <dt class="col-sm-3">{% trans "Syntheses:" %}</dt>
 | 
						|
                <dd class="col-sm-9">
 | 
						|
                    {% for synthesis in passage.syntheses.all %}
 | 
						|
                        <a href="{{ synthesis.file.url }}">{{ synthesis }}{% if not forloop.last %}, {% endif %}</a>
 | 
						|
                    {% empty %}
 | 
						|
                        {% trans "No synthesis was uploaded yet." %}
 | 
						|
                    {% endfor %}
 | 
						|
                </dd>
 | 
						|
            </dl>
 | 
						|
        </div>
 | 
						|
        {% if notes is not None %}
 | 
						|
            <div class="card-footer text-center">
 | 
						|
                {% if my_note is not None %}
 | 
						|
                    <button class="btn btn-info" data-bs-toggle="modal" data-bs-target="#updateNotesModal">{% trans "Update notes" %}</button>
 | 
						|
                {% endif %}
 | 
						|
                <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#updatePassageModal">{% trans "Update" %}</button>
 | 
						|
            </div>
 | 
						|
        {% elif user.registration.participates %}
 | 
						|
            <div class="card-footer text-center">
 | 
						|
                <button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#uploadSynthesisModal">{% trans "Upload synthesis" %}</button>
 | 
						|
            </div>
 | 
						|
        {% endif %}
 | 
						|
    </div>
 | 
						|
 | 
						|
    {% if notes %}
 | 
						|
        <hr>
 | 
						|
 | 
						|
        <h2>{% trans "Notes detail" %}</h2>
 | 
						|
 | 
						|
        {% render_table notes %}
 | 
						|
 | 
						|
        <div class="card bg-body shadow">
 | 
						|
            <div class="card-body">
 | 
						|
                <dl class="row">
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the defender writing:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_defender_writing|floatformat }}/20</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the defender oral:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_defender_oral|floatformat }}/16</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the opponent writing:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_opponent_writing|floatformat }}/9</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the opponent oral:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_opponent_oral|floatformat }}/10</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the reporter writing:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_reporter_writing|floatformat }}/9</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Average points for the reporter oral:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_reporter_oral|floatformat }}/10</dd>
 | 
						|
 | 
						|
                    {% if passage.observer %}
 | 
						|
                        <dt class="col-sm-8">{% trans "Average points for the observer oral:" %}</dt>
 | 
						|
                        <dd class="col-sm-4">{{ passage.average_observer|floatformat }}/4</dd>
 | 
						|
                    {% endif %}
 | 
						|
                </dl>
 | 
						|
 | 
						|
                <hr>
 | 
						|
 | 
						|
                <dl class="row">
 | 
						|
                    <dt class="col-sm-8">{% trans "Defender points:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_defender|floatformat }}/52</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Opponent points:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_opponent|floatformat }}/29</dd>
 | 
						|
 | 
						|
                    <dt class="col-sm-8">{% trans "Reporter points:" %}</dt>
 | 
						|
                    <dd class="col-sm-4">{{ passage.average_reporter|floatformat }}/19</dd>
 | 
						|
 | 
						|
                    {% if passage.observer %}
 | 
						|
                        <dt class="col-sm-8">{% trans "Observer points:" %}</dt>
 | 
						|
                        <dd class="col-sm-4">{{ passage.average_observer|floatformat }}/4</dd>
 | 
						|
                    {% endif %}
 | 
						|
                </dl>
 | 
						|
            </div>
 | 
						|
        </div>
 | 
						|
    {% endif %}
 | 
						|
 | 
						|
    {% if notes is not None %}
 | 
						|
        {% 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" %}
 | 
						|
 | 
						|
        {% if my_note is not None %}
 | 
						|
            {% trans "Update notes" as modal_title %}
 | 
						|
            {% trans "Update" as modal_button %}
 | 
						|
            {% url "participation:update_notes" pk=my_note.pk as modal_action %}
 | 
						|
            {% include "base_modal.html" with modal_id="updateNotes" %}
 | 
						|
        {% endif %}
 | 
						|
    {% 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 %}
 | 
						|
{% endblock %}
 | 
						|
 | 
						|
{% block extrajavascript %}
 | 
						|
    <script>
 | 
						|
        document.addEventListener('DOMContentLoaded', () => {
 | 
						|
            {% if notes is not None %}
 | 
						|
                initModal("updatePassage", "{% url "participation:passage_update" pk=passage.pk %}")
 | 
						|
 | 
						|
                {% if my_note is not None %}
 | 
						|
                    initModal("updateNotes", "{% url "participation:update_notes" pk=my_note.pk %}")
 | 
						|
                {% endif %}
 | 
						|
            {% elif user.registration.participates %}
 | 
						|
                initModal("uploadSynthesis", "{% url "participation:upload_synthesis" pk=passage.pk %}")
 | 
						|
            {% endif %}
 | 
						|
        });
 | 
						|
    </script>
 | 
						|
{% endblock %}
 |