Create Events page
This commit is contained in:
		
							parent
							
								
									19fc8f3cd1
								
							
						
					
					
						commit
						3420e18d68
					
				
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| 
		 After Width: | Height: | Size: 14 KiB  | 
| 
						 | 
					@ -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  | 
| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					_model: blog
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					title: Veranstaltungen mit Winkekatze TV
 | 
				
			||||||
 | 
					---
 | 
				
			||||||
 | 
					body: Chaoswest TV hat Videos auf einigen Veranstaltungen gemacht...
 | 
				
			||||||
| 
						 | 
					@ -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"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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
											
										
									
								
							| 
						 | 
					@ -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 %}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 %}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 -%}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,29 +1,4 @@
 | 
				
			||||||
{%- macro render_pagination(pagination) %}
 | 
					{%- macro render_pagination(pagination) %}
 | 
				
			||||||
  <div class="pagination">
 | 
					 | 
				
			||||||
    {% if pagination.has_prev -%}
 | 
					 | 
				
			||||||
      <a href="{{ pagination.prev|url }}">« Previous</a>
 | 
					 | 
				
			||||||
    {% else -%}
 | 
					 | 
				
			||||||
      <a class="disabled">« 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 »</a>
 | 
					 | 
				
			||||||
    {%- else -%}
 | 
					 | 
				
			||||||
      <a class="disabled">Next »</a>
 | 
					 | 
				
			||||||
    {%- endif %}
 | 
					 | 
				
			||||||
  </div>
 | 
					 | 
				
			||||||
{% endmacro -%}
 | 
					{% endmacro -%}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 %}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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 %}
 | 
				
			||||||
		Loading…
	
		Reference in New Issue