From 66f21d9d1d77419544ad7687811acc077b1be5f9 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 16 Oct 2021 03:39:20 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20"Gestione=20Amber"=20theme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0005_auto_20211016_0136.py | 24 +++++++++++++++++++ backend/sophon/core/models.py | 1 + frontend/src/contexts/theme.tsx | 5 ++-- 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 backend/sophon/core/migrations/0005_auto_20211016_0136.py diff --git a/backend/sophon/core/migrations/0005_auto_20211016_0136.py b/backend/sophon/core/migrations/0005_auto_20211016_0136.py new file mode 100644 index 0000000..f15e634 --- /dev/null +++ b/backend/sophon/core/migrations/0005_auto_20211016_0136.py @@ -0,0 +1,24 @@ +# Generated by Django 3.2.7 on 2021-10-16 01:36 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('core', '0004_sophoninstancedetails'), + ] + + operations = [ + migrations.AlterModelOptions( + name='sophoninstancedetails', + options={'verbose_name': 'Sophon instance details', 'verbose_name_plural': 'Sophon instance details'}, + ), + migrations.AlterField( + model_name='sophoninstancedetails', + name='theme', + field=models.CharField( + choices=[('sophon', 'The Sophonity'), ('paper', 'Sheet of Paper'), ('royalblue', 'Royal Blue'), ('hacker', 'Hacker Terminal'), + ('amber', 'Gestione Amber')], default='sophon', help_text='The bluelib theme of the Sophon instance.', max_length=32, + verbose_name='Theme'), + ), + ] diff --git a/backend/sophon/core/models.py b/backend/sophon/core/models.py index 0930a58..422618c 100644 --- a/backend/sophon/core/models.py +++ b/backend/sophon/core/models.py @@ -203,6 +203,7 @@ class SophonInstanceDetails(SophonModel): ("paper", "Sheet of Paper"), ("royalblue", "Royal Blue"), ("hacker", "Hacker Terminal"), + ("amber", "Gestione Amber"), ), default="sophon", max_length=32, diff --git a/frontend/src/contexts/theme.tsx b/frontend/src/contexts/theme.tsx index e814fc5..2bb8db5 100644 --- a/frontend/src/contexts/theme.tsx +++ b/frontend/src/contexts/theme.tsx @@ -1,3 +1,4 @@ +import {BluelibTheme} from "@steffo/bluelib-react/dist/types" import * as React from "react" import {ContextData} from "../types/ContextTypes" import {WithChildren} from "../types/ExtraTypes" @@ -5,7 +6,7 @@ import {WithChildren} from "../types/ExtraTypes" // States type ThemeSelected = { - bluelib: "sophon" | "royalblue" | "hacker" | "paper", + bluelib: BluelibTheme, title: string, } @@ -14,7 +15,7 @@ type ThemeSelected = { type ThemeSet = { type: "set", - bluelib: "sophon" | "royalblue" | "hacker" | "paper", + bluelib: BluelibTheme, title: string, }