accomodate alt domain

remotes/1693176582716663532/tmp_refs/heads/watchparty
Aevann1 2022-11-03 17:29:14 +02:00
parent f151e2accd
commit 07a12380de
15 changed files with 20 additions and 20 deletions

View File

@ -89,7 +89,7 @@ class Comment(Base):
@lazy
def can_see(self, v):
if SITE not in ('rdrama.net','rdrama.com'): return True
if not SITE.startswith('rdrama.'): return True
if not self.parent_submission: return True
if self.post.sub != 'chudrama': return True
if v:

View File

@ -79,7 +79,7 @@ class Submission(Base):
@lazy
def can_see(self, v):
if SITE not in ('rdrama.net','rdrama.com'): return True
if not SITE.startswith('rdrama.'): return True
if self.sub != 'chudrama': return True
if v:
if v.can_see_chudrama: return True

View File

@ -403,7 +403,7 @@ ANTISPAM_BYPASS_IDS = ()
PAGE_SIZE = 25
LEADERBOARD_LIMIT = PAGE_SIZE
if SITE in ('rdrama.net','rdrama.com'):
if SITE.startswith('rdrama.'):
FEATURES['PRONOUNS'] = True
FEATURES['HOUSES'] = True
PERMS['ADMIN_ADD'] = 4
@ -1229,7 +1229,7 @@ if len(SITE_NAME) > 5:
if SITE != 'localhost':
REDDIT_NOTIFS_SITE.add(SITE)
if SITE in ('rdrama.net','rdrama.com'):
if SITE.startswith('rdrama.'):
REDDIT_NOTIFS_SITE.add('marsey')
REDDIT_NOTIFS_SITE.add('"r/Drama"')
REDDIT_NOTIFS_SITE.add('justice4darrell')

View File

@ -24,7 +24,7 @@ def chart(kind, site):
now.tm_wday, now.tm_yday, 0))
today_cutoff = calendar.timegm(midnight_this_morning)
if SITE in ('rdrama.net','rdrama.com'):
if SITE.startswith('rdrama.'):
time_diff = time.time() - 1619827200
num_of_weeks = int(time_diff / 604800)
chart_width = int(num_of_weeks/1.4)

View File

@ -159,7 +159,7 @@ def merge_all(v, id):
@app.post("/@<username>/make_admin")
@admin_level_required(PERMS['ADMIN_ADD'])
def make_admin(v, username):
if SITE in ('rdrama.net','rdrama.com'): abort(403)
if SITE.startswith('rdrama.'): abort(403)
user = get_user(username)

View File

@ -158,7 +158,7 @@ def award_thing(v, thing_type, id):
author = thing.author
if author.shadowbanned: abort(404)
if SITE in ('rdrama.net','rdrama.com') and author.id in (PIZZASHILL_ID, CARP_ID):
if SITE.startswith('rdrama.') and author.id in (PIZZASHILL_ID, CARP_ID):
abort(403, "This user is immune to awards.")
if kind == "benefactor" and author.id == v.id:

View File

@ -56,7 +56,7 @@ def speak(data, v):
global messages, total
if SITE in ('rdrama.net','rdrama.com'): text = data['message'][:200].strip()
if SITE.startswith('rdrama.'): text = data['message'][:200].strip()
else: text = data['message'][:1000].strip()
if not text: return '', 403

View File

