Create Events page

This commit is contained in:
L3D 2024-01-21 23:22:19 +01:00
parent 19fc8f3cd1
commit 3420e18d68
No known key found for this signature in database
GPG Key ID: AD65B920933B4B20
17 changed files with 268 additions and 70 deletions

BIN
assets/favicon.ico (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/favicon.png (Stored with Git LFS) Normal file

Binary file not shown.

8
assets/favicon.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,7 +1,6 @@
[project] [project]
name = chaoswest.tv name = chaoswest.tv
url = https://chaoswest.tv/ url = https://chaoswest.tv/
url_style = relative
excluded_assets = *.scss excluded_assets = *.scss
upscale = false upscale = false
output_path = temp/builds/chaoswest.tv/ output_path = temp/builds/chaoswest.tv/

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,20 @@
title: 36c3
---
event_end_date: 2019-12-30
---
event_start_date: 2019-12-27
---
preview: Am 36c3 in Leipzig hat Chaos-West TV in Halle 3 eine Bühne gebaut. Die Vorträge die dort entstanden sind findet man auf [media.ccc.de/c/36c3/ChaosWest](https://media.ccc.de/c/36c3/ChaosWest).
---
body:
Am 36c3 in Leipzig hat Chaos-West TV in Halle 3 eine Bühne gebaut.
## Vorträge
[media.ccc.de/c/36c3/ChaosWest](https://media.ccc.de/c/36c3/ChaosWest)
---
date: 2019-12-27
---
logo: 36c3.svg
---
logodesc: 36. Chaos Communication Congress

View File

@ -0,0 +1,5 @@
_model: blog
---
title: Veranstaltungen mit Winkekatze TV
---
body: Chaoswest TV hat Videos auf einigen Veranstaltungen gemacht...

View File

@ -2,6 +2,13 @@
"Über uns": { "Über uns": {
"href": "/" "href": "/"
}, },
"Veranstaltungen": {
"href": "/events",
"list_childs": true,
"items": {
"list_namespace": "/events"
}
},
"Kontakt": { "Kontakt": {
"href": "/kontakt" "href": "/kontakt"
}, },

View File

@ -1,6 +1,6 @@
[model] [model]
name = Blog name = Events
label = Blog label = Events
hidden = true hidden = true
[fields.title] [fields.title]
@ -10,3 +10,10 @@ type = string
[children] [children]
model = post model = post
order_by = -event_start_date,title order_by = -event_start_date,title
[fields.body]
label = Body
type = pythonmarkdown
[pagination]
enabled = True

View File

@ -8,18 +8,25 @@ label = Title
type = string type = string
size = large size = large
[fiels.tags]
label = Tags
type = strings
[fields.date] [fields.date]
label = Date label = Date
type = date type = date
[fields.logo]
lable = Event Logo
width = 1/2
type = select
source = record.attachments.images
[fields.logodesc]
label = Event Description
width = 1/2
type = string
[fields.preview] [fields.preview]
label = Preview label = Preview for displayed on index page
type = pythonmarkdown type = pythonmarkdown
[fields.body] [fields.body]
label = Body label = Body to be showed here
type = pythonmarkdown type = pythonmarkdown

File diff suppressed because one or more lines are too long

View File

@ -7,13 +7,18 @@
<li> <li>
<a <a
{% if this._path == mapping.href %} class="active" {% if this._path == mapping.href %} class="active"
{% endif %} {{- ' ' -}} {% endif %}
href="{{ mapping.href|url }}"> href="{{ mapping.href|url }}">
{{- title -}} {{ title }}
</a> </a>
{% else %} {% else %}
<li> <li>
<a
{% if this._path == mapping.href %} class="active"
{% endif %}
href="{{ mapping.href|url }}">
{{ title }} {{ title }}
</a>
<ul> <ul>
{% set sub_menu = mapping['items'].items() %} {% set sub_menu = mapping['items'].items() %}
{% for sub_title, href in sub_menu %} {% for sub_title, href in sub_menu %}
@ -21,10 +26,10 @@
<li> <li>
<a <a
{% if this._path == href %} {% if this._path == href %}
{{- ' class="active"' }} class="active"
{% endif %} {{- ' ' -}} {% endif %}
href="{{ href }}"> href="{{ href }}">
{{- sub_title -}} {{ sub_title }}
</a> </a>
</li> </li>
{% else %} {% else %}
@ -34,10 +39,10 @@
<li> <li>
<a <a
{% if this._path + '/' == child.url_path %} {% if this._path + '/' == child.url_path %}
{{- ' class="active"' -}} ' class="active"
{% endif %} {{- ' ' -}} {% endif %}
href="{{ child.url_path }}"> href="{{ child.url_path }}">
{{- child.title -}} {{ child.title }}
</a> </a>
</li> </li>
{% endif %} {% endif %}

View File

@ -1,10 +1,8 @@
{% extends "layout.html" %} {% extends "layout.html" %}
{% from "macros/blog.html" import render_blog_post %} {% from "macros/blog.html" import render_blog_post %}
{% block title %}{{ this.title }}{% endblock %} {% block title %}{{ this.title }}{% endblock %}
{% block body %} {% block body %}
{{ this.body }}
{% for child in this.pagination.items %} {% for child in this.pagination.items %}
{{ render_blog_post(child, from_index=true) }} {{ render_blog_post(child, from_index=true) }}
{% endfor %} {% endfor %}

View File

@ -1,17 +1,20 @@
{%- macro render_blog_post(post, from_index=false) %} {%- macro render_blog_post(post, from_index=false) %}
<article> <article>
{% if from_index -%} {% if from_index %}
<h2 class="headline"><a href="{{ post|url }}">{{ post.title }}</a></h2> {% if post.logo is defined %}
{% else -%} <a href="{{ post|url(absolute=True) }}">
<h2 class="headline"><a>{{ post.title }}</a></h2> <img alt="{{ post.logodesc }}" src="{{ post|url(absolute=True)}}{{ post.logo | url(absolute=False) }}" />
{% endif -%} </a>
<p class="meta"> {% else %}
{% if post.event_start_date != post.event_end_date -%} <h1 class="headline"><a href="{{ post|url }}">{{ post.title }}</a></h1>
Vom {{ post.event_start_date | dateformat('long', locale=post.alt ) }} bis {{ post.event_end_date | dateformat('long', locale=post.alt) }}. {% endif %}
{%- else -%} {% else %}
Am {{ post.event_start_date | dateformat('long', locale=post.alt) }}. <h1 class="headline"><a>{{ post.title }}</a></h1>
{%- endif %} {% if post.logo is defined %}
</p> <img alt="{{ post.logodesc }}" src="{{ post.logo | url }}" />
{% endif %}
{% endif %}
{% if from_index -%} {% if from_index -%}
{{ post.preview }} {{ post.preview }}
{% else -%} {% else -%}

View File

@ -1,29 +1,4 @@
{%- macro render_pagination(pagination) %} {%- macro render_pagination(pagination) %}
<div class="pagination">
{% if pagination.has_prev -%}
<a href="{{ pagination.prev|url }}">&laquo; Previous</a>
{% else -%}
<a class="disabled">&laquo; Previous</a>
{% endif -%}
{% for site in range(pagination.pages) -%} {% for site in range(pagination.pages) -%}
{% if site == 0 -%}
{%- if pagination.page == site + 1 -%}
<a class="disabled">{{ pagination.page }}</a>
{%- else -%}
<a href="{{ './'| url }}">{{ site + 1 }}</a>
{%- endif -%}
{%- else -%}
{%- if pagination.page == site + 1 -%}
<a class="disabled" >{{ pagination.page }}</a>
{%- else -%}
<a href="{{ './'| url }}page/{{ site + 1 }}/">{{ site + 1 }}</a>
{%- endif -%}
{%- endif %}
{% endfor -%} {% endfor -%}
{% if pagination.has_next -%}
<a href="{{ pagination.next|url }}">Next &raquo;</a>
{%- else -%}
<a class="disabled">Next &raquo;</a>
{%- endif %}
</div>
{% endmacro -%} {% endmacro -%}

View File

@ -1,7 +1,6 @@
{%- extends "layout.html" -%} {% extends "layout.html" %}
{%- block title -%} {% from "macros/blog.html" import render_blog_post %}
{{- this.title -}} {% block title %}{{ this.title }}{% endblock %}
{%- endblock -%} {% block body %}
{%- block body -%}
{{ this.body }} {{ this.body }}
{%- endblock -%} {% endblock %}

6
templates/post.html Normal file
View File

@ -0,0 +1,6 @@
{% extends "layout.html" %}
{% from "macros/blog.html" import render_blog_post %}
{% block title %}{{ this.title }}{% endblock %}
{% block body %}
{{ render_blog_post(this) }}
{% endblock %}