forked from rDrama/rDrama
1
0
Fork 0

fix HOLIDAY_EVENT check

master
Aevann 2023-01-01 04:50:11 +02:00
parent 21c88c7d9e
commit 03fb84e618
14 changed files with 19 additions and 19 deletions

View File

@ -87,7 +87,7 @@ from files.routes.allroutes import *
if app.config['SERVICE'] == Service.RDRAMA:
from files.routes import *
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
from files.events import *
event_init()
elif app.config['SERVICE'] == Service.CHAT:

View File

@ -265,7 +265,7 @@ class User(Base):
@lazy
def hat_active(self, v):
if FEATURES['HATS']:
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
from files.events.helpers.const import EVENT_FORCED_HATS
if EVENT_FORCED_HATS:
if SITE_NAME == 'rDrama':
@ -1080,7 +1080,7 @@ class User(Base):
def shadowbanner(self):
return g.db.query(User.username).filter_by(id=self.shadowbanned).one()[0]
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
@property
@lazy
def can_toggle_event_music(self):

View File

@ -62,7 +62,7 @@ def execute_snappy(post:Submission, v:User):
body = "Can you people come up with any ideas that don't involve committing federal crimes"
else:
if SNAPPY_MARSEYS and SNAPPY_QUOTES:
if HOLIDAY_EVENT or random.random() > 0.5:
if HOLIDAY_EVENT() or random.random() > 0.5:
SNAPPY_CHOICES = SNAPPY_QUOTES
else:
SNAPPY_CHOICES = SNAPPY_MARSEYS

View File

@ -12,7 +12,7 @@ ASSET_SUBDIRS = ['/css', '/js', '/js/vendor']
ASSET_URL = '/assets/'
ASSET_CACHE = defaultdict(lambda: None)
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
ASSET_SUBDIRS.extend(['/event/css', '/event/css/themes', '/event/js'])
def assetcache_build(asset_dir, subdirs):

View File

@ -32,7 +32,7 @@ def _initialize_snappy_marseys_and_quotes():
SNAPPY_MARSEYS = [f':#{x}:' for x in marseys_const2]
filename = f"snappy_{SITE_NAME}.txt"
if HOLIDAY_EVENT: filename = f"snappy_event_{SITE_NAME}.txt"
if HOLIDAY_EVENT(): filename = f"snappy_event_{SITE_NAME}.txt"
try:
with open(filename, "r", encoding="utf-8") as f:

View File

@ -406,7 +406,7 @@ def award_thing(v, thing_type, id):
if author.spider: author.spider += 86400
else: author.spider = int(time.time()) + 86400
badge_grant(user=author, badge_id=179, notify=False)
elif HOLIDAY_EVENT:
elif HOLIDAY_EVENT():
from files.events import EVENT_AWARDS, award_thing_event
if kind in EVENT_AWARDS:
award_thing_event(v, kind, author)

View File

@ -88,7 +88,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
abort(400)
existing = existing.one_or_none()
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
coin_mult = 2
coin_value = coin_delta * coin_mult

View File

@ -47,7 +47,7 @@ def get_logged_in_user():
abort(403)
g.v = v
if HOLIDAY_EVENT:
if HOLIDAY_EVENT():
from files.events.helpers.get import get_or_create_event_user
g.event_v = get_or_create_event_user(v, g.db)

View File

@ -4,7 +4,7 @@
{% block banner %}
{% include "modals/expanded_image.html" %}
{% if err or '@' not in request.path %}
{% if HOLIDAY_EVENT and not sub %}
{% if HOLIDAY_EVENT() and not sub %}
{% include 'event/banner.html' %}
{% else %}
{% if err and SITE_NAME == 'rDrama' %}
@ -79,7 +79,7 @@
<script defer src="{{'js/spider.js' | asset}}"></script>
{% endif %}
{% if HOLIDAY_EVENT %}
{% if HOLIDAY_EVENT() %}
{% include "event/music.html" %}
{% endif %}

View File

