WPD: make holes more flair-like in UI.

master
Snakes 2022-06-23 05:40:01 -04:00
parent cd556b6d8e
commit 268c23e2f8
8 changed files with 26 additions and 15 deletions

View File

@ -139,6 +139,7 @@ AGENDAPOSTER_MSG_HTML = """<p>Hi <a href="/id/{id}"><img loading="lazy" src="/pp
################################################################################
HOLE_NAME = 'hole'
HOLE_STYLE_FLAIR = False
HOLE_COST = 0
HOLE_CREATE_JL_MIN = 0
HOLE_INACTIVITY_DELETION = False
@ -285,6 +286,7 @@ elif SITE == 'cringetopia.org':
}
elif SITE == 'watchpeopledie.co':
HOLE_NAME = 'flair'
HOLE_STYLE_FLAIR = True
HOLE_CREATE_JL_MIN = 2
GIFT_NOTIF_ID = 13

View File

@ -55,6 +55,6 @@ def inject_constants():
"CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID,
"PIZZASHILL_ID":PIZZASHILL_ID, "DEFAULT_COLOR":DEFAULT_COLOR,
"COLORS":COLORS, "ADMIGGERS":ADMIGGERS, "datetime":datetime, "time":time,
"HOLE_NAME": HOLE_NAME,
"HOLE_NAME": HOLE_NAME, "HOLE_STYLE_FLAIR": HOLE_STYLE_FLAIR,
"LOTTERY_ENABLED": LOTTERY_ENABLED, "GUMROAD_LINK": GUMROAD_LINK,
"DEFAULT_THEME": DEFAULT_THEME, "DESCRIPTION": DESCRIPTION}

View File

@ -34,7 +34,7 @@
</a>
{% if sub %}
<a href="/h/{{sub.name}}" class="font-weight-bold ml-1 flex-grow-1 mt-1" style="font-size:max(14px,1.2vw)">/h/{{sub.name}}</a>
<a href="/h/{{sub.name}}" class="font-weight-bold ml-2 flex-grow-1 mt-1" style="font-size:max(14px,1.2vw)">{% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{sub.name}}</a>
{% elif SITE_NAME not in ('PCM','WPD') %}
<style>
{% if g.webview %}

View File

@ -44,14 +44,15 @@
{% if sub %}
<div class="mt-3">
{% if v %}
<a class="btn btn-primary btn-follow {% if v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/follow','follow-sub','unfollow-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-bell mr-1"></i> Follow /h/{{sub.name}}</a>
<a class="btn btn-primary btn-follow {% if not v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unfollow','follow-sub','unfollow-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-bell-slash mr-1"></i> Unfollow /h/{{sub.name}}</a>
{%- set hole_prefix = '/h/' if not HOLE_STYLE_FLAIR else '' -%}
<a class="btn btn-primary btn-follow {% if v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/follow','follow-sub','unfollow-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-bell mr-1"></i> Follow {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-follow {% if not v.follows(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unfollow','follow-sub','unfollow-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-bell-slash mr-1"></i> Unfollow {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-eye-slash mr-2"></i>Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-eye mr-2"></i>Unblock /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3 {% if v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/block','block-sub','unblock-sub');this.classList.toggle('d-none');nextElementSibling.classList.toggle('d-none')"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3 {% if not v.blocks(sub.name) %}d-none{% endif %}" onclick="post_toast(this,'/h/{{sub.name}}/unblock','block-sub','unblock-sub');this.classList.toggle('d-none');previousElementSibling.classList.toggle('d-none')"><i class="fas fa-eye mr-2"></i>Unblock {{hole_prefix}}{{sub.name}}</a>
{% else %}
<a class="btn btn-primary btn-block" href="/login"><i class="fas fa-bell mr-1"></i>Follow /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3" href="/login"><i class="fas fa-eye-slash mr-2"></i>Block /h/{{sub.name}}</a>
<a class="btn btn-primary btn-block" href="/login"><i class="fas fa-bell mr-1"></i>Follow {{hole_prefix}}{{sub.name}}</a>
<a class="btn btn-primary btn-block mt-3" href="/login"><i class="fas fa-eye-slash mr-2"></i>Block {{hole_prefix}}{{sub.name}}</a>
{% endif %}
</div>
{% endif %}

View File

@ -22,11 +22,11 @@
{% endif %}
{% if v and v.mods(sub.name) %}
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/settings">{{HOLE_NAME|upper}} SETTINGS</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/exilees">{{HOLE_NAME|upper}} EXILES</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/followers">{{HOLE_NAME|upper}} FOLLOWERS</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/blockers">{{HOLE_NAME|upper}} BLOCKERS</a>
{% endif %}
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/mods">{{HOLE_NAME|upper}} MODS</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/exilees">{{HOLE_NAME|upper}} EXILEES</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/followers">{{HOLE_NAME|upper}} FOLLOWERS</a>
<a class="btn btn-primary btn-block mb-3" href="/h/{{sub.name}}/blockers">{{HOLE_NAME|upper}} BLOCKERS</a>
{% endif %}
<div id="sidebar--rules">

View File

@ -705,7 +705,11 @@
<div class="post-meta text-left mb-2">
{% if p.sub %}
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{% if not HOLE_STYLE_FLAIR -%}
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{%- else -%}
<a href='/h/{{p.sub}}' class="sub-flair">{{p.sub|capitalize}}</a>
{%- endif %}
{% endif %}
{% if p.sub and p.author.exiled_from(p.sub) %}

View File

@ -148,11 +148,15 @@
<div class="post-meta text-left x-scroll mb-md-2">
{% if p.sub %}
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{% if not HOLE_STYLE_FLAIR -%}
<a href='/h/{{p.sub}}'>/h/{{p.sub}}</a>&nbsp;&nbsp;
{%- else -%}
<a href='/h/{{p.sub}}' class="sub-flair">{{p.sub|capitalize}}</a>
{%- endif %}
{% endif %}
{% if p.sub and p.author.exiled_from(p.sub) %}
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from /h/{{p.sub}}"></i></a>
<a role="button"><i class="fas fa-campfire text-danger" data-bs-toggle="tooltip" data-bs-placement="bottom" title="User has been exiled from {% if not HOLE_STYLE_FLAIR %}/h/{% endif %}{{p.sub}}"></i></a>
{% endif %}
{% if p.bannedfor %}

View File

@ -1,6 +1,6 @@
{%-
set CACHE_VER = {
'css/main.css': 360,
'css/main.css': 361,
'css/4chan.css': 61,
'css/classic.css': 61,