dedup some event codde
Before Width: | Height: | Size: 1.3 MiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 41 KiB |
Before Width: | Height: | Size: 42 KiB After Width: | Height: | Size: 42 KiB |
Before Width: | Height: | Size: 262 KiB After Width: | Height: | Size: 262 KiB |
Before Width: | Height: | Size: 645 KiB After Width: | Height: | Size: 645 KiB |
Before Width: | Height: | Size: 599 KiB After Width: | Height: | Size: 599 KiB |
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 47 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 38 KiB After Width: | Height: | Size: 38 KiB |
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
@ -1094,12 +1094,25 @@ dkd_end = datetime.datetime.strptime(f'2/5/{t.year}', '%d/%m/%Y')
|
|||
def IS_DKD():
|
||||
return SITE_NAME == 'rDrama' and dkd_begin < datetime.datetime.now() < dkd_end
|
||||
|
||||
if SITE_NAME == 'rDrama':
|
||||
birthgay_begin = datetime.datetime.strptime(f'20/5/{t.year}', '%d/%m/%Y')
|
||||
birthgay_end = datetime.datetime.strptime(f'23/5/{t.year}', '%d/%m/%Y')
|
||||
else:
|
||||
birthgay_begin = datetime.datetime.strptime(f'26/4/{t.year}', '%d/%m/%Y')
|
||||
birthgay_end = datetime.datetime.strptime(f'29/5/{t.year}', '%d/%m/%Y')
|
||||
|
||||
birthgay_begin = datetime.datetime.strptime(f'20/5/{t.year}', '%d/%m/%Y')
|
||||
birthgay_end = datetime.datetime.strptime(f'23/5/{t.year}', '%d/%m/%Y')
|
||||
def IS_BIRTHGAY():
|
||||
return birthgay_begin < datetime.datetime.now() < birthgay_end
|
||||
return SITE_NAME == 'rDrama' and birthgay_begin < datetime.datetime.now() < birthgay_end
|
||||
|
||||
birthdead_begin = datetime.datetime.strptime(f'26/4/{t.year}', '%d/%m/%Y')
|
||||
birthdead_end = datetime.datetime.strptime(f'29/5/{t.year}', '%d/%m/%Y')
|
||||
def IS_BIRTHDEAD():
|
||||
return SITE_NAME == 'WPD' and birthdead_begin < datetime.datetime.now() < birthdead_end
|
||||
|
||||
def IS_EVENT():
|
||||
if IS_FISTMAS():
|
||||
return "fistmas"
|
||||
elif IS_HOMOWEEN():
|
||||
return "homoween"
|
||||
elif IS_DKD():
|
||||
return "DKD"
|
||||
elif IS_BIRTHGAY():
|
||||
return "birthgay"
|
||||
elif IS_BIRTHDEAD():
|
||||
return "birthdead"
|
||||
return None
|
||||
|
|
|
@ -137,5 +137,5 @@ def inject_constants():
|
|||
"git_head":git_head, "max_days":max_days, "EMOJI_KINDS":EMOJI_KINDS,
|
||||
"BIO_FRIENDS_ENEMIES_LENGTH_LIMIT":BIO_FRIENDS_ENEMIES_LENGTH_LIMIT,
|
||||
"IMMUNE_TO_AWARDS": IMMUNE_TO_AWARDS, "SITE_FULL_IMAGES": SITE_FULL_IMAGES,
|
||||
"IS_FISTMAS":IS_FISTMAS, "IS_HOMOWEEN":IS_HOMOWEEN, "IS_DKD":IS_DKD, "IS_BIRTHGAY":IS_BIRTHGAY,
|
||||
"IS_FISTMAS":IS_FISTMAS, "IS_HOMOWEEN":IS_HOMOWEEN, "IS_DKD":IS_DKD, "IS_EVENT":IS_EVENT,
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ def vote_post_comment(target_id, new, v, cls, vote_cls):
|
|||
if SITE_NAME == 'WPD':
|
||||
coin_mult *= 2
|
||||
|
||||
if IS_FISTMAS() or IS_HOMOWEEN() or IS_DKD() or IS_BIRTHGAY():
|
||||
if IS_EVENT():
|
||||
coin_mult *= 2
|
||||
|
||||
coin_value = coin_delta * coin_mult
|
||||
|
|
|
@ -7,16 +7,14 @@
|
|||
{% if IS_FISTMAS() and not sub %}
|
||||
{% include 'events/fistmas/banner.html' %}
|
||||
{% else %}
|
||||
{% if IS_BIRTHGAY() and not sub %}
|
||||
{% set src = macros.random_image("assets/events/birthgay/images/banners/" ~ SITE_NAME) %}
|
||||
{% elif IS_DKD() and not sub %}
|
||||
{% set src = macros.random_image("assets/events/DKD/images/banners") %}
|
||||
{% elif err and SITE_NAME == 'rDrama' %}
|
||||
{% if err and SITE_NAME == 'rDrama' %}
|
||||
{% set src = "banner_error.webp" | asset_siteimg %}
|
||||
{% elif sub and sub.has_banners %}
|
||||
{% set src = sub.random_banner() %}
|
||||
{% set alt = ['/h/', sub, 'banner']|join %}
|
||||
{% set class = 'site-banner-hole' %}
|
||||
{% elif IS_EVENT() %}
|
||||
{% set src = macros.random_image("assets/events/" ~ IS_EVENT() ~ "/images/banners") %}
|
||||
{% elif SITE_NAME == "rDrama" %}
|
||||
{% set href = "https://secure.transequality.org/site/Donation2?df_id=1480" %}
|
||||
{% set expand = false %}
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
</h5>
|
||||
</a>
|
||||
|
||||
{%- if IS_BIRTHGAY() -%}
|
||||
{% set image = macros.random_image("assets/events/birthgay/images/sidebar/" ~ SITE_NAME) %}
|
||||
{% if IS_EVENT() %}
|
||||
{% set image = macros.random_image("assets/events/" ~ IS_EVENT() ~ "/images/sidebar") %}
|
||||
{%- elif v -%}
|
||||
{%- set image = macros.random_image("assets/images/" ~ SITE_NAME ~ "/sidebar") -%}
|
||||
{%- else -%}
|
||||
|
|
|
@ -8,12 +8,8 @@
|
|||
|
||||
{% if sub %}
|
||||
{% set image=sub.sidebar_url %}
|
||||
{% elif IS_BIRTHGAY() %}
|
||||
{% set image = macros.random_image("assets/events/birthgay/images/sidebar/" ~ SITE_NAME) %}
|
||||
{% elif IS_DKD() %}
|
||||
{% set image = macros.random_image("assets/events/DKD/images/sidebar") %}
|
||||
{% elif IS_FISTMAS() %}
|
||||
{% set image = macros.random_image("assets/events/fistmas/images/sidebar") %}
|
||||
{% elif IS_EVENT() %}
|
||||
{% set image = macros.random_image("assets/events/" ~ IS_EVENT() ~ "/images/sidebar") %}
|
||||
{% else %}
|
||||
{% set image = macros.random_image("assets/images/" ~ SITE_NAME ~ "/sidebar") %}
|
||||
{% endif %}
|
||||
|
|
|
@ -64,8 +64,6 @@
|
|||
|
||||
{% if IS_DKD() %}
|
||||
{% set favicon_url = macros.random_image('assets/events/DKD/images/favicon') %}
|
||||
{% elif IS_FISTMAS() %}
|
||||
{% set favicon_url = macros.random_image('assets/events/fistmas/images/favicon/' ~ SITE_NAME) %}
|
||||
{% else %}
|
||||
{% set favicon_url = '/icon.webp?x=2' %}
|
||||
{% endif %}
|
||||
|
|