dfMerge branch 'frost' of https://github.com/Aevann1/Drama into frost
commit
0078ce4279
|
@ -199,7 +199,7 @@ class Comment(Base):
|
|||
def replies(self):
|
||||
r = self.__dict__.get("replies", None)
|
||||
if r: r = [x for x in r if not x.author.shadowbanned]
|
||||
if not r and r != []: r = sorted((x for x in self.child_comments if not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
if not r and r != []: r = sorted((x for x in self.child_comments if x.author and not x.author.shadowbanned and x.author_id not in (AUTOPOLLER_ID, AUTOBETTER_ID)), key=lambda x: x.realupvotes, reverse=True)
|
||||
return r
|
||||
|
||||
@replies.setter
|
||||
|
@ -223,7 +223,7 @@ class Comment(Base):
|
|||
@property
|
||||
@lazy
|
||||
def shortlink(self):
|
||||
return f"/comment/{self.id}#context"
|
||||
return f"{SITE_FULL}/comment/{self.id}#context"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -192,11 +192,6 @@ class Submission(Base):
|
|||
@property
|
||||
@lazy
|
||||
def shortlink(self):
|
||||
return f"/post/{self.id}"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def permalink(self):
|
||||
if self.club: return f"{SITE_FULL}/post/{self.id}"
|
||||
|
||||
output = self.title.lower()
|
||||
|
@ -210,7 +205,12 @@ class Submission(Base):
|
|||
|
||||
if not output: output = '-'
|
||||
|
||||
return f"{SITE_FULL}/post/{self.id}/{output}"
|
||||
return f"/post/{self.id}/{output}"
|
||||
|
||||
@property
|
||||
@lazy
|
||||
def permalink(self):
|
||||
return SITE_FULL + self.shortlink
|
||||
|
||||
@property
|
||||
@lazy
|
||||
|
|
|
@ -521,6 +521,7 @@ AWARDS = {
|
|||
AWARDS2 = deepcopy(AWARDS)
|
||||
for k, val in AWARDS.items():
|
||||
if val['description'] == '???': AWARDS2.pop(k)
|
||||
if SITE == 'pcmemes.net' and k in ('ban','pizzashill','marsey','bird','grass'): AWARDS2.pop(k)
|
||||
|
||||
TROLLTITLES = [
|
||||
"how will @{username} ever recover?",
|
||||
|
|
|
@ -151,7 +151,6 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
|
|||
soup = BeautifulSoup(sanitized, features="html.parser")
|
||||
|
||||
for tag in soup.find_all("img"):
|
||||
|
||||
if tag.get("src") and tag.get("class") != ['pp20']:
|
||||
tag["class"] = "in-comment-image"
|
||||
tag["loading"] = "lazy"
|
||||
|
|
|
@ -56,8 +56,6 @@ AWARDS3 = {
|
|||
@app.get("/settings/shop")
|
||||
@auth_required
|
||||
def shop(v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
AWARDS = deepcopy(AWARDS2)
|
||||
|
||||
for val in AWARDS.values(): val["owned"] = 0
|
||||
|
@ -87,8 +85,6 @@ def shop(v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def buy(v, award):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if award == 'benefactor' and not request.values.get("mb"):
|
||||
return {"error": "You can only buy the Benefactor award with marseybux."}, 403
|
||||
|
||||
|
@ -196,8 +192,6 @@ def buy(v, award):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def award_post(pid, v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
|
||||
|
||||
kind = request.values.get("kind", "").strip()
|
||||
|
@ -436,8 +430,6 @@ def award_post(pid, v):
|
|||
@limiter.limit("1/second;30/minute;200/hour;1000/day")
|
||||
@auth_required
|
||||
def award_comment(cid, v):
|
||||
if request.host == 'pcmemes.net': abort(403)
|
||||
|
||||
if v.shadowbanned: return render_template('errors/500.html', err=True, v=v), 500
|
||||
|
||||
kind = request.values.get("kind", "").strip()
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -39,7 +39,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
{% endif %}
|
||||
|
||||
</head>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -32,7 +32,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
{% endif %}
|
||||
|
||||
<meta charset="utf-8">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
{% block content %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -30,7 +30,7 @@
|
|||
{% endif %}
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
{% endif %}
|
||||
|
||||
<div class="row justify-content-around">
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<title>2-Step Login - {{SITE_NAME}}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
|
|
@ -39,10 +39,10 @@
|
|||
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
{% endif %}
|
||||
</head>
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
|
||||
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
|
||||
</head>
|
||||
|
||||
|
|
|
@ -498,9 +498,9 @@
|
|||
{% if p.domain == "twitter.com" %}
|
||||
{{p.embed_url | safe}}
|
||||
{% if v and v.theme.split("_")[0] in ["light", "coffee", "4chan"] %}
|
||||
<script src="/static/assets/js/twitterlight.js?a=240"></script>
|
||||
<script src="/static/assets/js/twitterlight.js?a=241"></script>
|
||||
{% else %}
|
||||
<script src="/static/assets/js/twitter.js?a=240"></script>
|
||||
<script src="/static/assets/js/twitter.js?a=241"></script>
|
||||
{% endif %}
|
||||
{% elif p.domain in ['youtu.be','youtube.com'] and p.embed_url and p.embed_url.startswith('<lite-youtube') %}
|
||||
{{p.embed_url | safe}}
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{% block stylesheets %}
|
||||
{% if v %}
|
||||
<style>:root{--primary:#{{v.themecolor}}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?a=15">
|
||||
{% if v.agendaposter %}
|
||||
<style>
|
||||
html {
|
||||
|
@ -51,7 +51,7 @@
|
|||
{% else %}
|
||||
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
|
||||
<link rel="stylesheet" href="/static/assets/css/main.css?a=106">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=14">
|
||||
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?a=15">
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue