forked from rDrama/rDrama
add patron icons for WPD
parent
ef4f93576a
commit
9032e23182
|
@ -792,3 +792,18 @@ class User(Base):
|
||||||
elif self.patron: # Patrons get profile views as a perk
|
elif self.patron: # Patrons get profile views as a perk
|
||||||
return True
|
return True
|
||||||
return False
|
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 ''
|
|
@ -176,6 +176,7 @@ FEATURES = {
|
||||||
'USERS_SUICIDE': True,
|
'USERS_SUICIDE': True,
|
||||||
'MARKUP_COMMANDS': True,
|
'MARKUP_COMMANDS': True,
|
||||||
'REPOST_DETECTION': True,
|
'REPOST_DETECTION': True,
|
||||||
|
'PATRON_ICONS': False,
|
||||||
}
|
}
|
||||||
|
|
||||||
EMOJI_MARSEYS = True
|
EMOJI_MARSEYS = True
|
||||||
|
@ -316,6 +317,8 @@ elif SITE == 'pcmemes.net':
|
||||||
LOTTERY_TICKET_COST = 12
|
LOTTERY_TICKET_COST = 12
|
||||||
LOTTERY_SINK_RATE = -8
|
LOTTERY_SINK_RATE = -8
|
||||||
elif SITE == 'watchpeopledie.co':
|
elif SITE == 'watchpeopledie.co':
|
||||||
|
FEATURES['PATRON_ICONS'] = True
|
||||||
|
|
||||||
PERMS['HOLE_CREATE'] = 2
|
PERMS['HOLE_CREATE'] = 2
|
||||||
PERMS['CONTENT_THREADS'] = 2
|
PERMS['CONTENT_THREADS'] = 2
|
||||||
|
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label for="badge-{{badge.id}}">
|
<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>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td>{{badge.name}}</td>
|
<td>{{badge.name}}</td>
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<label for="badge-{{badge.id}}">
|
<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>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
<td>{{badge.name}}</td>
|
<td>{{badge.name}}</td>
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<td>{{loop.index}}</td>
|
<td>{{loop.index}}</td>
|
||||||
<td>{{badge.name}}</td>
|
<td>{{badge.name}}</td>
|
||||||
<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>
|
||||||
<td>{{badge.description}}</td>
|
<td>{{badge.description}}</td>
|
||||||
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
{%- set ct = counts[badge.id] if badge.id in counts else (0, 0) %}
|
||||||
|
|
|
@ -197,6 +197,10 @@
|
||||||
{% if c.ghost %}
|
{% if c.ghost %}
|
||||||
<span {% if c.distinguish_level %}class="mod"{% endif %}>👻</span>
|
<span {% if c.distinguish_level %}class="mod"{% endif %}>👻</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% 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}}">
|
<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 %}
|
{% endif %}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<td>{{loop.index}}</td>
|
<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><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>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
|
@ -663,6 +663,10 @@
|
||||||
{% if p.ghost %}
|
{% if p.ghost %}
|
||||||
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
|
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% 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}}">
|
<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 %}
|
{% endif %}
|
||||||
|
|
|
@ -199,6 +199,10 @@
|
||||||
{% if p.ghost %}
|
{% if p.ghost %}
|
||||||
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
|
<span {% if p.distinguish_level %}class="mod"{% endif %}>👻</span>
|
||||||
{% else %}
|
{% 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 %}
|
{% 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}}">
|
<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 %}
|
{% endif %}
|
||||||
|
|
|
@ -66,6 +66,10 @@
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% 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 %}
|
{% 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}}">
|
<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 %}
|
{% endif %}
|
||||||
|
@ -367,10 +371,10 @@
|
||||||
{% for b in u.badges %}
|
{% for b in u.badges %}
|
||||||
{% if b.url %}
|
{% if b.url %}
|
||||||
<a class="contain" rel="nofollow noopener noreferrer" href="{{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>
|
</a>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
@ -417,6 +421,10 @@
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% 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 %}
|
{% 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}}">
|
<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 %}
|
{% endif %}
|
||||||
|
@ -517,10 +525,10 @@
|
||||||
{% for b in u.badges %}
|
{% for b in u.badges %}
|
||||||
{% if b.url %}
|
{% if b.url %}
|
||||||
<a rel="nofollow noopener noreferrer" href="{{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>
|
</a>
|
||||||
{% else %}
|
{% 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 %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -37,6 +37,6 @@ set CACHE_VER = {
|
||||||
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
|
/assets/{{name}}{{file}}?v={{ CACHE_VER[name] }}
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
||||||
{%- macro asset_siteimg(name, file='') -%}
|
{%- macro asset_siteimg(name) -%}
|
||||||
/i/{{SITE_NAME}}/{{name}}{{file}}?v=3009
|
/i/{{SITE_NAME}}/{{name}}?v=3009
|
||||||
{%- endmacro -%}
|
{%- endmacro -%}
|
||||||
|
|
Loading…
Reference in New Issue