Improve see all links

clubs
Laurent 1 year ago
parent 477ae7e4ab
commit b737a2dd9d
  1. 18
      tournaments/templates/tournaments/tournaments.html
  2. 6
      tournaments/views.py

@ -23,9 +23,15 @@
{% include 'tournaments/tournament_row.html' %} {% include 'tournaments/tournament_row.html' %}
{% endfor %} {% endfor %}
{% if live|length > 10 %}
<div class="right"> <div class="right">
{% if club %}
<a href="{% url 'tournaments' %}?filter=1&club={{ club.id }}">Voir tous...</a>
{% else %}
<a href="{% url 'tournaments' %}?filter=1">Voir tous...</a> <a href="{% url 'tournaments' %}?filter=1">Voir tous...</a>
{% endif %}
</div> </div>
{% endif %}
{% endif %} {% endif %}
@ -37,9 +43,15 @@
{% include 'tournaments/tournament_row.html' %} {% include 'tournaments/tournament_row.html' %}
{% endfor %} {% endfor %}
{% if future|length > 10 %}
<div class="right"> <div class="right">
{% if club %}
<a href="{% url 'tournaments' %}?filter=0&club={{ club.id }}">Voir tous...</a>
{% else %}
<a href="{% url 'tournaments' %}?filter=0">Voir tous...</a> <a href="{% url 'tournaments' %}?filter=0">Voir tous...</a>
{% endif %}
</div> </div>
{% endif %}
{% endif %} {% endif %}
@ -58,9 +70,15 @@
{% include 'tournaments/tournament_row.html' %} {% include 'tournaments/tournament_row.html' %}
{% endfor %} {% endfor %}
{% if ended|length > 10 %}
<div class="right"> <div class="right">
{% if club %}
<a href="{% url 'tournaments' %}?filter=2&club={{ club.id }}">Voir tous...</a>
{% else %}
<a href="{% url 'tournaments' %}?filter=2">Voir tous...</a> <a href="{% url 'tournaments' %}?filter=2">Voir tous...</a>
{% endif %}
</div> </div>
{% endif %}
</div> </div>
</div> </div>

@ -26,6 +26,10 @@ def index(request):
live = live_tournaments(club_id) live = live_tournaments(club_id)
finished = finished_tournaments(club_id) finished = finished_tournaments(club_id)
club = None
if club_id:
club = get_object_or_404(Club, pk=club_id)
return render( return render(
request, request,
"tournaments/tournaments.html", "tournaments/tournaments.html",
@ -87,7 +91,7 @@ def tournaments(request):
{ {
'tournaments': tournaments, 'tournaments': tournaments,
'title': title, 'title': title,
'club': club, 'club': club_id,
} }
) )

Loading…
Cancel
Save