mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-17 05:22:16 +00:00
Make dark theme a user level property, lazy load dark CSS
- Also now respects the colour-scheme media query - Added meta tag to tell the browser we support dark theme, allowing dark UA stylesheet if the user sends said media query - Means you only have to set it once per account rather than once per machine - Dark themed embeds!
This commit is contained in:
18
RIGS/migrations/0040_profile_dark_theme.py
Normal file
18
RIGS/migrations/0040_profile_dark_theme.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 3.1.5 on 2021-02-06 10:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('RIGS', '0039_auto_20210123_1910'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='profile',
|
||||
name='dark_theme',
|
||||
field=models.BooleanField(default=False),
|
||||
),
|
||||
]
|
||||
@@ -26,6 +26,7 @@ class Profile(AbstractUser):
|
||||
is_approved = models.BooleanField(default=False)
|
||||
last_emailed = models.DateTimeField(blank=True,
|
||||
null=True) # Currently only populated by the admin approval email. TODO: Populate it each time we send any email, might need that...
|
||||
dark_theme = models.BooleanField(default=False)
|
||||
|
||||
@classmethod
|
||||
def make_api_key(cls):
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
|
||||
{% block content %}
|
||||
{% include 'item_modal.html' %}
|
||||
<form class=" itemised_form" role="form" method="POST">
|
||||
<form class="itemised_form" role="form" method="POST">
|
||||
{% csrf_token %}
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
Reference in New Issue
Block a user