From e66422ae1e2e670d8b8ac31aeb7fea0eb7af9e1b Mon Sep 17 00:00:00 2001 From: Stephan Date: Wed, 17 Mar 2021 20:17:38 +0100 Subject: [PATCH] WIP: Added flow_block_page model to not break pages without flow blocks. --- content/about/contents.lr | 2 +- models/flow_block_page.ini | 28 ++++++++++++++++++ models/page.ini | 5 ---- templates/flow_block_page.html | 53 ++++++++++++++++++++++++++++++++++ templates/page.html | 48 ++++++------------------------ 5 files changed, 91 insertions(+), 45 deletions(-) create mode 100644 models/flow_block_page.ini create mode 100644 templates/flow_block_page.html diff --git a/content/about/contents.lr b/content/about/contents.lr index 6a4ddf0..2671fbc 100644 --- a/content/about/contents.lr +++ b/content/about/contents.lr @@ -1,4 +1,4 @@ -_model: page +_model: flow_block_page --- title: Hacken in bester Genossenschaft --- diff --git a/models/flow_block_page.ini b/models/flow_block_page.ini new file mode 100644 index 0000000..52d9254 --- /dev/null +++ b/models/flow_block_page.ini @@ -0,0 +1,28 @@ +[model] +name = Flow Block Page +label = {{ this.title }} +inherits = header_slim + +[fields.title] +label = Title +description = Der Seitentitel und die Überschrift dieser Seite +type = string + +[fields.meta_description] +label = Meta Beschreibung +description = Hier kommt die Beschreibung rein, die von Suchmachinen, Seitencrawlern und Previews auf diese Seite generiert werden +type = string + +[fields.teaser] +label = Teaser +description = Erster, hervorgehobener Absatz des Texts (Vorspann). +type = markdown + +[fields.body] +label = Body +type = markdown + +[fields.section] +label = Sections +type = flow +flow_blocks = flow_text_section diff --git a/models/page.ini b/models/page.ini index d9092a7..575d707 100644 --- a/models/page.ini +++ b/models/page.ini @@ -21,8 +21,3 @@ type = markdown [fields.body] label = Body type = markdown - -[fields.section] -label = Sections -type = flow -flow_blocks = flow_text_section diff --git a/templates/flow_block_page.html b/templates/flow_block_page.html new file mode 100644 index 0000000..a28f95c --- /dev/null +++ b/templates/flow_block_page.html @@ -0,0 +1,53 @@ +{% extends "header_slim.html" %} +{%- block title -%}{{ this.title }}{%- endblock -%} +{%- block meta_description -%} + {%- if this.meta_description is defined and this.meta_description != "" -%} + {{ this.meta_description }} + {%- else -%} + Werkkooperative der Technikfreundinnen eG + {%- endif -%} +{%- endblock -%} +{% block body %} + +
+
+
+

{{ this.title }}

+
+
+
+
+ +
+ {{ this.body }} +
+
+ {% if this.attachments.images %} +
+ {% for image in this.attachments.images %} + {{ image.description }} + {% endfor %} +
+ {% endif %} +
+
+ + + +
+
+
+ {% for block in this.section.blocks %} +
+

{{ block.title }}

+ + {{ block.body }} +
+ {% endfor %} +
+
+
+ +{% endblock %} diff --git a/templates/page.html b/templates/page.html index a28f95c..c4a79ee 100644 --- a/templates/page.html +++ b/templates/page.html @@ -8,46 +8,16 @@ {%- endif -%} {%- endblock -%} {% block body %} - -
-
+
+
+

{{ this.title }}

+
+
+
+
-

{{ this.title }}

-
-
-
-
- -
- {{ this.body }} -
-
- {% if this.attachments.images %} -
- {% for image in this.attachments.images %} - {{ image.description }} - {% endfor %} -
- {% endif %} -
-
- - - -
-
-
- {% for block in this.section.blocks %} -
-

{{ block.title }}

- - {{ block.body }} -
- {% endfor %} + {{ this.body }}
- -{% endblock %} +{% endblock %} \ No newline at end of file