Compare commits
1 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
56288ddf45 | 2 years ago |
@ -0,0 +1,142 @@ |
||||
{% load static %} |
||||
|
||||
<html> |
||||
<head> |
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
||||
<link rel="stylesheet" href="{% static 'tournaments/css/foundation.min.css' %}" /> |
||||
<link rel="stylesheet" href="{% static 'tournaments/css/style.css' %}" /> |
||||
|
||||
<link rel="icon" type="image/png" href="{% static 'tournaments/images/favicon.png' %}" /> |
||||
|
||||
<title>Padel</title> |
||||
|
||||
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> |
||||
|
||||
</head> |
||||
|
||||
<!-- |
||||
TODO: utiliser le nom de l'URL pour le fetch {% url "monurl" tournament.pk %}?format=json |
||||
--> |
||||
|
||||
<body x-data="{ |
||||
tournament: null, |
||||
active: 1, |
||||
screens: 2, |
||||
retrieveTournament() { |
||||
fetch('/api/exp-tournaments/{{ tournament.pk }}/?format=json') |
||||
.then(res => res.json()) |
||||
.then((data) => { |
||||
this.tournament = data |
||||
}) |
||||
}, |
||||
loop() { |
||||
this.retrieveTournament() |
||||
setInterval(() => { |
||||
this.retrieveTournament() |
||||
this.active = this.active === this.screens ? 1 : this.active+1 |
||||
}, 3000) |
||||
} |
||||
}" x-init="loop()"> |
||||
|
||||
<div class="wrapper"> |
||||
<main class="page-body"> |
||||
<div class="container"> |
||||
<div class="grid-x"> |
||||
<div class="cell medium-6 large-6 topblock my-block"> |
||||
<div class="bubble"> |
||||
<img |
||||
src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" |
||||
class="logo inline" |
||||
/> |
||||
<div class="inline"> |
||||
<h1 class="club">4Padel Toulouse</h1> |
||||
<h1 class="event">Planning</h1> |
||||
<!-- <span>Propulsé par Padel Club</span> --> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<template x-if="tournament"> |
||||
|
||||
<div class="grid-x padding-bottom"> |
||||
<div class="cell medium-6 large-6 topblock my-block"> |
||||
|
||||
<div class="bubble" x-show="active === 1"> |
||||
<label class="title">Équipes</label> |
||||
<template x-for="team in tournament.teamregistration_set" > |
||||
<div class="table-container bottom-border vertical-padding"> |
||||
<img src="{% static 'tournaments/images/pc_icon_round_200.png' %}" class="team_image horizontal-margin"> |
||||
<div class="w50 tight table-cell hpadding10"> |
||||
<template x-for="player in team.playerregistration_set"> |
||||
<div> |
||||
<div x-text="player.first_name"></div> <div x-text="player.last_name"></div> |
||||
</div> |
||||
</template> |
||||
</div> |
||||
<div class="table-cell horizontal-padding"> |
||||
<span x-text="team.court"></span> |
||||
</div> |
||||
<div class="table-cell horizontal-padding large"> |
||||
<span x-text="team.call_date"></span> |
||||
</div> |
||||
<div class="table-cell"><div class="mybox">Poule A</div></div> |
||||
</div> |
||||
</template> |
||||
</div> |
||||
|
||||
<div class="bubble" x-show="active === 2"> |
||||
<label class="title">Matchs</label> |
||||
<template x-for="round in tournament.round_set"> |
||||
<template x-for="match in round.match_set"> |
||||
|
||||
<div> |
||||
|
||||
<div class="flex-row"> |
||||
<label class="left-label matchtitle">{{ match.id }}</label> |
||||
<label class="right-label info">{{ match.start_date }}</label> |
||||
</div> |
||||
|
||||
<div> |
||||
|
||||
{% for team in match.team_states %} |
||||
<div class="test bottom-border padding-bottom-small"> |
||||
<div class="left-label"> |
||||
{% for name in team.names %} |
||||
<div class="winner"> |
||||
{{ name }} |
||||
</div> |
||||
{% endfor %} |
||||
</div> |
||||
<div class=""> |
||||
{% for score in team.scores %} |
||||
<span class="score ws {% if team.is_winner %}winner{% endif %}">{{ score }}</span> |
||||
{% endfor %} |
||||
</div> |
||||
</div> |
||||
{% endfor %} |
||||
|
||||
</div> |
||||
|
||||
<div class="top-margin flex-row"> |
||||
<label class="left-label minor-info">{{ match.duration }}</label> |
||||
<!-- <a href="" class="right-label">détails</a> --> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
</template> |
||||
</template> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
|
||||
</template> |
||||
|
||||
</div> |
||||
</main> |
||||
</div> |
||||
|
||||
</body> |
||||
</html> |
||||
@ -1,9 +1,19 @@ |
||||
from django.urls import path |
||||
from django.urls import include, path |
||||
|
||||
from . import views |
||||
|
||||
urlpatterns = [ |
||||
|
||||
path("", views.index, name="index"), |
||||
path('tournament/<str:tournament_id>/', views.tournament, name='tournament'), |
||||
path('tournament/<str:tournament_id>/planning/', views.tournament_planning, name='tournament-planning'), |
||||
|
||||
# Tournament |
||||
path("tournament/<str:tournament_id>/", |
||||
include( |
||||
[ |
||||
path("", views.tournament, name="tournament"), |
||||
path("planning/", views.tournament_planning, name="tournament-planning"), |
||||
path("stream/", views.tournament_stream, name="tournament-stream"), |
||||
] |
||||
) |
||||
) |
||||
] |
||||
|
||||
Loading…
Reference in new issue