90 lines
2.3 KiB
HTML
90 lines
2.3 KiB
HTML
{% load static %}
|
|
<style>
|
|
.vrobbler-widget {
|
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
max-width: 400px;
|
|
border: 1px solid #e0e0e0;
|
|
border-radius: 8px;
|
|
padding: 16px;
|
|
background: #fff;
|
|
}
|
|
.vrobbler-widget h3 {
|
|
margin: 0 0 12px 0;
|
|
font-size: 16px;
|
|
color: #333;
|
|
}
|
|
.vrobbler-board-game-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
.vrobbler-board-game-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
}
|
|
.vrobbler-board-game-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.vrobbler-rank {
|
|
width: 24px;
|
|
font-weight: bold;
|
|
color: #666;
|
|
}
|
|
.vrobbler-board-game-info {
|
|
flex: 1;
|
|
}
|
|
.vrobbler-board-game-title {
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
.vrobbler-play-count {
|
|
font-size: 12px;
|
|
color: #888;
|
|
}
|
|
.vrobbler-board-game-thumb {
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 4px;
|
|
object-fit: cover;
|
|
margin-right: 10px;
|
|
}
|
|
.vrobbler-error {
|
|
color: #d32f2f;
|
|
}
|
|
.vrobbler-no-data {
|
|
color: #666;
|
|
font-style: italic;
|
|
}
|
|
{% if custom_css %}
|
|
{{ custom_css }}
|
|
{% endif %}
|
|
</style>
|
|
|
|
<div class="vrobbler-widget">
|
|
<h3>Top Board Games - This Week{% if user %} - {{ user.username }}{% endif %}</h3>
|
|
|
|
{% if error %}
|
|
<p class="vrobbler-error">{{ error }}</p>
|
|
{% elif top_board_games %}
|
|
<ul class="vrobbler-board-game-list">
|
|
{% for game in top_board_games %}
|
|
<li class="vrobbler-board-game-item">
|
|
<span class="vrobbler-rank">{{ forloop.counter }}</span>
|
|
{% if game.cover %}
|
|
<img class="vrobbler-board-game-thumb" src="{{ game.cover_small.url }}" alt="{{ game.title }}">
|
|
{% else %}
|
|
<img class="vrobbler-board-game-thumb" src="{% static 'images/not-found.jpg' %}" alt="{{ game.title }}">
|
|
{% endif %}
|
|
<div class="vrobbler-board-game-info">
|
|
<div class="vrobbler-board-game-title">{{ game.title }}</div>
|
|
<div class="vrobbler-play-count">{{ game.num_plays }} plays</div>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p class="vrobbler-no-data">No board games played this week</p>
|
|
{% endif %}
|
|
</div> |