fsd
This commit is contained in:
parent
15cf34adee
commit
0b7f586721
12 changed files with 43 additions and 8 deletions
|
@ -11,7 +11,7 @@ services:
|
|||
- MASTER_KEY=3435tdfsdudebussylmaoxxt43
|
||||
- REDIS_URL=redis://redis
|
||||
- DOMAIN=localhost
|
||||
- SITE_NAME=Drama
|
||||
- SITE_NAME=2Much4You
|
||||
- GIPHY_KEY=3435tdfsdudebussylmaoxxt43
|
||||
- DISCORD_SERVER_ID=3435tdfsdudebussylmaoxxt43
|
||||
- DISCORD_CLIENT_ID=3435tdfsdudebussylmaoxxt43
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 29 KiB |
|
@ -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>"""
|
||||
|
||||
if SITE == '2much4u.net': subs = ('2balkan4you','2middleeast4you')
|
||||
if True: subs = ('2balkan4you','2middleeast4you','2asia4you','2visegrad4you')
|
||||
else: subs = ()
|
|
@ -16,4 +16,4 @@ def post_embed(id, v):
|
|||
|
||||
@app.context_processor
|
||||
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:
|
||||
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):
|
||||
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)
|
||||
|
||||
if sub: posts = posts.filter_by(sub=sub)
|
||||
else: posts = posts.filter_by(sub=None)
|
||||
|
||||
if t == 'all': cutoff = 0
|
||||
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":
|
||||
pins = g.db.query(Submission).filter(Submission.stickied != None, Submission.is_banned == False)
|
||||
if sub: pins = pins.filter_by(sub=sub)
|
||||
else: pins = pins.filter_by(sub=None)
|
||||
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()]
|
||||
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")
|
||||
@auth_required
|
||||
def submit_post(v, sub=None):
|
||||
if not sub: sub = request.values.get("sub")
|
||||
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 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">
|
||||
<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>
|
||||
{% 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 %}
|
||||
<style>
|
||||
body {padding-top: 65px !important}
|
||||
|
@ -22,10 +31,12 @@
|
|||
{% else %}
|
||||
<img alt="header icon" class="mt-1" height=35 src="/static/assets/images/{{SITE_NAME}}/headericon.webp?a=1009">
|
||||
{% endif %}
|
||||
{% if False %}
|
||||
{% if SITE_NAME == 'Drama' %}
|
||||
<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 %}
|
||||
<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 %}
|
||||
</a>
|
||||
</div>
|
||||
|
|
0
files/templates/sidebar_2Much4You.html
Normal file
0
files/templates/sidebar_2Much4You.html
Normal file
|
@ -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>
|
||||
{% endif %}
|
||||
{{p.views}} views
|
||||
{% if p.sub %}
|
||||
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if p.active_flags %}
|
||||
<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>
|
||||
{% endif %}
|
||||
{{p.views}} views
|
||||
{% if p.sub %}
|
||||
<a href='/s/{{p.sub}}'>/s/{{p.sub}}</a>
|
||||
{% endif %}
|
||||
</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 %}">
|
||||
|
|
|
@ -79,7 +79,23 @@
|
|||
|
||||
<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()">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue