plateforme-tfjm2/templates/tournament/team_detail.html

73 lines
3.1 KiB
HTML
Raw Normal View History

2020-04-29 15:58:11 +00:00
{% extends "base.html" %}
{% load getconfig i18n django_tables2 static %}
{% block content %}
<div class="card bg-light shadow">
<div class="card-header text-center">
<h4>{% trans "Team" %} {{ team.name }}</h4>
</div>
<div class="card-body">
<dl class="row">
<dt class="col-xl-6 text-right">{% trans 'name'|capfirst %}</dt>
<dd class="col-xl-6">{{ team.name }}</dd>
<dt class="col-xl-6 text-right">{% trans 'trigram'|capfirst %}</dt>
<dd class="col-xl-6">{{ team.trigram }}</dd>
<dt class="col-xl-6 text-right">{% trans 'tournament'|capfirst %}</dt>
2020-05-04 21:37:21 +00:00
<dd class="col-xl-6"><a href="{% url "tournament:detail" pk=team.tournament.pk %}">{{ team.tournament }}</a></dd>
2020-04-29 15:58:11 +00:00
<dt class="col-xl-6 text-right">{% trans 'coachs'|capfirst %}</dt>
2020-05-04 18:21:53 +00:00
<dd class="col-xl-6">{% autoescape off %}{{ team.linked_encadrants|join:", " }}{% endautoescape %}</dd>
2020-04-29 15:58:11 +00:00
<dt class="col-xl-6 text-right">{% trans 'participants'|capfirst %}</dt>
2020-05-04 18:21:53 +00:00
<dd class="col-xl-6">{% autoescape off %}{{ team.linked_participants|join:", " }}{% endautoescape %}</dd>
2020-04-29 15:58:11 +00:00
</dl>
</div>
2020-05-04 20:27:45 +00:00
{% if user.admin or user in team.tournament.organizers.all or team == user.team %}
2020-04-29 15:58:11 +00:00
<div class="card-footer text-center">
2020-05-04 18:21:53 +00:00
<a href="{% url "tournament:team_update" pk=team.pk %}"><button class="btn btn-secondary">{% trans "Edit team" %}</button></a>
2020-05-04 20:27:45 +00:00
{% if team.invalid %}
2020-05-04 18:21:53 +00:00
<form method="post">
{% csrf_token %}
2020-05-04 20:27:45 +00:00
{% if user.admin %}
<button name="delete" class="btn btn-danger">{% trans "Delete team" %}</button>
{% elif team == user.team %}
<button name="leave" class="btn btn-danger">{% trans "Leave this team" %}</button>
{% endif %}
2020-05-04 18:21:53 +00:00
</form>
2020-04-29 15:58:11 +00:00
{% endif %}
</div>
{% endif %}
</div>
<hr>
<h4>{% trans "Documents" %}</h4>
2020-04-29 23:20:50 +00:00
{% if team.motivation_letters.count %}
2020-04-29 15:58:11 +00:00
<div class="alert alert-info">
2020-04-30 18:18:51 +00:00
<strong>{% blocktrans %}Motivation letter:{% endblocktrans %}</strong>
2020-04-30 18:11:03 +00:00
<a data-turbolinks="false" href="{% url "document" file=team.motivation_letters.last.file %}">{% trans "Download" %}</a>
2020-04-29 23:20:50 +00:00
</div>
{% endif %}
{% if team.solutions.count %}
<div class="alert alert-info">
<ul>
{% for solution in team.solutions.all %}
2020-04-30 19:07:12 +00:00
<li><strong>{{ solution }} :</strong> <a data-turbolinks="false" href="{% url "document" file=solution.file %}">{% trans "Download" %}</a></li>
2020-04-29 23:20:50 +00:00
{% endfor %}
</ul>
2020-04-29 15:58:11 +00:00
</div>
2020-04-30 19:07:12 +00:00
<div class="text-center">
<form method="post">
{% csrf_token %}
<button class="btn btn-success" name="zip">{% trans "Download solutions as ZIP" %}</button>
</form>
</div>
2020-04-29 15:58:11 +00:00
{% endif %}
{% endblock %}