master
Aevann1 2022-03-26 20:30:18 +02:00
parent 20405c7f8f
commit 9623ce5f4e
13 changed files with 24 additions and 25 deletions

View File

@ -52,6 +52,7 @@ def settings_profile_post(v):
if request.values.get("background", v.background) != v.background: if request.values.get("background", v.background) != v.background:
updated = True updated = True
v.background = request.values.get("background") v.background = request.values.get("background")
v.theme = 'transparent'
elif request.values.get("slurreplacer", v.slurreplacer) != v.slurreplacer: elif request.values.get("slurreplacer", v.slurreplacer) != v.slurreplacer:
updated = True updated = True
@ -325,9 +326,7 @@ def settings_profile_post(v):
theme = request.values.get("theme") theme = request.values.get("theme")
if theme: if theme:
if theme in {"dramblr","classic","classic_dark","transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}: if theme in {"dramblr", "classic", "classic_dark", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"}:
if theme == "transparent" and not v.background:
return {"error": "You need to set a background to use the transparent theme!"}
v.theme = theme v.theme = theme
if theme == "win98": v.themecolor = "30409f" if theme == "win98": v.themecolor = "30409f"
updated = True updated = True

View File

@ -15,7 +15,7 @@
{% if v %} {% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.agendaposter %} {% if v.agendaposter %}
<style> <style>
html { html {
@ -39,7 +39,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
{% endif %} {% endif %}
</head> </head>

View File

@ -14,8 +14,8 @@
<title>Chat</title> <title>Chat</title>
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201">
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.css %} {% if v.css %}
<link rel="stylesheet" href="/@{{v.username}}/css"> <link rel="stylesheet" href="/@{{v.username}}/css">
{% endif %} {% endif %}

View File

@ -7,8 +7,8 @@
<script src="/static/assets/js/bootstrap.js?v=245"></script> <script src="/static/assets/js/bootstrap.js?v=245"></script>
{% if v %} {% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201">
<link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.agendaposter %} {% if v.agendaposter %}
<style> <style>
html { html {
@ -32,8 +32,8 @@
{% endif %} {% endif %}
{% else %} {% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
{% endif %} {% endif %}
{% if sub and sub.css and not request.path.endswith('settings') %} {% if sub and sub.css and not request.path.endswith('settings') %}

View File

@ -6,7 +6,7 @@
{% block content %} {% block content %}
{% if v %} {% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.agendaposter %} {% if v.agendaposter %}
<style> <style>
html { html {
@ -30,7 +30,7 @@
{% endif %} {% endif %}
{% else %} {% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
{% endif %} {% endif %}
<div class="row justify-content-around"> <div class="row justify-content-around">

View File

@ -18,8 +18,8 @@
{% endblock %} {% endblock %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
</head> </head>

View File

@ -14,7 +14,7 @@
<title>2-Step Login - {{SITE_NAME}}</title> <title>2-Step Login - {{SITE_NAME}}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
</head> </head>

View File

@ -34,7 +34,7 @@
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=190"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=190"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.agendaposter %} {% if v.agendaposter %}
<style> <style>
html { html {

View File

@ -39,10 +39,10 @@
{% if v %} {% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% else %} {% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
{% endif %} {% endif %}
</head> </head>

View File

@ -115,7 +115,7 @@
<p>Change the theme for the website.</p> <p>Change the theme for the website.</p>
<div class="input-group mb2"> <div class="input-group mb2">
<select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="post_toast(this,'/settings/profile?theme='+document.getElementById('theme').value, '1')"> <select autocomplete="off" id='theme' class="form-control" form="profile-settings" name="theme" onchange="post_toast(this,'/settings/profile?theme='+document.getElementById('theme').value, '1')">
{% for entry in ["dramblr","classic","classic_dark","transparent", "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"] %} {% for entry in ["dramblr", "classic", "classic_dark",, "win98", "dark", "light", "coffee", "tron", "4chan", "midnight"] %}
<option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}> <option value="{{entry}}" {% if v.theme==entry %} selected {% endif %}>
{{entry}} {{entry}}
</option> </option>

View File

@ -31,7 +31,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title> <title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
</head> </head>

View File

@ -32,7 +32,7 @@
<title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title> <title>{% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %}</title>
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
</head> </head>

View File

@ -26,7 +26,7 @@
{% block stylesheets %} {% block stylesheets %}
{% if v %} {% if v %}
<style>:root{--primary:#{{v.themecolor}}}</style> <style>:root{--primary:#{{v.themecolor}}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201"><link rel="stylesheet" href="/static/assets/css/{{v.theme}}.css?v=32">
{% if v.agendaposter %} {% if v.agendaposter %}
<style> <style>
html { html {
@ -50,8 +50,8 @@
{% endif %} {% endif %}
{% else %} {% else %}
<style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style> <style>:root{--primary:#{{config('DEFAULT_COLOR')}}</style>
<link rel="stylesheet" href="/static/assets/css/main.css?v=200"> <link rel="stylesheet" href="/static/assets/css/main.css?v=201">
<link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=31"> <link rel="stylesheet" href="/static/assets/css/{{config('DEFAULT_THEME')}}.css?v=32">
{% endif %} {% endif %}
{% endblock %} {% endblock %}