@ -22,7 +22,7 @@ def rdrama(id, title):
@app.get("/marseys")
@auth_required
def marseys(v):
if SITE in ('rdrama.net','rdrama.com'):
if SITE.startswith('rdrama.'):
marseys = g.db.query(Marsey, User).join(User, Marsey.author_id == User.id).filter(Marsey.submitter_id==None)
sort = request.values.get("sort", "usage")
if sort == "usage":
@ -56,7 +56,7 @@ def marsey_list():
if EMOJI_MARSEYS:
emojis = [{
"name": emoji.name,
"author": author if SITE in ('rdrama.net','rdrama.com') or author == "anton-d" else None,
"author": author if SITE.startswith('rdrama.') or author == "anton-d" else None,
# yikes, I don't really like this DB schema. Next time be better
"tags": emoji.tags.split(" ") + [emoji.name[len("marsey"):] \
if emoji.name.startswith("marsey") else emoji.name],

View File

@ -428,7 +428,7 @@ def message2(v, username):
body_html = sanitize(message)
if not (SITE in ('rdrama.net','rdrama.com') and user.id == BLACKJACKBTZ_ID):
if not (SITE.startswith('rdrama.') and user.id == BLACKJACKBTZ_ID):
existing = g.db.query(Comment.id).filter(Comment.author_id == v.id,
Comment.sentto == user.id,
Comment.body_html == body_html,

View File

@ -399,7 +399,7 @@
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
<button type="button" class="btn caction py-0 nobackground px-1 text-muted copy-link" data-clipboard-text="{% if SITE in ('rdrama.net','rdrama.com') %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
<button type="button" class="btn caction py-0 nobackground px-1 text-muted copy-link" data-clipboard-text="{% if SITE.startswith('rdrama.') %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %}
{% if not c.deleted_utc %}
@ -608,7 +608,7 @@
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a>
<button type="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE in ('rdrama.net','rdrama.com') %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy link</button>
<button type="button" class="list-group-item copy-link" data-bs-dismiss="modal" data-clipboard-text="{% if SITE.startswith('rdrama.') %}https://{{BAN_EVASION_DOMAIN}}{{c.shortlink}}{% else %}{{c.permalink}}{% endif %}"><i class="fas fa-copy mr-2"></i>Copy link</button>
{% if v %}
<button type="button" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportCommentModal" onclick="report_commentModal('{{c.id}}','{{c.author_name}}')" class="list-group-item"><i class="fas fa-flag mr-2"></i>Report</button>

View File

@ -84,7 +84,7 @@
<th scope="col">Hat</th>
<th scope="col">Name</th>
<th scope="col">Description</th>
{% if SITE in ('rdrama.net','rdrama.com') %}
{% if SITE.startswith('rdrama.') %}
{% if request.values.get("sort") == 'author_asc' %}
<th scope="col"><a href="?sort=author_desc">Author</a></th>
{% else %}
@ -114,7 +114,7 @@
</td>
<td>{{hat.name}}</td>
<td style="word-break:break-word">{{hat.censored_description(v)}}</td>
{% if SITE in ('rdrama.net','rdrama.com') %}
{% if SITE.startswith('rdrama.') %}
<td>{% include "user_in_table.html" %}</td>
{% endif %}
<td><a href="/hat_owners/{{hat.id}}">{{hat.number_sold}}</a></td>

View File

@ -35,7 +35,7 @@
{% endmacro %}
{% macro cf_2fa_verify() %}
{% if SITE in ('rdrama.net','rdrama.com') %}
{% if SITE.startswith('rdrama.') %}
<meta name="cf-2fa-verify" content="4f40ca1ca249313">
{% elif SITE == 'watchpeopledie.tv' %}
<meta name="cf-2fa-verify" content="372aba5b9338e00">

View File

@ -7,7 +7,7 @@
<th>Name</th>
<th>Marsey</th>
<th>Usage</th>
{% if SITE in ('rdrama.net','rdrama.com') %}
{% if SITE.startswith('rdrama.') %}
<th><a href="?sort=author">Author</a></th>
<th><a href="?sort=added">Added on</a></th>
<th>Original File</th>
@ -15,7 +15,7 @@
</tr>
</thead>
<tbody id="marseys-table">
{% if SITE in ('rdrama.net','rdrama.com') %}
{% if SITE.startswith('rdrama.') %}
{% for marsey, user in marseys %}
<tr>
<td>{{loop.index}}</td>

View File

@ -12,7 +12,7 @@
<button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' onclick="document.getElementById('giveaward').dataset.action = this.dataset.url"><i class="fas fa-gift fa-fw"></i>Give Award</button>
{% endif %}
<button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE in ('rdrama.net','rdrama.com') %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
<button type="button" class="list-inline-item copy-link" data-clipboard-text="{% if SITE.startswith('rdrama.') %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="fas fa-copy"></i>Copy link</button>
{% if v %}
<button type="button" id="subscribe-{{p.id}}" class="{% if p.id in v.subscribed_idlist %}d-none{% endif %} list-inline-item" data-click="postToast(this,'/subscribe/{{p.id}}','subscribe-{{p.id}}','unsubscribe-{{p.id}}','d-none')" onclick="areyousure(this)"><i class="fas fa-eye"></i>Subscribe</button>

View File

@ -8,7 +8,7 @@
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="btn-block" href="/votes/{{p.fullname}}"><button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted"><i class="fas fa-arrows-v text-center text-muted mr-2"></i>Votes</button></a>{% endif %}
<button type="button" data-bs-dismiss="modal" class="copy-link nobackground btn btn-link btn-block btn-lg text-left text-muted" data-clipboard-text="{% if SITE in ('rdrama.net','rdrama.com') %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="far fa-copy text-center text-muted mr-2"></i>Copy link</button>
<button type="button" data-bs-dismiss="modal" class="copy-link nobackground btn btn-link btn-block btn-lg text-left text-muted" data-clipboard-text="{% if SITE.startswith('rdrama.') %}https://{{BAN_EVASION_DOMAIN}}{{p.shortlink}}{% else %}{{p.permalink}}{% endif %}"><i class="far fa-copy text-center text-muted mr-2"></i>Copy link</button>
<button type="button" class="nobackground btn btn-link btn-block btn-lg text-left text-muted" data-bs-toggle="modal" data-bs-dismiss="modal" data-bs-target="#reportPostModal" onclick="report_postModal('{{p.id}}')"><i class="far fa-flag text-center text-muted mr-2"></i>Report</button>