-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
site: player: Add separate teams page
Add a page which shows all teams a player has been on, in addition to the short list on the overview. Signed-off-by: Sean Anderson <[email protected]>
- Loading branch information
Showing
5 changed files
with
139 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{# SPDX-License-Identifier: AGPL-3.0-only #} | ||
{# Copyright (C) 2023 Sean Anderson <seanga2@gmail.com> #} | ||
{% from "macros/format.html" import date_col, optformat, optint %} | ||
{% from "macros/pretty.html" import format_map, league_map %} | ||
{% macro team_table(teams) %} | ||
<table> | ||
<thead> | ||
<tr> | ||
<th>League</th> | ||
<th>Team</th> | ||
<th>Most-recent Competition</th> | ||
<th><abbr title="Division of most-recent competition"> | ||
Division | ||
</abbr></th> | ||
<th><abbr title="Format of most-recent competition"> | ||
Format | ||
</abbr></th> | ||
<th><abbr title="Most-recent join date">Rostered From</abbr></th> | ||
<th><abbr title="Most-recent leave date">Rostered To</abbr></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for team in teams %} | ||
<tr> | ||
<td class="left"><a href="{{ url_for('league.comps', | ||
league=team['league']) }}"> | ||
{{ league_map[team['league']] }} | ||
</a></td> | ||
<td class="left"> | ||
<a href="{{ url_for('league.team.overview', league=team['league'], | ||
teamid=team['teamid']) }}"> | ||
{{ team['team'] }} | ||
</a></td> | ||
<td class="left"> | ||
<a href="{{ url_for('league.comp.overview', league=team['league'], | ||
compid=team['compid']) }}"> | ||
{{ team['comp'] }} | ||
</a></td> | ||
<td class="left">{{ team['div'] if team['div'] != None }}</td> | ||
<td class="left">{{ format_map[team['format']] }}</td> | ||
{{ date_col(team['from']) }} | ||
{{ date_col(team['to']) }} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{# SPDX-License-Identifier: AGPL-3.0-only #} | ||
{# Copyright (C) 2020, 23 Sean Anderson <seanga2@gmail.com> #} | ||
{% from "macros/filter.html" import filter %} | ||
{% from "macros/pagination.html" import navigation %} | ||
{% from "macros/sort.html" import sort %} | ||
{% from "macros/teams.html" import team_table %} | ||
{% extends "player/base.html" %} | ||
{% block title %}Teams - {{ super() }}{% endblock %} | ||
{% block content %} | ||
{{ super() }} | ||
<h2>Teams</h2> | ||
{{ filter('league', 'date', 'format') }} | ||
{{ sort({ | ||
'to': "Rostered to", | ||
'from': "Rostered from", | ||
}) }} | ||
{{ navigation(teams) }} | ||
{{ team_table(teams) }} | ||
{{ navigation(teams) }} | ||
{% endblock %} |