Skip to content

Commit

Permalink
Make the whole cell, not just the name clickable in live view, top us…
Browse files Browse the repository at this point in the history
…ers of week view.
  • Loading branch information
Bensge committed Jul 17, 2023
1 parent f3f590e commit 4ee8549
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 49 deletions.
20 changes: 10 additions & 10 deletions spybot/templates/spybot/home/live_fragment.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
</div>
{% for client in clients %}
{% if channel.id == client.channel_id|add:"0" %}
<div class="list-group-item py-1 d-flex flex-row align-items-center">
<a href="/u/{{ client.merged_user_id }}" class="text-decoration-none">
<div class="list-group-item py-1 d-flex flex-row align-items-center">

<span class="ms-2 me-1 {% if channel.id == 7 or channel.id == 13 %}red{% else %}green{% endif %}">
{% tabler_icon 'arrow-badge-right' size=20 %}
</span>
<span class="ms-2 me-1 {% if channel.id == 7 or channel.id == 13 %}red{% else %}green{% endif %}">
{% tabler_icon 'arrow-badge-right' size=20 %}
</span>

<div class="flex-column d-flex">
<a href="/u/{{ client.merged_user_id }}"
class="text-reset">{{ client.name }}</a>

<span class="text-muted small">{{ client.game }}</span>
<div class="flex-column d-flex">
<span>{{ client.name }}</span>
<span class="text-muted small">{{ client.game }}</span>
</div>
</div>
</div>
</a>
{% endif %}
{% endfor %}
{% endif %}
Expand Down
84 changes: 45 additions & 39 deletions spybot/templates/spybot/home/top_user_week.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,23 @@ <h3 class="card-title my-2">Top users this week</h3>
<div class="card-body">
<div class="divide-y">
{% if top_users_data|length > 0 %}
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-gold">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<a href="/u/{{ top_users_data.0.user_id }}" class="text-reset d-block">
{{ top_users_data.0.user_name }}
</a>
<a href="/u/{{ top_users_data.0.user_id }}" class="text-decoration-none text-reset d-block">
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-gold">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<span>
{{ top_users_data.0.user_name }}
</span>
</div>
<div class="text-muted">{{ top_users_data.0.time|floatformat }} hours this week</div>
</div>
<div class="text-muted">{{ top_users_data.0.time|floatformat }} hours this week</div>
</div>
</div>
</a>
{% else %}
<div class="row">
<div class="col-auto">
Expand All @@ -58,38 +60,42 @@ <h3 class="card-title my-2">Top users this week</h3>
</div>
{% endif %}
{% if top_users_data|length > 1 %}
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-silver">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<a href="/u/{{ top_users_data.1.user_id }}" class="text-reset d-block">
{{ top_users_data.1.user_name }}
</a>
<a href="/u/{{ top_users_data.1.user_id }}" class="text-decoration-none text-reset d-block">
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-silver">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<span>
{{ top_users_data.1.user_name }}
</span>
</div>
<div class="text-muted">{{ top_users_data.1.time|floatformat }} hours this week</div>
</div>
<div class="text-muted">{{ top_users_data.1.time|floatformat }} hours this week</div>
</div>
</div>
</a>
{% endif %}
{% if top_users_data|length > 2 %}
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-bronze">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<a href="/u/{{ top_users_data.2.user_id }}" class="text-reset d-block">
{{ top_users_data.2.user_name }}
</a>
<a href="/u/{{ top_users_data.2.user_id }}" class="text-decoration-none text-reset d-block">
<div class="row">
<div class="col-auto">
<span class="avatar bg-medal medal-bronze">
{% tabler_icon 'trophy' %}
</span>
</div>
<div class="col">
<div class="text-truncate">
<span>
{{ top_users_data.2.user_name }}
</span>
</div>
<div class="text-muted">{{ top_users_data.2.time|floatformat }} hours this week</div>
</div>
<div class="text-muted">{{ top_users_data.2.time|floatformat }} hours this week</div>
</div>
</div>
</a>
{% endif %}
</div>
</div>
Expand Down

0 comments on commit 4ee8549

Please sign in to comment.