Merge branch 'frost' of https://github.com/Aevann1/Drama into frost

remotes/1693045480750635534/spooky-22
Aevann1 2022-05-23 17:24:25 +02:00
commit 80fc79cbe3
9 changed files with 47 additions and 71 deletions

View File

@ -188,8 +188,6 @@ class User(Base):
@property
@lazy
def is_cakeday(self):
if SITE_NAME == 'rDrama': return True
else: return False
if time.time() - self.created_utc > 363 * 86400:
date = time.strftime("%d %b", time.gmtime(self.created_utc))
now = time.strftime("%d %b", time.gmtime())

View File

@ -397,7 +397,7 @@ AWARDS = {
"lootbox": {
"kind": "lootbox",
"title": "Lootbox",
"description": "???",
"description": "",
"icon": "fas fa-box-open",
"color": "text-blue",
"price": 1000
@ -442,6 +442,30 @@ AWARDS = {
"color": "text-yellow",
"price": 300
},
"firework": {
"kind": "firework",
"title": "Fireworks",
"description": "Summons fireworks on the post.",
"icon": "fas fa-bahai",
"color": "text-danger",
"price": 300
},
"confetti": {
"kind": "confetti",
"title": "Confetti",
"description": "Summons confetti to fall on the post.",
"icon": "fas fa-party-horn",
"color": "text-yellow",
"price": 300
},
"ricardo": {
"kind": "ricardo",
"title": "Stripper Cake",
"description": "Summons Ricardo to dance on the post.",
"icon": "fas fa-pinata",
"color": "text-pink",
"price": 500
},
"tilt": {
"kind": "tilt",
"title": "Tilt",
@ -634,30 +658,6 @@ AWARDS = {
"color": "checkmark",
"price": 100000
},
"firework": {
"kind": "firework",
"title": "Fireworks",
"description": "PARTY TIME!",
"icon": "fas fa-bahai",
"color": "text-blue-200",
"price": 300
},
"confetti": {
"kind": "confetti",
"title": "Confetti",
"description": "PARTY TIME!",
"icon": "fas fa-party-horn",
"color": "text-blue-200",
"price": 300
},
"ricardo": {
"kind": "ricardo",
"title": "Stripper Cake",
"description": "PARTY TIME!",
"icon": "fas fa-pinata",
"color": "text-blue-200",
"price": 500
},
}
if SITE_NAME == 'PCM':
@ -699,7 +699,7 @@ AWARDS3 = {}
for k, val in AWARDS2.items():
if val['price'] == 300: AWARDS3[k] = val
DOUBLE_XP_ENABLED = 1652997600 # set to unixtime for when DXP begins, -1 to disable
DOUBLE_XP_ENABLED = -1 # set to unixtime for when DXP begins, -1 to disable
TROLLTITLES = [
"how will @{username} ever recover?",

View File

@ -249,7 +249,8 @@ def api_comment(v):
filename = f'files/assets/images/badges/{badge.id}.webp'
copyfile(oldname, filename)
process_image(v.patron, filename, 200)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/assets/images/badges/{badge.id}.webp"]}, timeout=5)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS,
data='{"files": ["https://%s/assets/images/badges/%s.webp"]}' % (request.host, badge.id), timeout=5)
except Exception as e:
return {"error": str(e)}, 400
elif v.admin_level > 2 and parent_post.id == 37838:
@ -300,7 +301,8 @@ def api_comment(v):
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{name}.webp"]}, timeout=5)
requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS,
data='{"files": ["https://%s/e/%s.webp"]}' % (request.host, name), timeout=5)
cache.delete_memoized(marsey_list)
except Exception as e:

View File

@ -207,7 +207,7 @@
{% if not c.author %}
{{c.print()}}
{% endif %}
<a class="user-name text-decoration-none" href="{{c.author.url}}" data-pop-info='{{c.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2">{% if c.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Happy birthgay!!!!">{% endif %}<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level %}class="mod"{% endif %}>{{c.author_name}}</span></a>
<a class="user-name text-decoration-none" href="{{c.author.url}}" data-pop-info='{{c.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color:#{{c.author.namecolor}}; font-size:12px; font-weight:bold;"><img loading="lazy" src="{{c.author.profile_url}}" class="profile-pic-25 mr-2">{% if c.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I’ve spent another year rotting my brain with dramaposting, please ridicule me πŸ€“">{% endif %}<span {% if c.author.patron and not c.distinguish_level %}class="patron" style="background-color:#{{c.author.namecolor}};"{% elif c.distinguish_level %}class="mod"{% endif %}>{{c.author_name}}</span></a>
{% if c.author.customtitle %}&nbsp;<bdi style="color: #{{c.author.titlecolor}}">&nbsp;{{c.author.customtitle | safe}}</bdi>{% endif %}
{% endif %}

View File

@ -10,7 +10,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/{{v.theme}}.css?v=58">
<link rel="stylesheet" href="/assets/css/awards.css?v=4">
<link rel="stylesheet" href="/assets/css/awards.css?v=5">
{% if v.agendaposter %}
<style>
html {
@ -36,7 +36,7 @@
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/assets/css/main.css?v=272">
<link rel="stylesheet" href="/assets/css/{{config('DEFAULT_THEME')}}.css?v=57">
<link rel="stylesheet" href="/assets/css/awards.css?v=4">
<link rel="stylesheet" href="/assets/css/awards.css?v=5">
{% endif %}
{% if request.path == '/catalog' %}
@ -249,8 +249,7 @@
{% if sub %}
<img alt="/h/{{sub.name}} banner" role="button" data-bs-toggle="modal" data-bs-target="#expandImageModal" onclick="expandDesktopImage('{{sub.banner_url}}')" loading="lazy" src="{{sub.banner_url}}" width=100% style="object-fit:cover;max-height:25vw">
{% elif SITE_NAME == 'rDrama' %}
{# set path = "assets/images/" + SITE_NAME + "/banners" #}
{% set path = "assets/images/" + SITE_NAME + "/banners-birthgay" %}
{% set path = "assets/images/" + SITE_NAME + "/banners" %}
{% set image = "/" + path + "/" + listdir('files/' + path)|random() + '?v=25' %}
<a href="https://secure.transequality.org/site/Donation2?df_id=1480">

View File

@ -8,15 +8,6 @@
padding-top: 69.55px !important
}
}
/* Birthgay specific */
#navbar i, #navbar .nav-link {
text-shadow: 1px 1px 0 black, 1px -1px 0 black, -1px 1px 0 black, -1px -1px 0 black;
}
.navbar-light .navbar-nav .nav-link, .navbar-light .navbar-nav .nav-link:hover {
color: #FFF !important;
}
/* End birthgay specific */
</style>
{% else %}
<style>
@ -30,25 +21,13 @@
{% endif %}
{% if SITE_NAME == 'rDrama' %}
{# include "journoid_banner.html" #}
<div class="srd">
<a id="srd-link" class="text-small-mobile" style="color:white">πŸŽ‰πŸŽ‰πŸŽ‰ Happy birthday rDrama! πŸŽ‰πŸŽ‰πŸŽ‰</a>
</div>
{% include "journoid_banner.html" %}
{% endif %}
{% if SITE_NAME == 'rDrama' %}
<div class="navbar navbar-expand-md navbar-light" id="navbar" style="background: url('/assets/images/balloons.webp') !important;">
<div class="container-fluid" style="padding:0; background: transparent !important">
{% else %}
<div class="navbar navbar-expand-md navbar-light" id="navbar">
<div class="container-fluid" style="padding:0;">
{% endif %}
<a href="/" class="navbar-brand mr-auto {% if SITE_NAME in ('PCM','WPD') and not sub %}flex-grow-1{% endif %}">
{% if SITE_NAME == 'rDrama' %} {# birthgay only #}
<img alt="header icon" height=33 src="/assets/images/emojis/marseyparty.webp?v=birthgay">
{% else %}
<img alt="header icon" height=33 src="/assets/images/{{SITE_NAME}}/headericon.webp?v=1019">
{% endif %}
</a>
{% if sub %}
@ -182,9 +161,9 @@
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg-left border-0 shadow fade px-0">
<div class="px-2">
<a class="dropdown-item" href="{{v.url}}"><i class="fas fa-user-circle fa-fw mr-3"></i>My
<a class="dropdown-item" href="{{v.url}}" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-user-circle fa-fw mr-3"></i>My
profile</a>
<a class="dropdown-item" href="/settings"><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
<a class="dropdown-item" href="/settings" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-cog fa-fw mr-3"></i>Settings</a>
</div>
<div class="px-2">
<button class="dropdown-item copy-link" data-clipboard-text="{{SITE_FULL}}/signup?ref={{v.username}}"><i class="fas fa-user-friends fa-fw mr-3"></i>Invite friends</button>
@ -192,22 +171,22 @@
<div class="px-2">
<a class="dropdown-item" href="/assets/app_{{config('SITE_NAME')}}_v2.4.apk"><i class="fab fa-android fa-fw mr-3"></i>Android app</a>
<a class="dropdown-item" href="https://rdrama.net/changelog"><i class="fas fa-clipboard fa-fw mr-3"></i>Changelog</a>
<a class="dropdown-item" href="https://rdrama.net/changelog" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-clipboard fa-fw mr-3"></i>Changelog</a>
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="https://github.com/Aevann1/rDrama"><i class="fab fa-github fa-fw mr-3"></i>Source code</a>
{% if SITE_NAME in ['rDrama', 'PCM'] %}
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs"><i class="fas fa-bug fa-fw mr-3"></i>Bugs/Suggestions</a>
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="/report_bugs" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-bug fa-fw mr-3"></i>Bugs/Suggestions</a>
{% endif %}
{% if SITE_NAME == 'rDrama' %}
<a class="dropdown-item" href="/discord"><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
<a class="dropdown-item" href="/discord" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fab fa-discord fa-fw mr-3"></i>Discord</a>
{% endif %}
{% if SITE_NAME != 'Cringetopia' %}
<a class="dropdown-item" rel="nofollow noopener noreferrer" href="{{config('GUMROAD_LINK')}}"><i class="fas fa-dollar-sign fa-fw mr-3"></i>Donate</a>
{% endif %}
{% if SITE_NAME == 'rDrama' %}<a class="dropdown-item" href="/archives"><i class="fas fa-book fa-fw mr-3"></i>Archives</a>{% endif %}
<a class="dropdown-item" href="/contact"><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
{% if SITE_NAME == 'rDrama' %}<a class="dropdown-item" href="/archives" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-book fa-fw mr-3"></i>Archives</a>{% endif %}
<a class="dropdown-item" href="/contact" {% if v and v.newtab and not g.webview %}target="_blank"{% endif %}><i class="fas fa-file-signature fa-fw mr-3"></i>Contact us</a>
</div>
<div class="px-2">
<a class="dropdown-item" role="button", onclick="post_toast(this,'/logout', '1')"><i class="fas fa-sign-out fa-fw mr-3"></i>Log out</a>

View File

@ -64,9 +64,7 @@
{% endif %}
{% if p.award_count("confetti") %}
<script src="/assets/js/confetti-js-master/dist/index.min.js"></script>
<script src = "/assets/js/confetti.js"></script>
<canvas id="confetti-canvas"></canvas>
<div id="confetti"></div>
{% endif %}
{% if p.award_count("firework") %}
@ -713,7 +711,7 @@
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1 {% if p.author.verified=='Glowiefied' %}glow{% endif %}" style="color:{% if p.author.verifiedcolor %}#{{p.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.verified}}"></i>
{% endif %}
<a class="user-name text-decoration-none" href="{{p.author.url}}" data-pop-info='{{p.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold"class="user-name"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2">{% if p.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Happy birthgay!!!!">{% endif %}<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}&nbsp;<bdi style="color: #{{p.author.titlecolor}}">&nbsp;{{p.author.customtitle | safe}}</bdi>{% endif %}
<a class="user-name text-decoration-none" href="{{p.author.url}}" data-pop-info='{{p.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold"class="user-name"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2">{% if p.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I’ve spent another year rotting my brain with dramaposting, please ridicule me πŸ€“">{% endif %}<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}&nbsp;<bdi style="color: #{{p.author.titlecolor}}">&nbsp;{{p.author.customtitle | safe}}</bdi>{% endif %}
{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" id="timestamp" onmouseover="timestamp('timestamp','{{p.created_utc}}')">&nbsp;{{p.age_string}}</span>
({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.domain %}<a href="/search/posts/?q=domain%3A{{p.domain}}&sort=new&t=all" {% if not v or v.newtabexternal %}target="_blank"{% endif %}>{{p.domain}}</a>{% else %}text post{% endif %})

View File

@ -186,7 +186,7 @@
{% if p.author.verified %}<i class="fas fa-badge-check align-middle ml-1 {% if p.author.verified=='Glowiefied' %}glow{% endif %}" style="color:{% if p.author.verifiedcolor %}#{{p.author.verifiedcolor}}{% else %}#1DA1F2{% endif %}" data-bs-toggle="tooltip" data-bs-placement="bottom" title="{{p.author.verified}}"></i>
{% endif %}
<a class="user-name text-decoration-none" href="{{p.author.url}}" data-pop-info='{{p.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2">{% if p.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Happy birthgay!!!!">{% endif %}<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}">&nbsp;&nbsp;{{p.author.customtitle | safe}}</bdi>{% endif %}
<a class="user-name text-decoration-none" href="{{p.author.url}}" data-pop-info='{{p.author.json_popover(v) | tojson}}' onclick='popclick(event)' data-bs-placement="bottom" data-bs-toggle="popover" data-bs-trigger="click" data-content-id="popover" role="button" tabindex="0" style="color: #{{p.author.namecolor}}; font-weight: bold;"><img loading="lazy" src="{{p.author.profile_url}}" class="profile-pic-25 mr-2">{% if p.author.is_cakeday %}<img class="party-hat" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I’ve spent another year rotting my brain with dramaposting, please ridicule me πŸ€“">{% endif %}<span {% if p.author.patron and not p.distinguish_level %}class="patron" style="background-color:#{{p.author.namecolor}};"{% elif p.distinguish_level %}class="mod"{% endif %}>{{p.author_name}}</span></a>{% if p.author.customtitle %}<bdi style="color: #{{p.author.titlecolor}}">&nbsp;&nbsp;{{p.author.customtitle | safe}}</bdi>{% endif %}
{% endif %}
<span data-bs-toggle="tooltip" data-bs-placement="bottom" onmouseover="timestamp('timestamp-{{p.id}}','{{p.created_utc}}')" id="timestamp-{{p.id}}">&nbsp;{{p.age_string}}</span>
&nbsp;

View File

@ -40,7 +40,7 @@
<div class="d-md-flex text-center text-md-left">
<div>
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}"><img loading="lazy" src="{{u.profile_url}}" class="profile-pic profile-pic-100 mb-5"></a>
{% if u.is_cakeday %}<img class="party-hat2" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Happy birthgay!!!!">{% endif %}
{% if u.is_cakeday %}<img class="party-hat2" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I’ve spent another year rotting my brain with dramaposting, please ridicule me πŸ€“">{% endif %}
</div>
<div id="profilestuff" class="ml-3 w-100">
{% if u.is_suspended %}
@ -365,7 +365,7 @@
<div class="col">
<div style="margin-top: -34px;">
<a rel="nofollow noopener noreferrer" href="{% if u.highres %}{{u.highres}}{% else %}{{u.profile_url}}{% endif %}"><img loading="lazy" src="{{u.profile_url}}" class="profile-pic-65 bg-white border-2 border-white mb-2"></a>
{% if u.is_cakeday %}<img class="party-hat3" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Happy birthgay!!!!">{% endif %}
{% if u.is_cakeday %}<img class="party-hat3" src="/assets/images/party-hat.webp" data-bs-toggle="tooltip" data-bs-placement="bottom" title="I’ve spent another year rotting my brain with dramaposting, please ridicule me πŸ€“">{% endif %}
</div>
<div class="mt-n3 py-3">
{% if u.is_suspended %}