fewieden/MMM-soccer

View on GitHub
templates/MMM-soccer.njk

Summary

Maintainability
Test Coverage
{% if loading %}
    <div class="dimmed light">{{ "LOADING" | translate | safe }}</div>
{% else %}
    <header class="space-between">
        <span>{{ competitionName }}</span>
        <span>{{ "MATCHDAY" | translate({matchDayNumber: matchDayNumber}) }}</span>
    </header>
    <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="fa fa-line-chart"/></th>
                <th class="centered"><i class="fa fa-soccer-ball-o"/></th>
            </tr>
        </thead>
        <tbody>
            {% for index in range(boundaries.firstTeam, boundaries.lastTeam + 1) %}
                <tr class="centered-row {% if index === boundaries.focusTeamIndex %}bright{% endif %}" style="{{ index | fade(boundaries.focusTeamIndex) }}">
                    <td>{{ standing[index].position }}</td>
                    {% if config.logos %}
                        <td><img class="icon {% if not config.colored %}no-color{% endif %}" src="{{ standing[index].team.crestUrl }}"/></td>
                    {% endif %}
                    <td class="name">{{ standing[index].team.name }}</td>
                    <td class="centered">{{ standing[index].points }}</td>
                    <td class="centered">{{ standing[index].goalDifference }}</td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
{% endif %}