{{ partial "header.html" . }}

{{ partial "navbar.html" . }}

{{ $eventdate := time (.Param "eventdate") }}
{{ $eventdate = $eventdate.Format "Monday, January 2, 2006" }}
{{ $eventorganizer := .Param "prereg.organizer" }}
{{ $eventcode := .Param "prereg.event" }}
{{ $eventsched := .Param "pretalx" }}

<main id="main">

<section id="page" class="section-bg">
	<div class="container-fluid">
		<div class="section-header">
			<h1 class="section-title">{{ .Title }}</h1>
			<h3 class="section-description">{{ $eventdate }} @ {{ .Param "eventlocation" }}</h3>
			<span class="section-divider"></span>
		</div>
		{{ if .Param "image" }}
		<div class="row">
			<div class="col-lg-12 text-center content wow fadeInTop"><p>
				{{ $imagefilename := .Param "image.file" }}
				{{ $imagesize := .Param "image.size" }}
				{{ $imagelocation := printf "%s/%s" "img" $imagefilename }}
				{{ $imageresource := resources.Get $imagelocation }}
				{{ if $imageresource }}
					{{ $imagefile := $imageresource }}
					{{ if $imagesize }}
						{{ $imagefile = $imageresource.Resize $imagesize }}
					{{ else }}
						{{ $imagefile = $imageresource.Resize "1000x250" }}
					{{ end }}
					<figure>
						<img src="{{ $imagefile.RelPermalink }}">
					</figure>
				{{ end }}
			</p></div>
		</div>
		{{ end }}
		<div class="row">
			<div class="col-lg-6 content wow fadeInRight">{{ .Content }}</div>
			<div class="col-lg-6 content wow fadeInLeft">
			{{ if and $eventorganizer $eventcode }}
				<div id="registration">
					<link rel="stylesheet" type="text/css" href="https://registration.openpower.foundation/{{ $eventorganizer }}/{{ $eventcode }}/widget/v1.css">
					<div class="pretix-widget-compat" event="https://registration.openpower.foundation/{{ $eventorganizer }}/{{ $eventcode }}/"></div>
					<noscript><div class="pretix-widget"><div class="pretix-widget-info-message">
						JavaScript is disabled in your browser. To access our ticket shop without JavaScript, please <a target="_blank" rel="noopener" href="https://registration.openpower.foundation/{{ $eventorganizer }}/{{ $eventcode }}/">click here</a>
					</div></div></noscript>
					<a href="https://registration.openpower.foundation/{{ $eventorganizer }}/{{ $eventcode }}/">External Direct Registration Link <i class="external link alternate icon"></i></a>
				</div>
			{{ else }}
				&nbsp;
			{{ end }}
			</div>
		</div>
		{{ if $eventsched }}
		<div class="row">
			<div class="col-lg-12 content wow fadeInBottom">
				<div id="schedule">
					<script src="https://cfp.openpower.foundation/{{ $eventsched }}/schedule/widget/v2.en.js" type="text/javascript" async></script>
					<pretalx-schedule event-url="https://cfp.openpower.foundation/{{ $eventsched }}/" locale="en" format="grid" style="--pretalx-clr-primary: #3aa57c"></pretalx-schedule>
					<noscript><div class="pretalx-widget"><div class="pretalx-widget-info-message">
						JavaScript is disabled in your browser. To access our schedule without JavaScript, please <a target="_blank" href="https://cfp.openpower.foundation/{{ $eventsched }}/schedule/">click here</a>.
					</div></div></noscript>
					<a href="https://cfp.openpower.foundation/{{ $eventsched }}/schedule/">External Direct Schedule Link <i class="external link alternate icon"></i></a>
				</div>
		</div>
		{{ end }}
	</div>
</section>

</main>

{{ partial "footer.html" . }}
