From a722acc3d119feb6bb27c5a2b2cf97479f5250e1 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Fri, 3 Nov 2023 19:02:27 +0100 Subject: [PATCH] custom themes, additional features --- static/admin/config/collections/author.js | 1 + static/admin/config/collections/blog.js | 1 + static/admin/config/collections/cantorfora.js | 9 ------- static/admin/config/index.js | 8 ++++++ static/admin/config/schulchronik.js | 8 ++++++ static/admin/config/themes.js | 25 +++++++++++++++++++ static/admin/index.html | 4 +-- static/schulchronik/admin/index.html | 4 +-- 8 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 static/admin/config/themes.js diff --git a/static/admin/config/collections/author.js b/static/admin/config/collections/author.js index 337f001f..0485dd41 100644 --- a/static/admin/config/collections/author.js +++ b/static/admin/config/collections/author.js @@ -48,6 +48,7 @@ const AuthorCollection = { ], }, view_groups: { + default: "active", groups: [ { name: "simplified", diff --git a/static/admin/config/collections/blog.js b/static/admin/config/collections/blog.js index d479a378..d7948792 100644 --- a/static/admin/config/collections/blog.js +++ b/static/admin/config/collections/blog.js @@ -25,6 +25,7 @@ const BlogCollection = { value: "post", }, view_groups: { + default: "draft", groups: [ { name: "draft", diff --git a/static/admin/config/collections/cantorfora.js b/static/admin/config/collections/cantorfora.js index 42822154..f260471e 100644 --- a/static/admin/config/collections/cantorfora.js +++ b/static/admin/config/collections/cantorfora.js @@ -19,15 +19,6 @@ const CantorforaCollection = { frame: true, size: "half", }, - view_groups: { - groups: [ - { - name: "draft", - label: "Entwürfe", - field: "draft", - }, - ], - }, summary_fields: ["title", "draft", "description"], sortable_fields: { fields: ["index", "title"], diff --git a/static/admin/config/index.js b/static/admin/config/index.js index d362236d..1d92150d 100644 --- a/static/admin/config/index.js +++ b/static/admin/config/index.js @@ -17,6 +17,7 @@ import { SuperhaufenCollection, WettbewerbeCollection, } from "./collections/index.js"; +import { GCGThemeDark, GCGThemeLight } from "./themes.js"; const config = { backend: { @@ -48,6 +49,13 @@ const config = { clean_accents: true, sanitize_replacement: "-", }, + theme: { + include_built_in_themes: false, + themes: [ + GCGThemeDark, + GCGThemeLight + ] + }, collections: [ SettingsCollection, IndexPagesCollection, diff --git a/static/admin/config/schulchronik.js b/static/admin/config/schulchronik.js index 9425cfe0..f47f2e67 100644 --- a/static/admin/config/schulchronik.js +++ b/static/admin/config/schulchronik.js @@ -7,6 +7,7 @@ import { StatsCollection, SuperhaufenCollection, } from "./collections/index.js"; +import { GCGThemeDark, GCGThemeLight } from "./themes.js"; const config = { backend: { @@ -38,6 +39,13 @@ const config = { clean_accents: true, sanitize_replacement: "-", }, + theme: { + include_built_in_themes: false, + themes: [ + GCGThemeDark, + GCGThemeLight + ] + }, collections: [ ChronikjahreCollection, SuperhaufenCollection, diff --git a/static/admin/config/themes.js b/static/admin/config/themes.js new file mode 100644 index 00000000..3833404c --- /dev/null +++ b/static/admin/config/themes.js @@ -0,0 +1,25 @@ +const GCGThemeDark = { + name: "GCG.Dark", + extends: "dark", + primary: { + main: "#ffbc3b", + contrastColor: "#4b4b4b", + }, + background: { + main: "#1a1a37", + dark: "#13132d", + }, +}; + +const GCGThemeLight = { + name: "GCG.Light", + extends: "light", + primary: { + main: "#1a1a37", + }, + background: { + dark: "#f1f3f5", + }, +}; + +export { GCGThemeDark, GCGThemeLight }; diff --git a/static/admin/index.html b/static/admin/index.html index e1339395..b1773d39 100644 --- a/static/admin/index.html +++ b/static/admin/index.html @@ -9,12 +9,12 @@ /> Static CMS - + +