From b0a17bc537aeb21886fa7c9cf24fae448a262a82 Mon Sep 17 00:00:00 2001 From: Denys Konovalov Date: Tue, 28 Feb 2023 09:33:57 +0100 Subject: [PATCH] unterhaufen + ui --- assets/scss/_common.scss | 11 +++++ config.yml | 1 + content/german/superhaufen/30-jahre-gcg.md | 32 -------------- content/german/superhaufen/_index.md | 3 +- layouts/_default/superhaufen.html | 7 ++++ layouts/schulchronik/single.html | 6 +-- layouts/superhaufen/list.html | 2 +- layouts/superhaufen/single.html | 12 ++++++ static/schulchronik/admin/config.yml | 49 +++++++++++++++++++++- static/schulchronik/admin/index.html | 2 +- 10 files changed, 85 insertions(+), 40 deletions(-) delete mode 100644 content/german/superhaufen/30-jahre-gcg.md create mode 100644 layouts/_default/superhaufen.html diff --git a/assets/scss/_common.scss b/assets/scss/_common.scss index 497ff4c5..d3148dcd 100644 --- a/assets/scss/_common.scss +++ b/assets/scss/_common.scss @@ -445,4 +445,15 @@ details[open] summary { .content-justify { text-align: justify; +} + +.fb-tile-color { + display: flex; + justify-content: center; + align-items: center; + height: 195px; +} + +.fb-tile-icon { + font-size: 96px; } \ No newline at end of file diff --git a/config.yml b/config.yml index 2e232114..1f0731b9 100644 --- a/config.yml +++ b/config.yml @@ -7,6 +7,7 @@ defaultContentLanguage: de enableEmoji: true enableRobotsTxt: true timeZone: Europe/Berlin +removePathAccents: true markup: defaultMarkdownHandler: goldmark goldmark: diff --git a/content/german/superhaufen/30-jahre-gcg.md b/content/german/superhaufen/30-jahre-gcg.md deleted file mode 100644 index 1bc66f06..00000000 --- a/content/german/superhaufen/30-jahre-gcg.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: 30-jähriges Jubiläum -draft: "false" -bg_image: /media/backgrounds/page-title.webp -description: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam -image: /media/image.webp -type: superhaufen -gallery: false -tiles: - - title: Lorem-1 - image: /media/image.webp - bg_color: \#990000 - icon: mdi mdi-pillar - font_color: white - content: | - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. - - title: Lorem-2 - image: /media/image.webp - bg_color: \#99ffff - icon: mdi mdi-head-cog-outline - font_color: black - content: | - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. - - title: Lorem-3 - image: /media/image.webp - bg_color: \#cc9966 - icon: mdi mdi-fireplace - font_color: black - content: | - Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. ---- -Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam \ No newline at end of file diff --git a/content/german/superhaufen/_index.md b/content/german/superhaufen/_index.md index c5291ce9..b7e34f87 100644 --- a/content/german/superhaufen/_index.md +++ b/content/german/superhaufen/_index.md @@ -2,6 +2,5 @@ title: Superhaufen draft: false bg_image: media/backgrounds/page-title.webp -description: Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. -type: "superhaufen" +description: null --- \ No newline at end of file diff --git a/layouts/_default/superhaufen.html b/layouts/_default/superhaufen.html new file mode 100644 index 00000000..0ec4ac12 --- /dev/null +++ b/layouts/_default/superhaufen.html @@ -0,0 +1,7 @@ +
+ +
+ \ No newline at end of file diff --git a/layouts/schulchronik/single.html b/layouts/schulchronik/single.html index ebf98d50..575caff1 100644 --- a/layouts/schulchronik/single.html +++ b/layouts/schulchronik/single.html @@ -35,8 +35,8 @@ {{ $topics = $topics | append (slice (slice .Params.Title 200)) }} {{ end }} {{ range .Params.topics }} - {{ if .superhaufen }} - {{ $topics = $topics | append (slice (slice .title 30 .superlink "superhaufen" )) }} + {{ if .superhaufen.enable }} + {{ $topics = $topics | append (slice (slice .title 30 (.superhaufen.link | urlize) "superhaufen" )) }} {{ else }} {{ $topics = $topics | append (slice (slice .title 30 (md5 .title) )) }} {{ end }} @@ -49,7 +49,7 @@ click: function (item) { if (item[1] != 200 || (item[1] == 200 && item[2] == "pretext")) { if( item[3] == "superhaufen" ) { - window.location.href = "/superhaufen/" + item[2]; + window.location.href = "{{ `/superhaufen/` | relLangURL }}" + item[2]; } else { $('#' + item[2]).modal('show'); } diff --git a/layouts/superhaufen/list.html b/layouts/superhaufen/list.html index 65793de8..503437d5 100644 --- a/layouts/superhaufen/list.html +++ b/layouts/superhaufen/list.html @@ -5,7 +5,7 @@
{{ range .Data.Pages }}
- {{ .Render "fach" }} + {{ .Render "superhaufen" }}
{{ end }}
diff --git a/layouts/superhaufen/single.html b/layouts/superhaufen/single.html index 2a10a30c..172bf701 100644 --- a/layouts/superhaufen/single.html +++ b/layouts/superhaufen/single.html @@ -24,6 +24,18 @@
{{ .content | markdownify }}
+ {{ range .unterhaufen }} +
+
+
+
+ {{ .title }} +

{{ .content }}

+
+
+
+
+ {{ end }} diff --git a/static/schulchronik/admin/config.yml b/static/schulchronik/admin/config.yml index 92fc10be..bd8dc979 100644 --- a/static/schulchronik/admin/config.yml +++ b/static/schulchronik/admin/config.yml @@ -136,6 +136,39 @@ collections: - {label: "Type", name: "type", widget: "hidden", default: "cantorpreis"} - {label: "Gallerie-Komponente", name: "gallery", widget: "boolean", default: false, required: false, hint: "Benötigt für Gallerie bzw. Bildeinbettung"} - {label: "Text", name: "body", widget: "markdown", required: false} + - name: "superhaufen" + icon: "superhaufen" + label: "Superhaufen" + label_singular: "Superhaufen" + folder: "content/german/superhaufen" + filter: {field: "type", value: "superhaufen"} + create: true + editor: + preview: false + media_folder: '/static/media/schulchronik/superhaufen' + public_folder: '/media/schulchronik/superhaufen' + fields: + - {label: "Titel", name: "title", widget: "string"} + - {label: "Entwurf", name: "draft", widget: "boolean", default: false, required: false} + - {label: "Hintergrundbild", name: "bg_image", widget: "hidden", default: "/media/backgrounds/page-title.webp"} + - {label: "Type", name: "type", widget: "hidden", default: "superhaufen"} + - label: "Kacheln" + name: "tiles" + widget: "list" + required: false + fields: + - {label: "Titel", name: "title", widget: "string", required: true} + - {label: "Hintergrundfarbe", name: "bg_color", widget: "color", required: true} + - {label: "Symbol", name: "icon", widget: "string", required: true} + - {label: "Symbolfarbe", name: "font_color", widget: "color", required: true} + - {label: "Inhalt", name: "content", widget: "markdown", required: true} + - label: "Unter-Unterhaufen" + name: "unterhaufen" + widget: "list" + required: false + fields: + - {label: "Titel", name: "title", widget: "string", required: false} + - {label: "Inhalt", name: "content", widget: "markdown", required: true} - name: "schulchronik" icon: "pillar" label: "Schulchronik" @@ -156,10 +189,24 @@ collections: - label: "Kreative Haufen" name: "topics" widget: "list" + required: false fields: - {label: "Titel", name: "title", widget: "string", required: true} - {label: "Inhalt", name: "content", widget: "markdown", required: true} - required: false + - label: "Superhaufen" + name: "superhaufen" + widget: "object" + required: false + fields: + - {label: "Aktiviert", name: "enable", widget: "boolean", required: false} + - label: "Superhaufen" + name: "link" + widget: "relation" + collection: "superhaufen" + search_fields: ["title"] + value_field: "title" + required: false + collapsed: true - label: "Cantorpreisträger" name: "cantorpreisträger" widget: "relation" diff --git a/static/schulchronik/admin/index.html b/static/schulchronik/admin/index.html index 8c0d609c..308c25f7 100644 --- a/static/schulchronik/admin/index.html +++ b/static/schulchronik/admin/index.html @@ -21,7 +21,7 @@ CMS.init();