user-stats: fix layout, fixes #13

This commit is contained in:
Gerdriaan Mulder
2020-03-28 15:54:26 +01:00
parent 62ba17ef67
commit 91d3b0cf35

View File

@ -16,171 +16,169 @@
{% if current_age_text %} {% if current_age_text %}
<div class="col-md-12 alert alert-info"> <div class="col-md-12 alert alert-info">
<strong>{{ current_age_text }}</strong> <strong>{{ current_age_text }}</strong>
</div>
{% endif %} {% endif %}
<div class="col-md-6">
<h2>Most played songs</h2>
<p>You have requested <strong> {{ stats.unique_requests }} </strong> different
songs a total of <strong> {{ stats.total_requests }} </strong> times. This
means <strong> {% widthratio stats.unique_requests stats.total_requests 100 %}% </strong> of your requests have been unique. </p>
<h4>Top {{ stats.stats_top_count }}:</h4>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Artist</th>
<th>Title</th>
<th># Requests</th>
</tr>
</thead>
<tbody>
{% for stat in stats.most_played_songs %}
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ stat.song__artist }}</td>
<td>{{ stat.song__title }}</td>
<td style="text-align: middle;">{{ stat.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
<div class="col-md-6">
<h2>Most played Artists</h2>
<h4>Top {{ stats.stats_top_count }}:</h4>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Artist</th>
<th style="text-align: right;"># Requests</th>
</tr>
</thead>
<tbody>
{% for stat in stats.most_played_artists %}
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ stat.song__artist }}</td>
<td style="text-align: right;">{{ stat.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<h2>Most played songs</h2> <h2>Uploads requested</h2>
<p>You have requested <strong> {{ stats.unique_requests }} </strong> different <p> You have uploaded a total of <strong> {{stats.total_uploads }} </strong> songs. The left column
songs a total of <strong> {{ stats.total_requests }} </strong> times. This shows how many times these have been requested by other people. The right column shows
means <strong> {% widthratio stats.unique_requests stats.total_requests 100 %}% </strong> of your requests have been unique. </p> how many times you requested your own songs. In total your songs
<h4>Top {{ stats.stats_top_count }}:</h4> have been queued <strong> {{stats.total_played_uploads }} </strong> times by others and
<div class="table-responsive"> <strong> {{stats.total_played_user_uploads }} </strong> by yourself.
<table class="table table-striped"> <h4>Top {{ stats.stats_top_count }}:</h4>
<thead> <div class="table-responsive">
<tr> <table class="table table-striped">
<th>#</th> <thead>
<th>Artist</th> <tr>
<th>Title</th> <th>#</th>
<th># Requests</th> <th>Artist</th>
</tr> <th>Title</th>
</thead> <th style="text-align: right;">Others</th>
<tbody> <th>You</th>
{% for stat in stats.most_played_songs %} </tr>
<tr> </thead>
<th>{{ forloop.counter }}</th> <tbody>
<td>{{ stat.song__artist }}</td> {% for stat in stats.most_played_uploads %}
<td>{{ stat.song__title }}</td> <tr>
<td style="text-align: middle;">{{ stat.total }}</td> <th>{{ forloop.counter }}</th>
</tr> <td>{{ stat.song__artist }}</td>
{% endfor %} <td>{{ stat.song__title }}</td>
</tbody> <td style="text-align: right;">{{ stat.total }}</td>
</table> <td>{{ stat.user_total }}</td>
</div> </tr>
{% endfor %}
</tbody>
</table>
</div> </div>
<div class="col-md-6"> </div>
<h2>Most played Artists</h2> <div class="col-md-6">
<h4>Top {{ stats.stats_top_count }}:</h4> <h2>Upload artists requested</h2>
<div class="table-responsive"> <p> The left column shows how many times songs from artists uploaded by you have been requested by
<table class="table table-striped"> other people. The right column shows how many times you requested those songs.
<thead> <h4>Top {{ stats.stats_top_count }}:</h4>
<tr> <div class="table-responsive">
<th>#</th> <table class="table table-striped">
<th>Artist</th> <thead>
<th style="text-align: right;"># Requests</th> <tr>
</tr> <th>#</th>
</thead> <th>Artist</th>
<tbody> <th style="text-align: right;">Others</th>
{% for stat in stats.most_played_artists %} <th>You</th>
<tr> </tr>
<th>{{ forloop.counter }}</th> </thead>
<td>{{ stat.song__artist }}</td> <tbody>
<td style="text-align: right;">{{ stat.total }}</td> {% for stat in stats.most_played_uploaded_artists %}
</tr> <tr>
{% endfor %} <th>{{ forloop.counter }}</th>
</tbody> <td>{{ stat.song__artist }}</td>
</table> <td style="text-align: right;">{{ stat.total }}</td>
</div> <td>{{ stat.user_total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div> </div>
<div class="col-md-6"> </div>
<h2>Uploads requested</h2> <div class="col-md-6">
<p> You have uploaded a total of <strong> {{stats.total_uploads }} </strong> songs. The left column <h2>Most played uploaders</h2>
shows how many times these have been requested by other people. The right column shows <p> The people whose songs you have queued the most are:</p>
how many times you requested your own songs. In total your songs <div class="table-responsive">
have been queued <strong> {{stats.total_played_uploads }} </strong> times by others and <table class="table table-striped">
<strong> {{stats.total_played_user_uploads }} </strong> by yourself. <thead>
<h4>Top {{ stats.stats_top_count }}:</h4> <tr>
<div class="table-responsive"> <th>#</th>
<table class="table table-striped"> <th>Uploader</th>
<thead> <th style="text-align: right;"># Requests</th>
<tr> </tr>
<th>#</th> </thead>
<th>Artist</th> <tbody>
<th>Title</th> {% for stat in stats.most_played_uploaders %}
<th style="text-align: right;">Others</th> <tr>
<th>You</th> <th>{{ forloop.counter }}</th>
</tr> <td>{{ stat.song__user__name }}</td>
</thead> <td style="text-align: right;">{{ stat.total }}</td>
<tbody> <td>({% widthratio stat.total stats.total_requests 100 %}%)</td>
{% for stat in stats.most_played_uploads %} </tr>
<tr> {% endfor %}
<th>{{ forloop.counter }}</th> </tbody>
<td>{{ stat.song__artist }}</td> </table>
<td>{{ stat.song__title }}</td>
<td style="text-align: right;">{{ stat.total }}</td>
<td>{{ stat.user_total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
<div class="col-md-6"> </div>
<h2>Upload artists requested</h2> <div class="col-md-6">
<p> The left column shows how many times songs from artists uploaded by you have been requested by <h2>Biggest fans</h2>
other people. The right column shows how many times you requested those songs. <p> The people that queued your songs the most are:</p>
<h4>Top {{ stats.stats_top_count }}:</h4> <div class="table-responsive">
<div class="table-responsive"> <table class="table table-striped">
<table class="table table-striped"> <thead>
<thead> <tr>
<tr> <th>#</th>
<th>#</th> <th>User</th>
<th>Artist</th> <th style="text-align: right;"># Requests</th>
<th style="text-align: right;">Others</th> </tr>
<th>You</th> </thead>
</tr> <tbody>
</thead> {% for stat in stats.biggest_fans %}
<tbody> <tr>
{% for stat in stats.most_played_uploaded_artists %} <th>{{ forloop.counter }}</th>
<tr> <td>{{ stat.user__name }}</td>
<th>{{ forloop.counter }}</th> <td style="text-align: right;">{{ stat.total }}</td>
<td>{{ stat.song__artist }}</td> </tr>
<td style="text-align: right;">{{ stat.total }}</td> {% endfor %}
<td>{{ stat.user_total }}</td> </tbody>
</tr> </table>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h2>Most played uploaders</h2>
<p> The people whose songs you have queued the most are:</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>Uploader</th>
<th style="text-align: right;"># Requests</th>
</tr>
</thead>
<tbody>
{% for stat in stats.most_played_uploaders %}
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ stat.song__user__name }}</td>
<td style="text-align: right;">{{ stat.total }}</td>
<td>({% widthratio stat.total stats.total_requests 100 %}%)</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<div class="col-md-6">
<h2>Biggest fans</h2>
<p> The people that queued your songs the most are:</p>
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>User</th>
<th style="text-align: right;"># Requests</th>
</tr>
</thead>
<tbody>
{% for stat in stats.biggest_fans %}
<tr>
<th>{{ forloop.counter }}</th>
<td>{{ stat.user__name }}</td>
<td style="text-align: right;">{{ stat.total }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div> </div>
</div> </div>
{% endif %} {% endif %}