{{ $metas := dict "when" .context.Params.when "price" .context.Params.price "contact" .context.Params.contact "covid"
.context.Params.covid }}
{{ if eq .type "list" }}
    {{ $metas = dict "when" .context.Params.when "price" .context.Params.price }}
{{ end }}

{{ $pic := "solo" }}
{{ $text := "solo" }}

{{- if and (.context.Resources.ByType "image") (.context.Content) -}}
    {{ $pic = "multiple_small" }}
    {{ $text = "multiple_big" }}
{{ else if and (.context.Resources.ByType "image") (not (.context.Content)) }}
    {{ $pic = "multiple_medium" }}
{{ end }}

    {{ partial "snippets/article_metadata" $metas }}
    <div class="articleinner">
{{- if and (.context.Resources.ByType "image") (eq .pic "true") -}}
    {{ $resize := "500x" }}
    {{- $img := index (.context.Resources.ByType "image") 0 -}}
    {{- $thumb := index (.context.Resources.ByType "image") 0 -}}
    {{ if ne .context.Content "" }}
        {{- $resize = "2048x" }}
    {{ else if eq .type "list" }}
        {{- $resize = "500x" }}
    {{ end }}
    {{- $thumb = $img.Resize $resize }}
    <div class="articlepicture {{ $pic }}" >
        {{ if and (ne .type "list") (.context.Resources.ByType "image") }}<a href="{{- $img.Permalink -}}">{{ end }}
            <img src="{{- $thumb.Permalink -}}" class="borderrad4px" />
        {{ if and (ne .type "list") (.context.Resources.ByType "image") }}</a>{{ end }}
    </div>    
{{ end }}
        {{- if or .context.Content .context.Summary -}}
            <div class="articletext {{ $text }}">
                {{ if eq .type "list" }}{{- .context.Summary -}}{{ else }}{{- .context.Content -}}{{ end }}
                {{ if and .context.Truncated (eq .type "list") }}
                    <div class="readmore">{{- if i18n "readmore" -}}{{- i18n "readmore" -}}{{- else -}}{{- "readmore" -}}{{- end -}}..</div>
                {{ end }}
            </div>
        {{- end }}
    </div>

{{ define "pagefooter" }}
    {{ if and (eq .Kind "page") (or (eq .Section "news") (eq .Section "events") (eq .Section "about")) }}
		<div class="article_footer">
            {{ with .Params.foundations }}
                <b>Träger der Veranstaltung:</b>
                <div class="article_footer_foundations1">
                    {{ range . }}
                        {{ $l := . }}
                        {{ $url := "" }}
                        {{ if isset site.Params.foundations $l }}
                            {{ $url = index site.Params.foundations $l }}
                        {{ end }}
                        
                       
                        {{- $res_im := resources.GetMatch (printf "/foundations/%s*" $l ) -}}
                        {{ if $res_im }}
                            <div class="article_footer_item1">
                                {{ if $url }}<a href="{{ $url | safeHTML }}">{{ end }}<img src="{{- $res_im.Permalink -}}" class="borderrad4px article_footer_item1" /> {{ if $url }}</a>{{ end }}
                            </div>
                        {{ end }}
                    {{ end }}
                </div>
            {{ end }}
            <div class="article_footer_foundations2">
                <div class="article_footer_item2">
                    <b>{{ if i18n "created" }}{{ i18n "created" }}{{ else }}{{ "Created" }}{{ end }}</b>
                    {{ .Date | time.Format ":date_full" }}
                </div>
                {{ if ne .Date .Lastmod }}	
                    <div class="article_footer_item2">
                        <b>{{ if i18n "lastmod" }}{{ i18n "lastmod" }}{{ else }}{{ "Last modification" }}{{ end }}</b>
                        {{ .Lastmod | time.Format ":date_full" }}
                    </div>
                {{ end }}
            </div>
		</div>
    {{ end }}
{{ end }}


{{ define "sidebar" }}
    {{ if ne .Type "tools" }}
        {{- partial "snippets/menu" . }}
    {{ end }}
{{ end }}
