mirror of
				https://gitlab.com/animath/si/plateforme.git
				synced 2025-11-04 10:22:11 +01:00 
			
		
		
		
	Display team detail
This commit is contained in:
		@@ -222,7 +222,7 @@ class Tournament(models.Model):
 | 
			
		||||
        return reverse_lazy("participation:tournament_detail", args=(self.pk,))
 | 
			
		||||
 | 
			
		||||
    def __str__(self):
 | 
			
		||||
        return repr(self)
 | 
			
		||||
        return self.name
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        verbose_name = _("tournament")
 | 
			
		||||
 
 | 
			
		||||
@@ -28,17 +28,26 @@ class TeamTable(tables.Table):
 | 
			
		||||
# noinspection PyTypeChecker
 | 
			
		||||
class ParticipationTable(tables.Table):
 | 
			
		||||
    name = tables.LinkColumn(
 | 
			
		||||
        'participation:participation_detail',
 | 
			
		||||
        args=[tables.A("id")],
 | 
			
		||||
        verbose_name=lambda: _("name").capitalize(),
 | 
			
		||||
        'participation:team_detail',
 | 
			
		||||
        args=[tables.A("team__id")],
 | 
			
		||||
        verbose_name=_("name").capitalize,
 | 
			
		||||
        accessor="team__name",
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    trigram = tables.Column(
 | 
			
		||||
        verbose_name=lambda: _("trigram").capitalize(),
 | 
			
		||||
        verbose_name=_("trigram").capitalize,
 | 
			
		||||
        accessor="team__trigram",
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    valid = tables.Column(
 | 
			
		||||
        verbose_name=_("valid").capitalize,
 | 
			
		||||
        accessor="valid",
 | 
			
		||||
        empty_values=(),
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    def render_valid(self, value):
 | 
			
		||||
        return _("Validated") if value else _("Validation pending") if value is False else _("Not validated")
 | 
			
		||||
 | 
			
		||||
    class Meta:
 | 
			
		||||
        attrs = {
 | 
			
		||||
            'class': 'table table condensed table-striped',
 | 
			
		||||
 
 | 
			
		||||
@@ -40,18 +40,42 @@
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </dd>
 | 
			
		||||
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Chosen problem:" %}</dt>
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Tournament:" %}</dt>
 | 
			
		||||
            {% trans "any" as any %}
 | 
			
		||||
            <dd class="col-sm-6">{{ team.participation.get_problem_display|default:any }}</dd>
 | 
			
		||||
            <dd class="col-sm-6"><a href="{% url "participation:tournament_detail" pk=team.participation.tournament.pk %}">{{ team.participation.tournament|default:any }}</a></dd>
 | 
			
		||||
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Authorizations:" %}</dt>
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Photo authorizations:" %}</dt>
 | 
			
		||||
            <dd class="col-sm-6">
 | 
			
		||||
                {% for participant in team.participants.all %}
 | 
			
		||||
                    {% if participant.photo_authorization %}
 | 
			
		||||
                        <a href="{{ participant.photo_authorization.url }}" data-turbolinks="false">{{ participant }}</a>{% if not forloop.last %},{% endif %}
 | 
			
		||||
                    {% else %}
 | 
			
		||||
                        {{ participant }} ({% trans "Not uploaded yet" %}){% if not forloop.last %},{% endif %}
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </dd>
 | 
			
		||||
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Health sheets:" %}</dt>
 | 
			
		||||
            <dd class="col-sm-6">
 | 
			
		||||
                {% for participant in team.participants.all %}
 | 
			
		||||
                    {% if participant.health_sheet %}
 | 
			
		||||
                        <a href="{{ participant.health_sheet.url }}" data-turbolinks="false">{{ participant }}</a>{% if not forloop.last %},{% endif %}
 | 
			
		||||
                    {% else %}
 | 
			
		||||
                        {{ participant }} ({% trans "Not uploaded yet" %}){% if not forloop.last %},{% endif %}
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </dd>
 | 
			
		||||
 | 
			
		||||
            <dt class="col-sm-6 text-right">{% trans "Parental authorizations:" %}</dt>
 | 
			
		||||
            <dd class="col-sm-6">
 | 
			
		||||
                {% for student in team.students.all %}
 | 
			
		||||
                    {% if student.photo_authorization %}
 | 
			
		||||
                        <a href="{{ student.photo_authorization.url }}" data-turbolinks="false">{{ student }}</a>{% if not forloop.last %},{% endif %}
 | 
			
		||||
                    {% if student.under_18 %}
 | 
			
		||||
                        {% if student.parental_authorization %}
 | 
			
		||||
                            <a href="{{ student.parental_authorization.url }}" data-turbolinks="false">{{ student }}</a>{% if not forloop.last %},{% endif %}
 | 
			
		||||
                        {% else %}
 | 
			
		||||
                            {{ student }} ({% trans "Not uploaded yet" %}){% if not forloop.last %},{% endif %}
 | 
			
		||||
                        {% endif %}
 | 
			
		||||
                    {% endif %}
 | 
			
		||||
                {% endfor %}
 | 
			
		||||
            </dd>
 | 
			
		||||
        </dl>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user