{% extends 'base.html' %} {% block scripts %} {% endblock %} {# A right-aligned "Show N" control row below a list, reloading with the chosen row count. These lists are top-N rather than paged, so this says how much of the chart to see -- it is not the page size the tables elsewhere use. #} {% macro limit_select(name, current) %}
{# MSG: Label before the dropdown choosing how many ranked rows to show. #}
{% endmacro %} {# Both charts are ranked lists of a name and a count, so they share a header. #} {% macro ranking_head(what) %} {# MSG: Ranking table column header for a row's position in the chart. #} {% trans %}Rank{% endtrans %} {{ what }} {# MSG: Ranking table column header for how many times something was played. #} {% trans %}Plays{% endtrans %} {% endmacro %} {% block header %} {% endblock %} {% block content %} {% include 'partials/session_filter.html' %} {# MSG: Heading for the list of songs that have been sung the most times. #}

{% trans %}Top songs{% endtrans %}

{% if top_songs %} {# MSG: Ranking table column header for the song that was sung. #} {{ ranking_head(_("Song")) }} {% for song in top_songs %} {# The title as recorded, so a song still counts after leaving the library -- which is also why file_path can be missing, and with it any way to queue the song up again. #} {% endfor %}
{{ loop.index }} {% if song.file_path %} {# A bare fontello glyph, not a Bulma .icon: this one sits inline with the title, and .icon is a 1.5rem flex box that would ride above it. #} {% endif %} {# Through to every play of this song, and so to who sang it. The id goes with the title because a song downloaded twice ranks as two rows: without it both would open the same combined log, agreeing with neither count. #} {{ song.song }} {{ song.play_count }}
{{ limit_select("songs", limits.songs) }} {% else %} {# MSG: Shown on the rankings page when no songs have been played yet. #}

{% trans %}Nothing has been played yet.{% endtrans %}

{% endif %} {# MSG: Heading for the list of people who have sung the most songs. #}

{% trans %}Top performers{% endtrans %}

{% if top_performers %} {# MSG: Ranking table column header for the person who sang. #} {{ ranking_head(_("Performer")) }} {% for performer in top_performers %} {# Through to this person's plays. The session goes with it, so a chart scoped to one night links to that night rather than to all time. #} {% endfor %}
{{ loop.index }} {{ performer.performer }} {{ performer.play_count }}
{{ limit_select("performers", limits.performers) }} {% else %} {# MSG: Shown on the rankings page when nobody has sung anything yet. #}

{% trans %}Nobody has sung yet.{% endtrans %}

{% endif %} {% endblock %}