91 lines
2.2 KiB
HTML
91 lines
2.2 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-artist-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
}
|
|
.vrobbler-artist-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 8px 0;
|
|
border-bottom: 1px solid #f0f0f0;
|
|
}
|
|
.vrobbler-artist-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.vrobbler-rank {
|
|
width: 24px;
|
|
font-weight: bold;
|
|
color: #666;
|
|
}
|
|
.vrobbler-artist-info {
|
|
flex: 1;
|
|
}
|
|
.vrobbler-artist-name {
|
|
font-weight: 500;
|
|
color: #333;
|
|
}
|
|
.vrobbler-scrobble-count {
|
|
font-size: 12px;
|
|
color: #888;
|
|
}
|
|
.vrobbler-artist-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>Last 7 Days Top Artists{% if user %} - {{ user.username }}{% endif %}</h3>
|
|
|
|
{% if error %}
|
|
<p class="vrobbler-error">{{ error }}</p>
|
|
{% elif top_artists %}
|
|
<ul class="vrobbler-artist-list">
|
|
{% for artist in top_artists %}
|
|
<li class="vrobbler-artist-item">
|
|
<span class="vrobbler-rank">{{ forloop.counter }}</span>
|
|
{% if artist.thumbnail %}
|
|
<img class="vrobbler-artist-thumb" src="{{ artist.thumbnail_small.url }}" alt="{{ artist.name }}">
|
|
{% else %}
|
|
<img class="vrobbler-artist-thumb" src="{% static 'images/not-found.jpg' %}" alt="{{ artist.name }}">
|
|
{% endif %}
|
|
<div class="vrobbler-artist-info">
|
|
<div class="vrobbler-artist-name">{{ artist.name }}</div>
|
|
<div class="vrobbler-scrobble-count">{{ artist.num_scrobbles }} scrobbles</div>
|
|
</div>
|
|
</li>
|
|
{% endfor %}
|
|
</ul>
|
|
{% else %}
|
|
<p class="vrobbler-no-data">No scrobbles in the last 7 days</p>
|
|
{% endif %}
|
|
</div>
|