update htmls

main
Razmig Sarkissian 2 years ago
parent a71c543f75
commit fa874a0143
  1. 6
      scores/templates/scores/club.html
  2. 12
      scores/templates/scores/teams.html
  3. 24
      scores/templates/scores/tournament.html
  4. 4
      scores/urls.py
  5. 12
      scores/views.py

@ -22,7 +22,11 @@
<div class="sbig">
<ul>
<li><a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/">{{ tournament.name }}</a> | <a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes">Équipes</a></li>
{% if tv %}
<li><a href="/tv/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/">{{ tournament.name }}</a> | <a href="/tv/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes">Équipes</a></li>
{% else %}
<li><a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/">{{ tournament.name }}</a> | <a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes">Équipes</a></li>
{% endif %}
</ul>
</div>
{% endfor %}

@ -54,13 +54,21 @@
{% endif %}
{% if tournament.club.header %}
<header class="scenter"><a href="/club/{{ tournament.club.name }}/">{{ tournament.club.header }}</a></header>
{% if tv %}
<header class="scenter"><a href="/tv/club/{{ tournament.club.name }}/">{{ tournament.club.header }}</a></header>
{% else %}
<header class="scenter"><a href="/club/{{ tournament.club.name }}/">{{ tournament.club.header }}</a></header>
{% endif %}
{% endif %}
<main class="page-body">
{% autoescape off %}
<div class="scenter">
<h3><a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}">{{ tournament.name }}</a>
{% if tv %}
<h3><a href="tv/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}">{{ tournament.name }}</a>
{% else %}
<h3><a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}">{{ tournament.name }}</a>
{% endif %}
</div>
<div class="scontainer">

@ -60,14 +60,18 @@
<div class="center">
<h1>{{ tournament.name }}</h1>
<div>
<h3><a href="/club/{{ tournament.club.name }}/">{{ tournament.club.name }}</a> | <a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes/">Équipes</a><h3>
</div>
{% if tv %}
<h3><a href="/tv/club/{{ tournament.club.name }}/">{{ tournament.club.name }}</a> | <a href="/tv/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes/">Équipes</a><h3>
{% else %}
<h3><a href="/club/{{ tournament.club.name }}/">{{ tournament.club.name }}</a> | <a href="/club/{{ tournament.club.name }}/tournoi/{{ tournament.id }}/equipes/">Équipes</a><h3>
{% endif %}
</div>
</div>
{% for match in live_matches %}
<div class="match">
<div style="width: 100%;">
<div style="float: left;">
<h3>{{ match.title }}</h3>
<h3>{{ match.title|default:"Match" }}</h3>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
@ -84,10 +88,6 @@
<div style="float: right;">
<h3><a href="/match/{{ match.id }}/">STATISTIQUES</a><h3>
</div>
{% else %}
<div style="float: right;">
<h3><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h3>
</div>
{% endif %}
{% endif %}
@ -145,7 +145,7 @@
{% endif %}
<!-- <p id="demo"></p> -->
{% if match.isMatch or match.isBracket %}
{% if not match.isStatistic %}
<p class="duration">
<div class="small"> {{ match.durationPrefix }}</div>
<div class="big">{{ match.duration }}</div>
@ -160,7 +160,7 @@
<div style="width: 100%;">
<div style="float: left;">
<h3>{{ match.title }}</h3>
<h3>{{ match.title|default:"Match" }}</h3>
</div>
{% if match.isMatch or match.isBracket %}
{% if match.isMatch %}
@ -177,10 +177,6 @@
<div style="float: right;">
<h3><a href="/match/{{ match.id }}/">STATISTIQUES</a><h3>
</div>
{% else %}
<div style="float: right;">
<h3><a href="/match/{{ match.id }}/">#{{ match.court }}</a><h3>
</div>
{% endif %}
{% endif %}
@ -238,7 +234,7 @@
{% endif %}
{% if match.isMatch or match.isBracket %}
{% if not match.isStatistic %}
<p class="duration">
<div class="small"> {{ match.durationPrefix }}</div>
<div class="big">{{ match.duration }}</div>

@ -22,13 +22,13 @@ urlpatterns = [
path('match/<int:match_id>/', views.match, name='match'),
path('tv/match/<int:match_id>/', views.match_tv, name='match'),
path('tv/club/<str:club_name>/<int:tournament_id>/equipes/', views.tv_teams_club_name_tournament, name='teams'),
path('tv/club/<str:club_name>/tournoi/<int:tournament_id>/equipes/', views.tv_teams_club_name_tournament, name='teams'),
path('tv/tournoi/<str:tournament_shortname>/equipes/', views.tv_teams_tournament_name, name='teams'),
path('tv/club/<str:club_name>/<str:tournament_shortname>/equipes/', views.tv_teams_club_name_tournament_name, name='teams'),
path('tv/', views.index, name='index'),
path('tv/tournoi/<str:tournament_shortname>/', views.tv_tournament_name, name='tournament'),
path('tv/club/<str:club_name>/', views.club_name, name='club'),
path('tv/club/<str:club_name>/', views.tv_club_name, name='club'),
path('tv/club/<str:club_name>/tournoi/<int:tournament_id>/', views.tv_club_name_tournament, name='tournament'),
path('tv/club/<str:club_name>/<str:tournament_shortname>/', views.tv_club_name_tournament_name, name='tournament'),

@ -41,6 +41,18 @@ def club_name(request, club_name):
}
return HttpResponse(template.render(context, request))
def tv_club_name(request, club_name):
club = get_object_or_404(Club, name__iexact=club_name.lower())
tournaments = Tournament.objects.filter(club=club.id)
template = loader.get_template('scores/club.html')
context = {
'club': club,
'tournaments': tournaments,
'tv': True,
}
return HttpResponse(template.render(context, request))
def tournament_name(request, tournament_shortname):
tournamentFound = Tournament.objects.filter(shortname__iexact=tournament_shortname.lower()).first()
return tournament(request, tournamentFound.id)

Loading…
Cancel
Save