diff --git a/files/classes/comment.py b/files/classes/comment.py index a4e08eb47..4db579334 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -90,6 +90,12 @@ class Comment(Base): if option.poll_voted(v): return True return False + @property + @lazy + def controversial(self): + if self.downvotes > 5 and 0.25 < self.upvotes / self.downvotes < 4: return True + return False + @property @lazy def created_datetime(self): diff --git a/files/classes/submission.py b/files/classes/submission.py index 2adda2416..de1c417f0 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -65,6 +65,11 @@ class Submission(Base): def __repr__(self): return f"" + @property + @lazy + def controversial(self): + if self.downvotes > 5 and 0.25 < self.upvotes / self.downvotes < 4: return True + return False @property @lazy diff --git a/files/helpers/const.py b/files/helpers/const.py index 22b541845..e82bb5da7 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -674,7 +674,8 @@ AWARDS = { } AWARDS2 = deepcopy(AWARDS) -for i in ["haunt", "upsidedown", "stab", "ghosts", "spiders", "fog"]: del AWARDS2[i] +for k, val in AWARDS.items(): + if val['description'] == '???': AWARDS2.pop(k) TROLLTITLES = [ "how will @{username} ever recover?", diff --git a/files/routes/awards.py b/files/routes/awards.py index 5197fa9bf..98a53fe05 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -227,6 +227,7 @@ def award_post(pid, v): elif kind == "grass": author.is_banned = AUTOJANNY_ID author.ban_reason = f"grass award used by @{v.username} on /post/{post.id}" + author.unban_utc = int(time.time()) + 30 * 86400 link = f"[this post]({post.permalink})" send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!") send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{post.shortlink}]({post.shortlink})") @@ -397,6 +398,7 @@ def award_comment(cid, v): elif kind == "grass": author.is_banned = AUTOJANNY_ID author.ban_reason = f"grass award used by @{v.username} on /comment/{c.id}" + author.unban_utc = int(time.time()) + 30 * 86400 link = f"[this comment]({c.permalink})" send_repeatable_notification(author.id, f"Your account has been suspended permanently for {link}. You must [provide the admins](/contact) a timestamped picture of you touching grass to get unbanned!") send_repeatable_notification(CARP_ID, f"@{v.username} used {kind} award on [{c.shortlink}]({c.shortlink})") diff --git a/files/routes/static.py b/files/routes/static.py index 32d287e18..4390dd2de 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -240,7 +240,7 @@ def log_item(id, v): @app.get("/static/assets/favicon.ico") def favicon(): - return send_file(f"./assets/images/{site_name}/icon.webp?a=4") + return send_file(f"./assets/images/{site_name}/icon.webp?a=5") @app.get("/api") @auth_desired diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 6864cafd2..f073961f7 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -14,11 +14,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 2164ec4a6..9d432c607 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -23,6 +23,11 @@
{{award.owned}} owned
{% endfor %} + + +
 
+
 
+
@@ -66,6 +71,10 @@ background-color: var(--primary)!important; } + .award-columns { + column-count: 2; + } + @media (min-width: 767.98px) { .award-columns { column-count: 7 !important; diff --git a/files/templates/comments.html b/files/templates/comments.html index f1b8eeb73..004244c92 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -315,7 +315,7 @@ {% if v %} - + {% endif %}
  • @@ -330,7 +330,7 @@ {% endif %} - {{score}} + {{score}} {% if voted==-1 %} @@ -342,7 +342,7 @@ - {{score}} + {{score}} @@ -354,7 +354,7 @@ - {{score}} + {{score}} @@ -389,7 +389,7 @@ {% endif %} {% if v and request.path.startswith('/@') and v.admin_level == 0 %} diff --git a/files/templates/default.html b/files/templates/default.html index f65998655..67684b04a 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -6,12 +6,12 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} @@ -21,7 +21,7 @@ - + {% block title %} {{'SITE_NAME' | app_config}} @@ -48,10 +48,10 @@ - + - - + + @@ -63,127 +63,127 @@ {% block fixedMobileBarJS %} @@ -207,7 +207,7 @@ - + {% endif %} {% endblock %} diff --git a/files/templates/header.html b/files/templates/header.html index 0fa889cdb..84cdac5cc 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -8,7 +8,7 @@
    - + {% if "gigachadlife" in request.host %} GigaChadLife {% elif 'pcm' not in request.host %} diff --git a/files/templates/home.html b/files/templates/home.html index 9d365bfbd..c4091b229 100644 --- a/files/templates/home.html +++ b/files/templates/home.html @@ -164,14 +164,6 @@ {% endif %} -{% if request.path == '/' and g.system and g.timestamp > session.get('tooltip_last_dismissed',0)+60*60*24 and (not g.system.endswith('/chrome') and not g.system.endswith('/other')) and not g.system.endswith('/webview') %} -
    -
    -
    - - -{% endif %} - {% if v %}
    {{v.strid}}
    diff --git a/files/templates/log.html b/files/templates/log.html index 364193222..e75c115db 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,11 +6,11 @@ {% block content %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
    diff --git a/files/templates/login.html b/files/templates/login.html index 2a509a027..0b9921594 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -17,7 +17,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 35e0f3109..ca6629e9f 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index df433d17c..72f01037a 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -11,7 +11,7 @@ - + {% block pagetitle %}Settings - {{'SITE_NAME' | app_config}}{% endblock %} @@ -33,7 +33,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 772ab8e52..36254c953 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -12,7 +12,7 @@ - + @@ -38,10 +38,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index d27d3210b..6265b6aad 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -30,7 +30,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 1b9100c25..be5d00e03 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submission.html b/files/templates/submission.html index ecaca4512..c551c155f 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -602,7 +602,7 @@
    - {{score}} + {{score}}
    @@ -611,7 +611,7 @@
    - {{score}} + {{score}}
    @@ -672,7 +672,7 @@ {% endif %} - {{score}} + {{score}} {% if v %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index a763d1b41..4588f56c7 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -97,7 +97,7 @@
    {% endif %} - {{score}} + {{score}} {% if voted==-1 %}
    @@ -107,7 +107,7 @@
    - {{score}} + {{score}}
    @@ -115,7 +115,7 @@
    - {{score}} + {{score}}
    @@ -332,7 +332,7 @@ {% endif %} - {{score}} + {{score}} {% if voted==-1 %} @@ -346,7 +346,7 @@ - {{score}} + {{score}} @@ -358,7 +358,7 @@ - {{score}} + {{score}} diff --git a/files/templates/submit.html b/files/templates/submit.html index 55168bc4a..c49e32b79 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -9,7 +9,7 @@ - + {% if request.host == 'pcmemes.net' %} {% set cc='Splash Mountain' %} @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %}