minor background dedup

pull/31/head
Aevann1 2022-11-29 05:37:53 +02:00
parent 52e0972ddc
commit 3e42918afb
2 changed files with 15 additions and 10 deletions

View File

@ -92,7 +92,7 @@ def settings_personal_post(v):
background = request.values.get("background", v.background)
if background != v.background and background.endswith(".webp") and len(background) <= 20:
v.background = request.values.get("background")
v.background = request.values.get("background").replace('.webp', '')
updated = True
elif request.values.get("reddit", v.reddit) != v.reddit:
reddit = request.values.get("reddit")

View File

@ -157,17 +157,22 @@
{% macro stylesheets_lower() %}
{% if SITE_NAME == 'rDrama' and (not v or v.is_banned or v.agendaposter) %}
{% set background = '/assets/images/backgrounds/glitter/1.webp?v=3' %}
{% set background = 'glitter/1' %}
{% elif v and v.background %}
{% set background = '/assets/images/backgrounds/' + v.background %}
{% set background = v.background %}
{% endif %}
{% if background %}
<style>
body {
background:url("/assets/images/backgrounds/{{background}}.webp?v=4") center center fixed;
background-color: var(--background);
{% if 'anime/' not in background -%}
background-size: cover;
{%- endif %}
}
</style>
{% endif %}
<style>
body {
background:url({{background}}) center center fixed;
background-color: var(--background);
{% if 'anime' not in background %}background-size: cover;{% endif %}
}
</style>
{% endmacro %}
{% macro default_theme() %}