@ -61,7 +61,7 @@
{% elif has_logo %}
<div id="logo-container" class="flex-grow-1 logo-container">
<a href="/">
{% if SITE_NAME == 'WPD' and HOLIDAY_EVENT %}
{% if SITE_NAME == 'WPD' and HOLIDAY_EVENT() %}
<img class="ml-1" id="logo" alt="logo" src="{{'icons-event/2022-christmas-logo.webp' | asset_siteimg}}" width="70">
{% else %}
<img class="ml-1" id="logo" alt="logo" src="{{'logo.webp' | asset_siteimg}}" width="70">

View File

@ -12,7 +12,7 @@
<script src="{{'js/top.js' | asset}}"></script>
<!DOCTYPE html>
<html lang="en" {% if not HOLIDAY_EVENT %}style="--primary:#{{v.themecolor if v else DEFAULT_COLOR}}"{% endif %}>
<html lang="en" {% if not HOLIDAY_EVENT() %}style="--primary:#{{v.themecolor if v else DEFAULT_COLOR}}"{% endif %}>
<head>
{% block head %}
<meta charset="utf-8">

View File

@ -31,7 +31,7 @@
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
<a class="sidebar-link" href="/transfers" data-bs-toggle="tooltip" data-bs-placement="top" title="Transfers"><i class="fas fa-arrow-right-arrow-left"></i></a>
<a class="sidebar-link" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
{% if HOLIDAY_EVENT %}
{% if HOLIDAY_EVENT() %}
<span class="sidebar-link" data-nonce="{{g.nonce}}" data-onclick="postToastRoastEventDarkmode(this, '/events/fistmas2022/darkmode')" style="display:inline" data-bs-toggle="tooltip" data-bs-placement="top" title="Toggle Dark Mode"><i class="fas fa-moon-over-sun"></i></span>
{% endif %}
</p>
@ -86,6 +86,6 @@
</div>
</div>
{% if HOLIDAY_EVENT %}
{% if HOLIDAY_EVENT() %}
<script defer src="{{'event/js/darkmode.js' | asset}}"></script>
{% endif %}

View File

@ -2,7 +2,7 @@
{% if sub %}
{% set image=sub.sidebar_url %}
{% elif HOLIDAY_EVENT %}
{% elif HOLIDAY_EVENT() %}
{% set image = macros.random_image("assets/event/images/sidebar") %}
{% else %}
{% set image = macros.random_image("assets/images/" ~ SITE_NAME ~ "/sidebar") %}
@ -40,7 +40,7 @@
<a class="sidebar-link" href="/log" data-bs-toggle="tooltip" data-bs-placement="top" title="Moderation Log"><i class="fas fa-scroll-old"></i></a>
<a class="sidebar-link" href="/transfers" data-bs-toggle="tooltip" data-bs-placement="top" title="Transfers"><i class="fas fa-arrow-right-arrow-left"></i></a>
<a class="sidebar-link" href="/random_post" data-bs-toggle="tooltip" data-bs-placement="top" title="Random Post"><i class="fas fa-random"></i></a>
{% if HOLIDAY_EVENT %}
{% if HOLIDAY_EVENT() %}
<span class="sidebar-link" data-nonce="{{g.nonce}}" data-onclick="postToastRoastEventDarkmode(this, '/events/fistmas2022/darkmode')" style="display:inline" data-bs-toggle="tooltip" data-bs-placement="top" title="Toggle Dark Mode"><i class="fas fa-moon-over-sun"></i></span>
{% endif %}
</p>
@ -78,6 +78,6 @@
{% endif %}
</div>
{% if HOLIDAY_EVENT %}
{% if HOLIDAY_EVENT() %}
<script defer src="{{'event/js/darkmode.js' | asset}}"></script>
{% endif %}

View File

@ -28,7 +28,7 @@
<div id="username" class="d-none">{{u.username}}</div>
{% endif %}
<script defer src="{{'js/userpage.js' | asset}}"></script>
{% if not HOLIDAY_EVENT or SITE_NAME == 'WPD' %}
{% if not HOLIDAY_EVENT() or SITE_NAME == 'WPD' %}
<script defer src="{{'js/profile_song.js' | asset}}"></script>
{% endif %}
{% endblock %}