add patron badges for WPD
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 7.1 KiB |
After Width: | Height: | Size: 7.2 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 2.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 129 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 24 KiB |
|
@ -17,6 +17,11 @@ class BadgeDef(Base):
|
|||
def __repr__(self):
|
||||
return f"<BadgeDef(id={self.id})>"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def path(self):
|
||||
if 20 < self.id < 28: return f"/i/{SITE_NAME}/patron_badges/{self.id}.webp"
|
||||
return f"/i/badges/{self.id}.webp"
|
||||
|
||||
class Badge(Base):
|
||||
|
||||
|
@ -76,7 +81,7 @@ class Badge(Base):
|
|||
@property
|
||||
@lazy
|
||||
def path(self):
|
||||
return f"/i/badges/{self.badge_id}.webp"
|
||||
return self.badge.path
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="{{asset('images/badges/', badge.id|string+'.webp')}}" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=64.16></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
<label class="custom-control-label" for="{{badge.id}}"></label>
|
||||
</div>
|
||||
</td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="{{asset('images/badges/', badge.id|string+'.webp')}}" width=64.16 height=70></label></td>
|
||||
<td><label for="badge-{{badge.id}}"><img alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=64.16></label></td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td>{{badge.description}}</td>
|
||||
</tr>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<tr>
|
||||
<td>{{loop.index}}</td>
|
||||
<td>{{badge.name}}</td>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="{{asset('images/badges/', badge.id|string+'.webp')}}" width=45.83 height=50>
|
||||
<td><img alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=45.83>
|
||||
<td>{{badge.description}}</td>
|
||||
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
||||
<td class="badges-rarity-qty"><a href="/badge_owners/{{badge.id}}">{{ ct[0] }}</a></td>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<td>{{loop.index}}</td>
|
||||
<td><a style="color:#{{u.namecolor}}" href="/@{{u.username}}"><img loading="lazy" src="{{u.profile_url}}" class="pp20"><span {% if u.patron %}class="patron" style="background-color:#{{u.namecolor}}"{% endif %}>{{u.username}}</span></a></td>
|
||||
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="{{asset('images/badges/', '2'+u.patron|string+'.webp')}}"></td>
|
||||
<td><img alt="2{{u.patron}}" loading="lazy" width=29.33 src="{{asset_siteimg('patron_badges/', '2'+u.patron|string+'.webp')}}"></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
|
|
@ -30,15 +30,13 @@ set CACHE_VER = {
|
|||
'js/userpage.js': 244,
|
||||
'js/userpage_v.js': 245,
|
||||
'js/lozad.js': 260,
|
||||
|
||||
'images/badges/': 1023,
|
||||
}
|
||||
-%}
|
||||
|
||||
{%- macro asset(name, file='') -%}
|
||||
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
|
||||
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
|
||||
{%- endmacro -%}
|
||||
|
||||
{%- macro asset_siteimg(name) -%}
|
||||
/i/{{SITE_NAME}}/{{name}}?v=3009
|
||||
{%- macro asset_siteimg(name, file='') -%}
|
||||
/i/{{SITE_NAME}}/{{name}}{{file}}?v=3009
|
||||
{%- endmacro -%}
|
||||
|
|