1 less request, 1 less transaction, 1 less query

remotes/1693045480750635534/spooky-22
Aevann1 2022-07-01 23:10:48 +02:00
parent bc12edb5b9
commit d59f346f0b
7 changed files with 21 additions and 6 deletions

View File

@ -598,6 +598,9 @@ def settings_css(v):
if v.agendaposter: return {"error": "Agendapostered users can't edit css!"}
css = request.values.get("css").strip().replace('\\', '').strip()[:4000]
if '</style>' in css.lower(): return {"error": "Please message @Aevann if you get this error"}
v.css = css
g.db.add(v)

View File

@ -40,7 +40,9 @@
}
</style>
{% elif v.css %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
{% else %}
<style>:root{--primary:#{{DEFAULT_COLOR}}</style>

View File

@ -19,7 +19,9 @@
<link rel="stylesheet" href="{{asset('css/main.css')}}">
<link rel="stylesheet" href="{{asset('css/' + v.theme + '.css')}}">
{% if v.css %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
<style>

View File

@ -36,7 +36,9 @@
}
</style>
{% elif v.css %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
{% else %}
<style>:root{--primary:#{{DEFAULT_COLOR}}</style>

View File

@ -27,7 +27,9 @@
}
</style>
{% elif v.css %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
{% else %}
<style>:root{--primary:#{{DEFAULT_COLOR}}</style>

View File

@ -56,7 +56,9 @@
}
</style>
{% elif v.css and not request.path.startswith('/settings/css') %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
</head>

View File

@ -49,7 +49,9 @@
}
</style>
{% elif v.css %}
<link rel="stylesheet" href="/{{v.id}}/css">
<style>
{{v.css | safe}}
</style>
{% endif %}
{% else %}
<style>:root{--primary:#{{DEFAULT_COLOR}}</style>