|
5 | 5 | {% if not quiz_available %} |
6 | 6 | {# This section is only displayed when the quiz is not available. #} |
7 | 7 | <div class="container-lg mw-900"> |
8 | | - <div class="card w-100 mb-4" id="leaderboards" style="overflow: hidden;"> |
9 | | - <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
10 | | - <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">Leaderboards</div> |
11 | | - <div class="d-inline-block"> |
| 8 | + {% if currentBlocDeadline %} |
| 9 | + <div class="card w-100 mb-4" id="leaderboards" style="overflow: hidden;"> |
| 10 | + <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
| 11 | + <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">Leaderboards</div> |
| 12 | + <div class="d-inline-block"> |
12 | 13 |
|
| 14 | + </div> |
| 15 | + </div> |
| 16 | + <div class=""> |
| 17 | + <ol class="list-group list-group-numbered custom-numbers noborder"> |
| 18 | + {% for coalitionId, sortedCoalitionScore in sortedCoalitionScores %} |
| 19 | + <li class="list-group-item big-coalition-row" style="background-color: {{ coalitionsObject[coalitionId].intra_coalition.color | rgba(0.5) }}; background-image: url({{ coalitionsObject[coalitionId].intra_coalition.cover_url }})"> |
| 20 | + <a href="/coalitions/{{ coalitionsObject[coalitionId].intra_coalition.id }}"> |
| 21 | + <div class="big-coalition-logo"> |
| 22 | + <img src="{{ coalitionsObject[coalitionId].intra_coalition.image_url }}" style="filter: invert(1);" /> |
| 23 | + </div> |
| 24 | + <div class="big-coalition-content"> |
| 25 | + <h5 class="coalition-name"><b>{{ coalitionsObject[coalitionId].intra_coalition.name | striptags(true) | escape }}</b></h5> |
| 26 | + <p class="coalition-description">{{ sortedCoalitionScore.score | thousands }} points</p> |
| 27 | + </div> |
| 28 | + </a> |
| 29 | + </li> |
| 30 | + {% endfor %} |
| 31 | + </ol> |
13 | 32 | </div> |
14 | 33 | </div> |
15 | | - <div class=""> |
16 | | - <ol class="list-group list-group-numbered custom-numbers noborder"> |
17 | | - {% for coalitionId, sortedCoalitionScore in sortedCoalitionScores %} |
18 | | - <li class="list-group-item big-coalition-row" style="background-color: {{ coalitionsObject[coalitionId].intra_coalition.color | rgba(0.5) }}; background-image: url({{ coalitionsObject[coalitionId].intra_coalition.cover_url }})"> |
19 | | - <a href="/coalitions/{{ coalitionsObject[coalitionId].intra_coalition.id }}"> |
20 | | - <div class="big-coalition-logo"> |
21 | | - <img src="{{ coalitionsObject[coalitionId].intra_coalition.image_url }}" style="filter: invert(1);" /> |
22 | | - </div> |
23 | | - <div class="big-coalition-content"> |
24 | | - <h5 class="coalition-name"><b>{{ coalitionsObject[coalitionId].intra_coalition.name | striptags(true) | escape }}</b></h5> |
25 | | - <p class="coalition-description">{{ sortedCoalitionScore.score | thousands }} points</p> |
26 | | - </div> |
27 | | - </a> |
28 | | - </li> |
29 | | - {% endfor %} |
30 | | - </ol> |
31 | | - </div> |
32 | | - </div> |
33 | 34 |
|
34 | | - <div class="card w-100 mb-4" id="score-history"> |
35 | | - <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
36 | | - <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">Score History</div> |
37 | | - <div class="d-inline-block"> |
| 35 | + <div class="card w-100 mb-4" id="score-history"> |
| 36 | + <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
| 37 | + <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">Score History</div> |
| 38 | + <div class="d-inline-block"> |
38 | 39 |
|
| 40 | + </div> |
39 | 41 | </div> |
40 | | - </div> |
41 | | - <div class="card-body"> |
42 | | - <div class="mb-4"> |
43 | | - <canvas height="300" class="codam-chart" data-url="/charts/coalitions/scores/history" id="coalition-score-history"></canvas> |
44 | | - </div> |
45 | | - <div class="progress mb-2" role="progressbar" aria-label="Progress of the current season" aria-valuenow="{{ now | timestamp }}" aria-valuemin="{{ currentBlocDeadline.begin_at | timestamp }}" aria-valuemax="{{ currentBlocDeadline.end_at | timestamp }}"> |
46 | | - <div class="progress-bar" style="width: {{ now | timestamp | perc3(currentBlocDeadline.begin_at | timestamp, currentBlocDeadline.end_at | timestamp) }}%;"></div> |
| 42 | + <div class="card-body"> |
| 43 | + <div class="mb-4"> |
| 44 | + <canvas height="300" class="codam-chart" data-url="/charts/coalitions/scores/history" id="coalition-score-history"></canvas> |
| 45 | + </div> |
| 46 | + <div class="progress mb-2" role="progressbar" aria-label="Progress of the current season" aria-valuenow="{{ now | timestamp }}" aria-valuemin="{{ currentBlocDeadline.begin_at | timestamp }}" aria-valuemax="{{ currentBlocDeadline.end_at | timestamp }}"> |
| 47 | + <div class="progress-bar" style="width: {{ now | timestamp | perc3(currentBlocDeadline.begin_at | timestamp, currentBlocDeadline.end_at | timestamp) }}%;"></div> |
| 48 | + </div> |
| 49 | + <p style="text-align: center;">The current season <b title="{{ currentBlocDeadline.end_at }}">ends {{ currentBlocDeadline.end_at | timeFromNow }}</b>!</p> |
47 | 50 | </div> |
48 | | - <p style="text-align: center;">The current season <b title="{{ currentBlocDeadline.end_at }}">ends {{ currentBlocDeadline.end_at | timeFromNow }}</b>!</p> |
49 | 51 | </div> |
50 | | - </div> |
51 | 52 |
|
52 | | - {% for rankingType in rankingTypes %} |
53 | | - <div class="card w-100 mb-4" id="ranking-{{ rankingType.type }}"> |
| 53 | + {% for rankingType in rankingTypes %} |
| 54 | + <div class="card w-100 mb-4" id="ranking-{{ rankingType.type }}"> |
| 55 | + <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
| 56 | + <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">{{ rankingType.name | striptags(true) | escape }}</div> |
| 57 | + <div class="d-inline-block"> |
| 58 | + |
| 59 | + </div> |
| 60 | + </div> |
| 61 | + <div class="card-body p-0"> |
| 62 | + <p class="p-4 pb-2">{{ rankingType.description | striptags(true) | escape | nl2br }}</p> |
| 63 | + <table class="table coalition-colored mb-0"> |
| 64 | + <tbody> |
| 65 | + {% for ranking in rankings[rankingType.type] %} |
| 66 | + <tr style="background: {{ ranking.coalition.color | rgba(0.25) }}; vertical-align: middle;"> |
| 67 | + <td class="fs-5 p-2" style="width: 25px;">{{ ranking.rank }}.</td> |
| 68 | + <td class="p-0"> |
| 69 | + <div class="d-inline-flex flex-row justify-content-start align-items-center text-light"> |
| 70 | + <a href="/profile/{{ ranking.user.login | striptags(true) | escape }}" class="p-2 text-light" style="text-decoration: none;"> |
| 71 | + <img loading="lazy" src="{{ ranking.user.image }}" class="user-picture rounded-circle d-inline-block me-2" height="32" /> |
| 72 | + <span>{{ ranking.user.usual_full_name | striptags(true) | escape }}</span> |
| 73 | + </a> |
| 74 | + </div> |
| 75 | + </td> |
| 76 | + <td class="text-end ps-2 pe-2 mt-0 mb-2">{{ ranking.score | thousands }}</td> |
| 77 | + </tr> |
| 78 | + {% endfor %} |
| 79 | + </tbody> |
| 80 | + </table> |
| 81 | + {# if no rankings, display a message #} |
| 82 | + {% if rankings[rankingType.type] | length == 0 %} |
| 83 | + <p class="text-muted p-4"><i>No rankings available (yet).</i></p> |
| 84 | + {% endif %} |
| 85 | + </div> |
| 86 | + </div> |
| 87 | + {% endfor %} |
| 88 | + {% else %} |
| 89 | + <div class="card w-100 mb-4" id="no-season"> |
54 | 90 | <div class="card-header pe-2 d-flex align-items-center" style="background-color: #6c757d;"> |
55 | | - <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">{{ rankingType.name | striptags(true) | escape }}</div> |
| 91 | + <div class="d-inline-block pe-3 lh-lg flex-grow-1" style="color: #fff; font-weight: bold;">No season ongoing</div> |
56 | 92 | <div class="d-inline-block"> |
57 | 93 |
|
58 | 94 | </div> |
59 | 95 | </div> |
60 | | - <div class="card-body p-0"> |
61 | | - <p class="p-4 pb-2">{{ rankingType.description | striptags(true) | escape | nl2br }}</p> |
62 | | - <table class="table coalition-colored mb-0"> |
63 | | - <tbody> |
64 | | - {% for ranking in rankings[rankingType.type] %} |
65 | | - <tr style="background: {{ ranking.coalition.color | rgba(0.25) }}; vertical-align: middle;"> |
66 | | - <td class="fs-5 p-2" style="width: 25px;">{{ ranking.rank }}.</td> |
67 | | - <td class="p-0"> |
68 | | - <div class="d-inline-flex flex-row justify-content-start align-items-center text-light"> |
69 | | - <a href="/profile/{{ ranking.user.login | striptags(true) | escape }}" class="p-2 text-light" style="text-decoration: none;"> |
70 | | - <img loading="lazy" src="{{ ranking.user.image }}" class="user-picture rounded-circle d-inline-block me-2" height="32" /> |
71 | | - <span>{{ ranking.user.usual_full_name | striptags(true) | escape }}</span> |
72 | | - </a> |
73 | | - </div> |
74 | | - </td> |
75 | | - <td class="text-end ps-2 pe-2 mt-0 mb-2">{{ ranking.score | thousands }}</td> |
76 | | - </tr> |
77 | | - {% endfor %} |
78 | | - </tbody> |
79 | | - </table> |
80 | | - {# if no rankings, display a message #} |
81 | | - {% if rankings[rankingType.type] | length == 0 %} |
82 | | - <p class="text-muted p-4"><i>No rankings available (yet).</i></p> |
| 96 | + <div class="card-body"> |
| 97 | + {% if nextBlocDeadline %} |
| 98 | + <p>The next season will start <b title="{{ nextBlocDeadline.begin_at }}">{{ nextBlocDeadline.begin_at | timeFromNow }}</b>!</p> |
| 99 | + {% else %} |
| 100 | + <p>There is currently no upcoming season scheduled. Please contact staff for more information.</p> |
83 | 101 | {% endif %} |
84 | 102 | </div> |
85 | 103 | </div> |
86 | | - {% endfor %} |
| 104 | + {% endif %} |
87 | 105 | </div> |
88 | 106 | {% else %} |
89 | 107 | {# This section is only displayed when the quiz is available. #} |
|
0 commit comments