add patron icons for WPD

remotes/1693045480750635534/spooky-22
Aevann1 2022-08-25 22:34:05 +02:00
parent ef4f93576a
commit 9032e23182
11 changed files with 48 additions and 10 deletions

View File

@ -792,3 +792,18 @@ class User(Base):
elif self.patron: # Patrons get profile views as a perk
return True
return False
@property
@lazy
def patron_tooltip(self):
if self.patron == 1:
return 'Contributed at least $5'
if self.patron == 2:
return 'Contributed at least $10'
if self.patron == 3:
return 'Contributed at least $20'
if self.patron == 4:
return 'Contributed at least $50'
if self.patron == 5:
return 'Contributed at least $100'
return ''

View File

@ -176,6 +176,7 @@ FEATURES = {
'USERS_SUICIDE': True,
'MARKUP_COMMANDS': True,
'REPOST_DETECTION': True,
'PATRON_ICONS': False,
}
EMOJI_MARSEYS = True
@ -316,6 +317,8 @@ elif SITE == 'pcmemes.net':
LOTTERY_TICKET_COST = 12
LOTTERY_SINK_RATE = -8
elif SITE == 'watchpeopledie.co':
FEATURES['PATRON_ICONS'] = True
PERMS['HOLE_CREATE'] = 2
PERMS['CONTENT_THREADS'] = 2

View File

@ -62,7 +62,7 @@
</td>
<td>
<label for="badge-{{badge.id}}">
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=64.16 height=70>
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?v=1" width=64.16 height=70>
</label>
</td>
<td>{{badge.name}}</td>

View File

@ -62,7 +62,7 @@
</td>
<td>
<label for="badge-{{badge.id}}">
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=64.16 height=70>
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?v=1" width=64.16 height=70>
</label>
</td>
<td>{{badge.name}}</td>

View File

@ -28,7 +28,7 @@
<td>{{loop.index}}</td>
<td>{{badge.name}}</td>
<td>
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}" width=45.83 height=50>
<img class="contain" alt="{{badge.name}}" loading="lazy" src="{{badge.path}}?v=1" width=45.83 height=50>
</td>
<td>{{badge.description}}</td>
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}

View File

@ -197,6 +197,10 @@
{% if c.ghost %}
<span {% if c.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if FEATURES['PATRON_ICONS'] and c.author.patron %}
<img loading="lazy" src="/i/{{SITE_NAME}}/patron_badges/2{{c.author.patron}}.webp?v=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{c.author.patron_tooltip}}" alt="{{c.author.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and c.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{c.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{c.author.house}}" alt="House {{c.author.house}}">
{% endif %}

View File

@ -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 class="contain" alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="{{asset_siteimg('patron_badges/', '2'+u.patron|string+'.webp')}}">
<img class="contain" alt="2{{u.patron}}" loading="lazy" width=29.33 height=32 src="/i/{{SITE_NAME}}/patron_badges/2{{u.patron}}.webp?v=1">
</td>
</tr>
{% endfor %}

View File

@ -663,6 +663,10 @@
{% if p.ghost %}
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if FEATURES['PATRON_ICONS'] and p.author.patron %}
<img loading="lazy" src="/i/{{SITE_NAME}}/patron_badges/2{{p.author.patron}}.webp?v=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.patron_tooltip}}" alt="{{p.author.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and p.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{p.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{p.author.house}}" alt="House {{p.author.house}}">
{% endif %}

View File

@ -199,6 +199,10 @@
{% if p.ghost %}
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
{% else %}
{% if FEATURES['PATRON_ICONS'] and p.author.patron %}
<img loading="lazy" src="/i/{{SITE_NAME}}/patron_badges/2{{p.author.patron}}.webp?v=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.patron_tooltip}}" alt="{{p.author.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and p.author.house %}
<img loading="lazy" src="/i/{{SITE_NAME}}/houses/{{p.author.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{p.author.house}}" alt="House {{p.author.house}}">
{% endif %}

View File

@ -66,6 +66,10 @@
</span>
{% endif %}
{% if FEATURES['PATRON_ICONS'] and u.patron %}
<img loading="lazy" class="ml-3" src="/i/{{SITE_NAME}}/patron_badges/2{{u.patron}}.webp?v=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and u.house %}
<img loading="lazy" class="ml-3" id="profile--house" src="/i/{{SITE_NAME}}/houses/{{u.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{u.house}}" alt="House {{u.house}}">
{% endif %}
@ -367,10 +371,10 @@
{% for b in u.badges %}
{% if b.url %}
<a class="contain" rel="nofollow noopener noreferrer" href="{{b.url}}">
<img alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?v=1021" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
<img alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
</a>
{% else %}
<img class="contain" alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?v=1021" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
<img class="contain" alt="{{b.name}}" width=55 height=60 loading="lazy" src="{{b.path}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
{% endif %}
{% endfor %}
</div>
@ -417,6 +421,10 @@
</span>
{% endif %}
{% if FEATURES['PATRON_ICONS'] and u.patron %}
<img loading="lazy" class="ml-2" src="/i/{{SITE_NAME}}/patron_badges/2{{u.patron}}.webp?v=1" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{u.patron_tooltip}}" alt="{{u.patron_tooltip}}">
{% endif %}
{% if FEATURES['HOUSES'] and u.house %}
<img loading="lazy" class="ml-2" id="profile-mobile--house" src="/i/{{SITE_NAME}}/houses/{{u.house}}.webp?v=2000" height="20" data-bs-toggle="tooltip" data-bs-placement="bottom" title="House {{u.house}}" alt="House {{u.house}}">
{% endif %}
@ -517,10 +525,10 @@
{% for b in u.badges %}
{% if b.url %}
<a rel="nofollow noopener noreferrer" href="{{b.url}}">
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?v=1021" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
</a>
{% else %}
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?v=1021" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
<img class="contain" alt="{{b.name}}" width=29.33 height=32 loading="lazy" src="{{b.path}}?v=1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{b.text}}" {% if b.until %}data-until="{{b.until}}" onmouseover="badge_timestamp(this)"{% endif %}>
{% endif %}
{% endfor %}
</div>

View File

@ -37,6 +37,6 @@ set CACHE_VER = {
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
{%- endmacro -%}
{%- macro asset_siteimg(name, file='') -%}
/i/{{SITE_NAME}}/{{name}}{{file}}?v=3009
{%- macro asset_siteimg(name) -%}
/i/{{SITE_NAME}}/{{name}}?v=3009
{%- endmacro -%}