Header vom Layout separiert. Ermöglicht custom Claims auf allen Seiten.

This commit is contained in:
Stephan 2021-02-06 15:13:13 +01:00
parent 2ce68cd644
commit 8e27c3af5d
9 changed files with 127 additions and 100 deletions

View File

@ -1,5 +1,22 @@
_model: page _model: page
--- ---
claim_heading:
## <span>Werde <em>Teilchen&shy;beschleu&shy;nigerIn</em></span><br><span>in der chaosnahen Genossenschaft.</span>
---
claim_content:
Booste Projekte mit Unterstütung von 150 GenossInnen<br>Genossen&shy;schaftlich & solidarisch.
---
subclaim_heading:
## Genossenschaft zur Erschließung neuer<br />Betätigungs­formen in der Informations­technologie.
---
subclaim_content:
Wir halten Mitglieder und Interessierte durch regelmäßige Rundmails, Beiträge im Wiki und unseren Podcast auf dem Laufenden.<br>
Unseren Podcast findest du auf [vebit.xyz/podcast](https://vebit.xyz/pocast).
---
title: About this Website title: About this Website
--- ---
body: body:

19
models/header.ini Normal file
View File

@ -0,0 +1,19 @@
[model]
name = Header
label = Header
[fields.claim_heading]
label = Claim Heading
type = markdown
[fields.claim_content]
label = Claim Content
type = markdown
[fields.subclaim_heading]
label = Subclaim Heading
type = markdown
[fields.subclaim_content]
label = Subclaim Content
type = markdown

View File

@ -1,26 +1,11 @@
[model] [model]
name = Homepage name = Homepage
label = Homepage label = Homepage
inherits = header
[fields.title] [fields.title]
label = Title label = Title
type = string type = string
[fields.claim_heading]
label = Claim Heading
type = markdown
[fields.claim_content]
label = Claim Content
type = markdown
[fields.subclaim_heading]
label = Subclaim Heading
type = markdown
[fields.subclaim_content]
label = Subclaim Content
type = markdown
[children] [children]
order_by = sort_key order_by = sort_key

View File

@ -1,6 +1,7 @@
[model] [model]
name = Multisection name = Multisection
label = Multisection label = Multisection
inherits = header
[fields.title] [fields.title]
label = Title label = Title

View File

@ -1,6 +1,7 @@
[model] [model]
name = Page name = Page
label = {{ this.title }} label = {{ this.title }}
inherits = header
[fields.title] [fields.title]
label = Title label = Title

85
templates/header.html Normal file
View File

@ -0,0 +1,85 @@
{% extends "layout.html" %}
{% block header %}
<div class="header__top_box">
<div class="header__logo_box">
<a class="header__homelink" href="{{ '/'|url }}" title="Startseite">
<img class="header__logo" src="{{ '/images/wtf_logo.svg'|url }}" style="height: 7rem;">
</a>
</div>
<nav class="header__secondary_nav">
<ul class="secondary_nav__navlist">
<li class="secondary_nav__navitem">
<a class="secondary_nav__navlink" href="#">EN</a>
</li>
<li class="secondary_nav__navitem">
<a class="secondary_nav__navlink" href="https://meta.vebit.xyz">Login</a>
</li>
</ul>
</nav>
</div>
<div class="header__bg_box">
<nav class="header__primary_nav">
<div class="primary_nav__toggle">
<svg viewBox="0 0 100 80" width="32" height="32">
<rect width="100" height="15"></rect>
<rect y="30" width="100" height="15"></rect>
<rect y="60" width="100" height="15"></rect>
</svg>
<p>menu</p>
</div>
<ul class="primary_nav__navlist">
{% for title, mapping in bag("navigation").items() %}
<li class="primary_nav__navitem
{%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %}
-active
{%- endif -%}
{%- if loop.index == 1 %}
-first
{%- endif -%}
">
<a class="primary_nav__navlink {% if this._path == mapping.href %}-active{% endif %}" href="{{ mapping.href|url }}">
{{ title }}
</a>
{% if mapping.list_childs %}
<ul class="primary_nav__sub_navlist">
{% set sub_menu = mapping['items'].items() %}
{% for sub_title, href in sub_menu %}
<li class="primary_nav__sub_navitem {%- if this._path == href %} -active{%- endif %}">
<a class="primary_nav__navlink {% if this._path == href %}-active{% endif %}" href="{{ href|url }}">
{{ sub_title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
<!-- background for header box - start -->
<div class="bg_box__top_bar_left"></div>
<div class="bg_box__top_bar_middle"></div>
<div class="bg_box__top_bar_right"></div>
<div class="bg_box__unicorns"></div>
<div class="bg_box__big_bg"></div>
<div class="bg_box__bottom_bar_left"></div>
<div class="bg_box__bottom_bar_middle"></div>
<div class="bg_box__bottom_bar_right"></div>
<div class="bg_box__very_bottom_bar"></div>
<!-- background for header box - end -->
<section class="header__claim">
<!-- TODO: Claims in Lektor editierbar. -->
{{ this.claim_heading }}
{{ this.claim_content }}
</section>
<section class="header__sub_claim">
<div class="sub_claim__box">
{{ this.subclaim_heading }}
{{ this.subclaim_content }}
</div>
<!-- TODO: Zielseite für "MEMBER WERDEN"-Button -->
<button class="header__button sub_claim__button">MEMBER WERDEN</button>
</section>
</div>
{% endblock %}

View File

@ -1,4 +1,4 @@
{% extends "layout.html" %} {% extends "header.html" %}
{% from "macros/multisection.html" import render_section %} {% from "macros/multisection.html" import render_section %}
{% block body %} {% block body %}
<div class="content__box"> <div class="content__box">

View File

@ -32,88 +32,7 @@
</head> </head>
<body> <body>
<header> <header>
<div class="header__top_box"> {% block header %}{% endblock %}
<div class="header__logo_box">
<a class="header__homelink" href="{{ '/'|url }}" title="Startseite">
<img class="header__logo" src="{{ '/images/wtf_logo.svg'|url }}" style="height: 7rem;">
</a>
</div>
<nav class="header__secondary_nav">
<ul class="secondary_nav__navlist">
<li class="secondary_nav__navitem">
<a class="secondary_nav__navlink" href="#">EN</a>
</li>
<li class="secondary_nav__navitem">
<a class="secondary_nav__navlink" href="https://meta.vebit.xyz">Login</a>
</li>
</ul>
</nav>
</div>
<div class="header__bg_box">
<nav class="header__primary_nav">
<div class="primary_nav__toggle">
<svg viewBox="0 0 100 80" width="32" height="32">
<rect width="100" height="15"></rect>
<rect y="30" width="100" height="15"></rect>
<rect y="60" width="100" height="15"></rect>
</svg>
<p>menu</p>
</div>
<ul class="primary_nav__navlist">
{% for title, mapping in bag("navigation").items() %}
<li class="primary_nav__navitem
{%- if this._path == mapping.href or mapping.href != '/' and this.is_child_of(mapping.href) %}
-active
{%- endif -%}
{%- if loop.index == 1 %}
-first
{%- endif -%}
">
<a class="primary_nav__navlink {% if this._path == mapping.href %}-active{% endif %}" href="{{ mapping.href|url }}">
{{ title }}
</a>
{% if mapping.list_childs %}
<ul class="primary_nav__sub_navlist">
{% set sub_menu = mapping['items'].items() %}
{% for sub_title, href in sub_menu %}
<li class="primary_nav__sub_navitem {%- if this._path == href %} -active{%- endif %}">
<a class="primary_nav__navlink {% if this._path == href %}-active{% endif %}" href="{{ href|url }}">
{{ sub_title }}
</a>
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</nav>
<!-- background for header box - start -->
<div class="bg_box__top_bar_left"></div>
<div class="bg_box__top_bar_middle"></div>
<div class="bg_box__top_bar_right"></div>
<div class="bg_box__unicorns"></div>
<div class="bg_box__big_bg"></div>
<div class="bg_box__bottom_bar_left"></div>
<div class="bg_box__bottom_bar_middle"></div>
<div class="bg_box__bottom_bar_right"></div>
<div class="bg_box__very_bottom_bar"></div>
<!-- background for header box - end -->
<section class="header__claim">
<!-- TODO: Claims in Lektor editierbar. -->
{{ this.claim_heading }}
{{ this.claim_content }}
</section>
<section class="header__sub_claim">
<div class="sub_claim__box">
{{ this.subclaim_heading }}
{{ this.subclaim_content }}
</div>
<!-- TODO: Zielseite für "MEMBER WERDEN"-Button -->
<button class="header__button sub_claim__button">MEMBER WERDEN</button>
</section>
</div>
</header> </header>
<main> <main>

View File

@ -1,4 +1,4 @@
{% extends "layout.html" %} {% extends "header.html" %}
{% from "macros/multisection.html" import render_section %} {% from "macros/multisection.html" import render_section %}
{% block body %} {% block body %}
{% for child in this.children %} {% for child in this.children %}