forked from rDrama/rDrama
fsd
parent
32f60033d1
commit
c2748736fe
|
@ -11,7 +11,7 @@ services:
|
||||||
- MASTER_KEY=3435tdfsdudebussylmaoxxt43
|
- MASTER_KEY=3435tdfsdudebussylmaoxxt43
|
||||||
- REDIS_URL=redis://redis
|
- REDIS_URL=redis://redis
|
||||||
- DOMAIN=localhost
|
- DOMAIN=localhost
|
||||||
- SITE_NAME=Drama
|
- SITE_NAME=2Much4You
|
||||||
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
|
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
|
||||||
- DISCORD_SERVER_ID=3435tdfsdudebussylmaoxxt43
|
- DISCORD_SERVER_ID=3435tdfsdudebussylmaoxxt43
|
||||||
- DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43
|
- DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43
|
||||||
|
|
|
@ -566,5 +566,5 @@ FORTUNE_REPLIES = ('<b style="color:#6023f8">Your fortune: Allah Wills It</b>','
|
||||||
|
|
||||||
no_pass_phrase = """<p>Sorry whiteboy, we're gonna need to see some ID before you start throwin that word around like it's nothing.\n\nTake a 10 minute time-out and come back when you've learned your lesson and/or paid reparations (by purchasing a BIPOC Approved™ Rdrama NWord Pass© from the <a href="/shop">shop</a>) \n\n<em>This is an automated message; if you need help, you can message us <a href="/contact">here</a>.</em></p>"""
|
no_pass_phrase = """<p>Sorry whiteboy, we're gonna need to see some ID before you start throwin that word around like it's nothing.\n\nTake a 10 minute time-out and come back when you've learned your lesson and/or paid reparations (by purchasing a BIPOC Approved™ Rdrama NWord Pass© from the <a href="/shop">shop</a>) \n\n<em>This is an automated message; if you need help, you can message us <a href="/contact">here</a>.</em></p>"""
|
||||||
|
|
||||||
if SITE == '2much4u.net': subs = ('2balkan4you','2middleeast4you')
|
if True: subs = ('2balkan4you','2middleeast4you','2asia4you','2visegrad4you')
|
||||||
else: subs = ()
|
else: subs = ()
|
|
@ -16,4 +16,4 @@ def post_embed(id, v):
|
||||||
|
|
||||||
@app.context_processor
|
@app.context_processor
|
||||||
def inject_constants():
|
def inject_constants():
|
||||||
return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS}
|
return {"environ":environ, "SITE_NAME":SITE_NAME, "AUTOJANNY_ID":AUTOJANNY_ID, "NOTIFICATIONS_ID":NOTIFICATIONS_ID, "PUSHER_ID":PUSHER_ID, "CC":CC, "CC_TITLE":CC_TITLE, "listdir":listdir, "MOOSE_ID":MOOSE_ID, "AEVANN_ID":AEVANN_ID, "config":app.config.get, "DEFAULT_COLOR":DEFAULT_COLOR, "COLORS":COLORS, "subs":subs}
|
||||||
|
|
|
@ -112,6 +112,8 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
||||||
else:
|
else:
|
||||||
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/(\w|-){3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized, re.A)
|
sanitized = re.sub('(^|\s|\n|<p>)\/?((r|u)\/(\w|-){3,25})', r'\1<a href="https://old.reddit.com/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized, re.A)
|
||||||
|
|
||||||
|
sanitized = re.sub('(^|\s|\n|<p>)\/?(s\/(\w|-){3,25})', r'\1<a href="/\2" rel="nofollow noopener noreferrer">\2</a>', sanitized, re.A)
|
||||||
|
|
||||||
for i in re.finditer('(^|\s|\n|<p>)@((\w|-){1,25})', sanitized, re.A):
|
for i in re.finditer('(^|\s|\n|<p>)@((\w|-){1,25})', sanitized, re.A):
|
||||||
u = get_user(i.group(2), graceful=True)
|
u = get_user(i.group(2), graceful=True)
|
||||||
|
|
||||||
|
|
|
@ -257,7 +257,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
posts = g.db.query(Submission)
|
posts = g.db.query(Submission)
|
||||||
|
|
||||||
if sub: posts = posts.filter_by(sub=sub)
|
if sub: posts = posts.filter_by(sub=sub)
|
||||||
else: posts = posts.filter_by(sub=None)
|
|
||||||
|
|
||||||
if t == 'all': cutoff = 0
|
if t == 'all': cutoff = 0
|
||||||
else:
|
else:
|
||||||
|
@ -328,7 +327,6 @@ def frontlist(v=None, sort="hot", page=1, t="all", ids_only=True, ccmode="false"
|
||||||
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false":
|
if (sort == "hot" or (v and v.id == Q_ID)) and page == 1 and ccmode == "false":
|
||||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
||||||
if sub: pins = pins.filter_by(sub=sub)
|
if sub: pins = pins.filter_by(sub=sub)
|
||||||
else: pins = pins.filter_by(sub=None)
|
|
||||||
if v and v.admin_level == 0:
|
if v and v.admin_level == 0:
|
||||||
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]
|
blocking = [x[0] for x in g.db.query(UserBlock.target_id).filter_by(user_id=v.id).all()]
|
||||||
blocked = [x[0] for x in g.db.query(UserBlock.user_id).filter_by(target_id=v.id).all()]
|
blocked = [x[0] for x in g.db.query(UserBlock.user_id).filter_by(target_id=v.id).all()]
|
||||||
|
|
|
@ -760,7 +760,9 @@ def thumbnail_thread(pid):
|
||||||
@limiter.limit("1/second;6/minute;200/hour;1000/day")
|
@limiter.limit("1/second;6/minute;200/hour;1000/day")
|
||||||
@auth_required
|
@auth_required
|
||||||
def submit_post(v, sub=None):
|
def submit_post(v, sub=None):
|
||||||
|
if not sub: sub = request.values.get("sub")
|
||||||
if sub and sub not in subs: sub = None
|
if sub and sub not in subs: sub = None
|
||||||
|
|
||||||
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
if v.is_suspended: return {"error": "You can't perform this action while banned."}, 403
|
||||||
|
|
||||||
if v and v.patron:
|
if v and v.patron:
|
||||||
|
|
|
@ -7,6 +7,15 @@
|
||||||
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
|
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: center; font-weight: bold;white-space:nowrap">
|
||||||
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to rdrama.net: the official site for r/subredditdrama</a>
|
<a style="color: white" class="text-small-mobile" href="https://reddit.com/r/SubredditDrama">💖🌈 welcome to rdrama.net: the official site for r/subredditdrama</a>
|
||||||
</div>
|
</div>
|
||||||
|
{% elif SITE_NAME == '2Much4You' %}
|
||||||
|
<style>
|
||||||
|
body {padding-top: 90px !important}
|
||||||
|
</style>
|
||||||
|
<div id="srd" style="width: 100%; background-color: var(--primary); padding: 2px; text-align: left; font-weight: bold;white-space:nowrap">
|
||||||
|
{% for s in subs %}
|
||||||
|
<a style="color: white" class="text-small-mobile ml-2" href="/s/{{s}}">/s/{{s}}</a>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<style>
|
<style>
|
||||||
body {padding-top: 65px !important}
|
body {padding-top: 65px !important}
|
||||||
|
@ -22,10 +31,12 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<img alt="header icon" class="mt-1" height=35 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1009">
|
<img alt="header icon" class="mt-1" height=35 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1009">
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if False %}
|
{% if SITE_NAME == 'Drama' %}
|
||||||
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?a=1010" height=20 width=77>
|
<img alt="logo" src="/static/assets/images/{{SITE_NAME}}/logo.webp?a=1010" height=20 width=77>
|
||||||
|
{% elif sub %}
|
||||||
|
<a href="/s/{{sub}}" class="font-weight-bold ml-4 mt-2" style="font-size:25px;position:absolute">{{sub}}</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="/" class="font-weight-bold ml-2 mt-1" style="font-size:25px;position:absolute">{{SITE_NAME}}</a>
|
<a href="/" class="font-weight-bold ml-4 mt-2" style="font-size:25px;position:absolute">{{SITE_NAME}}</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -459,6 +459,9 @@
|
||||||
Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('edited_timestamp','{{p.edited_utc}}')" id="edited_timestamp">{{p.edited_string}}</span>
|
Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('edited_timestamp','{{p.edited_utc}}')" id="edited_timestamp">{{p.edited_string}}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{p.views}} views
|
{{p.views}} views
|
||||||
|
{% if p.sub %}
|
||||||
|
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if p.active_flags %}
|
{% if p.active_flags %}
|
||||||
<div id="flaggers" class="flaggers d-none">
|
<div id="flaggers" class="flaggers d-none">
|
||||||
|
|
|
@ -195,6 +195,9 @@
|
||||||
Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" onmouseover="timestamp('edited_timestamp-{{p.id}}','{{p.edited_utc}}')">{{p.edited_string}}</span>
|
Edited <span data-bs-toggle="tooltip" data-bs-placement="bottom" id="edited_timestamp-{{p.id}}" onmouseover="timestamp('edited_timestamp-{{p.id}}','{{p.edited_utc}}')">{{p.edited_string}}</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{{p.views}} views
|
{{p.views}} views
|
||||||
|
{% if p.sub %}
|
||||||
|
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
<h5 class="card-title post-title text-left w-lg-95 mb-0 pb-0 pb-md-1"><a {% if v and v.newtab and not g.webview %}target="_blank"{% endif %} href="{{p.permalink}}" class="stretched-link {% if p.author.agendaposter %}agendaposter{% endif %}">
|
||||||
|
|
|
@ -79,7 +79,23 @@
|
||||||
|
|
||||||
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
|
||||||
|
|
||||||
<label for="title">Post Title</label>
|
|
||||||
|
<label class='mt-4' for="title">Sub</label>
|
||||||
|
|
||||||
|
<div class="input-group mb2">
|
||||||
|
<select autocomplete="off" id='sub' class="form-control" form="submitform" name="sub">
|
||||||
|
<option {% if not sub %} selected {% endif %}>
|
||||||
|
general
|
||||||
|
</option>
|
||||||
|
{% for s in subs %}
|
||||||
|
<option value="{{s}}" {% if sub==s %} selected {% endif %}>
|
||||||
|
/s/{{s}}
|
||||||
|
</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<label class='mt-4' for="title">Post Title</label>
|
||||||
|
|
||||||
|
|
||||||
<input autocomplete="off" class="form-control" id="post-title" aria-describedby="titleHelpRegister" type="text" name="title" placeholder="Required" value="{{title}}" minlength="1" maxlength="500" required oninput="checkForRequired();savetext()">
|
<input autocomplete="off" class="form-control" id="post-title" aria-describedby="titleHelpRegister" type="text" name="title" placeholder="Required" value="{{title}}" minlength="1" maxlength="500" required oninput="checkForRequired();savetext()">
|
||||||
|
|
Loading…
Reference in New Issue