forked from fewieden/MMM-soccer
-
Notifications
You must be signed in to change notification settings - Fork 4
/
MMM-soccer.njk
127 lines (121 loc) · 4.75 KB
/
MMM-soccer.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<div class="soccerWrapper {% if isModalActive %}MMM-soccer-blur{% endif %}" style="width: {{config.width}}px">
<header>MMM-Soccer</header>
{% if loading %}
{{'LOADING' | translate}}
{% else %}
{% if config.showMatches %}
<div class="xsmall">
{% if comps.length %}
{% for i in range(0, comps.length) %}
<table class="games">
<tbody>
<tr class="small matchDay bold centered-row">
<td rowspan="2" style="text-align: right; vertical-align: middle; padding-right: 15px; width: 50%;">
<img class="big-icon {% if not config.colored %}no-color{% endif %}" src="{{comps[i].emblem}}"></img>
</td>
<td style="text-align: left">{{ comps[i].competition }}</td>
</tr>
<tr class="small matchDay bold centered-row"><td style="text-align: left">{{ comps[i].season }}</td></tr>
</tbody>
</table>
<table class="games">
<tbody>
{% for m in range(0, comps[i].matches.length) %}
<tr class="centered-row {% if comps[i].matches[m].focused %}bright{% endif %}">
<td class="name matchName homeTeam {{comps[i].matches[m].status}} {{comps[i].matches[m].homeTeam.status}}">{{comps[i].matches[m].homeTeam.name | replace}}</td>
{% if config.logos %}
<td class="logo">
<img class="icon {% if not config.colored %}no-color{% endif %}" src="{{teams[comps[i].matches[m].homeTeam.id].crest}}"/>
</td>
{% endif %}
<td class="status bold {{comps[i].matches[m].status}}">{{ comps[i].matches[m].state }}</td>
{% if config.logos %}
<td class="logo"><img class="icon {% if not config.colored %}no-color{% endif %}" src="{{teams[comps[i].matches[m].awayTeam.id].crest}}"/></td>
{% endif %}
<td class="name matchName awayTeam {{comps[i].matches[m].status}} {{comps[i].matches[m].awayTeam.status}}">{{comps[i].matches[m].awayTeam.name | replace}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% else %}
<tr class="centered-row">
<td>{{ 'NO_MATCHES' | translate }}</td>
</tr>
{% endif %}
</div>
{% endif %}
{% if showTable %}
<table class="xsmall table">
<thead>
<tr class="row">
<th></th>
{% if config.logos %}
<th></th>
{% endif %}
<th class="name">{{'TEAM' | translate}}</th>
<th class="centered"><i class="fas fa-futbol"/></th>
<th class="centered"><i class="fas fa-chart-line"/></th>
<th class="centered"><i class="fas fa-bullseye"/></th>
</tr>
</thead>
<tbody>
{% for i in range(boundaries.firstTeam, boundaries.lastTeam) %}
<tr class="centered-row {% if i === boundaries.focusTeamIndex %}bright{% endif %}" style="{{i | fade(boundaries.focusTeamIndex)}}">
<tr class="centered-row {% if i === boundaries.focusTeamIndex %}bright{% endif %}" style="{{i | fade(boundaries.focusTeamIndex)}}">
<td>{{table[i].position}}</td>
{% if config.logos %}
<td class="logo"><img class="icon {% if not config.colored %}no-color{% endif %}" src="{{table[i].team.crest}}"/></td>
{% endif %}
<td class="name">{{table[i].team.name | replace}}</td>
<td class="centered">{{table[i].playedGames}}</td>
<td class="centered">{{table[i].points}}</td>
<td class="centered">{% if table[i].goalDifference > 0 %}+{% endif %}{{table[i].goalDifference}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
{% endif %}
</div>
{% if isModalActive %}
<div class="modal">
{% if modal.standings %}
<table class="small table">
<thead>
<tr class="row">
<th></th>
{% if config.logos %}
<th></th>
{% endif %}
<th class="name">{{'TEAM' | translate}}</th>
<th class="centered"><i class="fas fa-chart-line"/></th>
<th class="centered"><i class="fas fa-futbol"/></th>
</tr>
</thead>
<tbody>
{% for entry in table %}
<tr class="centered-row {% if index === boundaries.focusTeamIndex %}bright{% endif %}">
<td>{{entry.position}}</td>
{% if config.logos %}
<td><img class="icon {% if not config.colored %}no-color{% endif %}" src={{entry.team.crestUrl}}/></td>
{% endif %}
<td class="name">{{entry.team.name}}</td>
<td class="centered">{{entry.points}}</td>
<td class="centered">{{entry.goalDifference}}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h1 class="medium">{{competitionName}} - {{'COMMAND_LIST' | translate}}</h1>
<div>{{'MODE' | translate}}: {{voice.mode}}</div>
<div>{{'VOICE_COMMANDS' | translate}}</div>
<ul>
{% for sentence in voice.sentences %}
<li>{{sentence}}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}