forked from MarseyWorld/MarseyWorld
cachebust badges
parent
66417cc0e0
commit
da75577732
|
@ -26,8 +26,8 @@ class BadgeDef(Base):
|
|||
@property
|
||||
@lazy
|
||||
def path(self):
|
||||
if 20 < self.id < 28 or self.id == 222: return SITE_FULL + f"/i/{SITE_NAME}/badges/{self.id}.webp"
|
||||
return SITE_FULL + f"/i/badges/{self.id}.webp"
|
||||
if 20 < self.id < 28 or self.id == 222: return SITE_FULL + f"/i/{SITE_NAME}/badges/{self.id}.webp?b=7"
|
||||
return SITE_FULL + f"/i/badges/{self.id}.webp?b=7"
|
||||
|
||||
class Badge(Base):
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
</td>
|
||||
<td>
|
||||
<label for="badge-{{badge.id}}">
|
||||
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?b=6" width=64.16 height=70>
|
||||
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=64.16 height=70>
|
||||
</label>
|
||||
</td>
|
||||
<td>{{badge.name}}</td>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
<td>{{badge.id}}</td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>
|
||||
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?b=6" width=45.83 height=50>
|
||||
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=45.83 height=50>
|
||||
</td>
|
||||
<td>{{badge.description}}</td>
|
||||
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
||||
|
|
|
@ -247,10 +247,10 @@
|
|||
{% for b in u.badges %}
|
||||
{% if b.url %}
|
||||
<a class="contain" rel="nofollow noopener" href="{{b.url}}">
|
||||
<img alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?b=6" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
<img alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
</a>
|
||||
{% else %}
|
||||
<img class="contain" alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?b=6" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
<img class="contain" alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
@ -393,10 +393,10 @@
|
|||
{% for b in u.badges %}
|
||||
{% if b.url %}
|
||||
<a rel="nofollow noopener" href="{{b.url}}">
|
||||
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?b=6" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
</a>
|
||||
{% else %}
|
||||
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?b=6" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" data-nonce="{{g.nonce}}" data-onmouseover="badge_timestamp(this)"{% endif %}>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue