forked from MarseyWorld/MarseyWorld
accomodate rdrama.com users
parent
086643bf79
commit
f73c6d46df
|
@ -89,7 +89,7 @@ class Comment(Base):
|
|||
|
||||
@lazy
|
||||
def can_see(self, v):
|
||||
if SITE != 'rdrama.net': return True
|
||||
if SITE not in ('rdrama.net','rdrama.com'): return True
|
||||
if not self.parent_submission: return True
|
||||
if self.post.sub != 'chudrama': return True
|
||||
if v:
|
||||
|
|
|
@ -79,7 +79,7 @@ class Submission(Base):
|
|||
|
||||
@lazy
|
||||
def can_see(self, v):
|
||||
if SITE != 'rdrama.net': return True
|
||||
if SITE not in ('rdrama.net','rdrama.com'): return True
|
||||
if self.sub != 'chudrama': return True
|
||||
if v:
|
||||
if v.can_see_chudrama: return True
|
||||
|
|
|
@ -402,7 +402,7 @@ ANTISPAM_BYPASS_IDS = ()
|
|||
PAGE_SIZE = 25
|
||||
LEADERBOARD_LIMIT = PAGE_SIZE
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE in ('rdrama.net','rdrama.com'):
|
||||
FEATURES['PRONOUNS'] = True
|
||||
FEATURES['HOUSES'] = True
|
||||
PERMS['ADMIN_ADD'] = 4
|
||||
|
@ -1228,7 +1228,7 @@ if len(SITE_NAME) > 5:
|
|||
if SITE != 'localhost':
|
||||
REDDIT_NOTIFS_SITE.add(SITE)
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE in ('rdrama.net','rdrama.com'):
|
||||
REDDIT_NOTIFS_SITE.add('marsey')
|
||||
REDDIT_NOTIFS_SITE.add('"r/Drama"')
|
||||
REDDIT_NOTIFS_SITE.add('justice4darrell')
|
||||
|
|
|
@ -24,7 +24,7 @@ def chart(kind, site):
|
|||
now.tm_wday, now.tm_yday, 0))
|
||||
today_cutoff = calendar.timegm(midnight_this_morning)
|
||||
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE in ('rdrama.net','rdrama.com'):
|
||||
time_diff = time.time() - 1619827200
|
||||
num_of_weeks = int(time_diff / 604800)
|
||||
chart_width = int(num_of_weeks/1.4)
|
||||
|
|
|
@ -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 == 'rdrama.net': abort(403)
|
||||
if SITE in ('rdrama.net','rdrama.com'): abort(403)
|
||||
|
||||
user = get_user(username)
|
||||
|
||||
|
|
|
@ -158,7 +158,7 @@ def award_thing(v, thing_type, id):
|
|||
author = thing.author
|
||||
if author.shadowbanned: abort(404)
|
||||
|
||||
if SITE == 'rdrama.net' and author.id in (PIZZASHILL_ID, CARP_ID):
|
||||
if SITE in ('rdrama.net','rdrama.com') and author.id in (PIZZASHILL_ID, CARP_ID):
|
||||
abort(403, "This user is immune to awards.")
|
||||
|
||||
if kind == "benefactor" and author.id == v.id:
|
||||
|
|
|
@ -56,7 +56,7 @@ def speak(data, v):
|
|||
|
||||
global messages, total
|
||||
|
||||
if SITE == 'rdrama.net': text = data['message'][:200].strip()
|
||||
if SITE in ('rdrama.net','rdrama.com'): text = data['message'][:200].strip()
|
||||
else: text = data['message'][:1000].strip()
|
||||
|
||||
if not text: return '', 403
|
||||
|
|
|
@ -22,7 +22,7 @@ def rdrama(id, title):
|
|||
@app.get("/marseys")
|
||||
@auth_required
|
||||
def marseys(v):
|
||||
if SITE == 'rdrama.net':
|
||||
if SITE in ('rdrama.net','rdrama.com'):
|
||||
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 == 'rdrama.net' or author == "anton-d" else None,
|
||||
"author": author if SITE in ('rdrama.net','rdrama.com') 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],
|
||||
|
|
|
@ -422,7 +422,7 @@ def message2(v, username):
|
|||
|
||||
body_html = sanitize(message)
|
||||
|
||||
if not (SITE == 'rdrama.net' and user.id == BLACKJACKBTZ_ID):
|
||||
if not (SITE in ('rdrama.net','rdrama.com') 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,
|
||||
|
|
|
@ -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 == 'rdrama.net' %}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 in ('rdrama.net','rdrama.com') %}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 == 'rdrama.net' %}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 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>
|
||||
|
||||
{% 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>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
<th scope="col">Hat</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Description</th>
|
||||
{% if SITE == 'rdrama.net' %}
|
||||
{% if SITE in ('rdrama.net','rdrama.com') %}
|
||||
{% 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 == 'rdrama.net' %}
|
||||
{% if SITE in ('rdrama.net','rdrama.com') %}
|
||||
<td>{% include "user_in_table.html" %}</td>
|
||||
{% endif %}
|
||||
<td><a href="/hat_owners/{{hat.id}}">{{hat.number_sold}}</a></td>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
{% endmacro %}
|
||||
|
||||
{% macro cf_2fa_verify() %}
|
||||
{% if SITE == 'rdrama.net' %}
|
||||
{% if SITE in ('rdrama.net','rdrama.com') %}
|
||||
<meta name="cf-2fa-verify" content="4f40ca1ca249313">
|
||||
{% elif SITE == 'watchpeopledie.tv' %}
|
||||
<meta name="cf-2fa-verify" content="372aba5b9338e00">
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<th>Name</th>
|
||||
<th>Marsey</th>
|
||||
<th>Usage</th>
|
||||
{% if SITE == 'rdrama.net' %}
|
||||
{% if SITE in ('rdrama.net','rdrama.com') %}
|
||||
<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 == 'rdrama.net' %}
|
||||
{% if SITE in ('rdrama.net','rdrama.com') %}
|
||||
{% for marsey, user in marseys %}
|
||||
<tr>
|
||||
<td>{{loop.index}}</td>
|
||||
|
|
|
@ -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 == 'rdrama.net' %}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 in ('rdrama.net','rdrama.com') %}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>
|
||||
|
|
|
@ -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 == 'rdrama.net' %}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 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" 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>
|
||||
|
||||
|
|
Loading…
Reference in New Issue