djbrown/hbscorez

View on GitHub
src/teams/jinja2/teams/scorers.j2

Summary

Maintainability
Test Coverage
{% extends 'teams/base.j2' %}
{% block title %}Schützen - {{ super() }}{% endblock %}
{% block description %}Torschützenranking der Mannschaft '{{ team.name }}' in der Liga '{{ team.league.name }}' des Bereichs
    '{{ team.league.district.name }}'{% endblock %}
{% block content %}
    {{ super() }}
    <nav class="nav nav-pills mb-3">
        <a class="nav-item nav-link m-1" href="{{ url('teams:detail', args=[team.bhv_id]) }}">Übersicht</a>
        <a class="nav-item nav-link m-1" href="{{ url('teams:games', args=[team.bhv_id]) }}">Spiele</a>
        <a class="nav-item nav-link m-1" href="{{ url('teams:players', args=[team.bhv_id]) }}">Spieler</a>
        <a class="nav-item nav-link m-1 active" href="#/">Schützen</a>
        <a class="nav-item nav-link m-1" href="{{ url('teams:offenders', args=[team.bhv_id]) }}">Straffällige</a>
    </nav>
    <h2>Schützen</h2>
    <div class="table-responsive">
        <table id="data-table" class="table table-sm table-striped">
            <caption>Schützen</caption>
            <thead>
            <tr>
                <th scope="col">Pl.</th>
                <th scope="col">Name</th>
                <th scope="col">Sp.</th>
                <th scope="col">Tore</th>
                <th scope="col">7m</th>
                <th scope="col">Feldt.</th>
                <th scope="col">Tore &Oslash;</th>
                <th scope="col">Feldt. &Oslash;</th>
            </tr>
            </thead>
            <tbody>
            {% for player in players %}
                <tr>
                    <th scope="row">{{ player.place }}</th>
                    <td><a href="{{ player.get_absolute_url() }}">{{ player.public_name() }}</a></td>
                    <td>{{ player.games }}</td>
                    <td>{{ player.total_goals }}</td>
                    <td>{{ player.total_penalty_goals }}</td>
                    <td>{{ player.total_field_goals }}</td>
                    <td>{{ '%0.2f'| format(player.total_goals / player.games) }}</td>
                    <td>{{ '%0.2f'| format(player.total_field_goals / player.games) }}</td>
                </tr>
            {% endfor %}
            </tbody>
            <tfoot>
            <tr>
                <th scope="col">Pl.</th>
                <th scope="col">Name</th>
                <th scope="col">Sp.</th>
                <th scope="col">Tore</th>
                <th scope="col">7m</th>
                <th scope="col">Feldt.</th>
                <th scope="col">Tore &Oslash;</th>
                <th scope="col">Feldt. &Oslash;</th>
            </tr>
            </tfoot>
        </table>
    </div>
{% endblock %}