Refactor concert entry
This commit is contained in:
parent
bd59013800
commit
e162ace54b
3 changed files with 77 additions and 161 deletions
75
layouts/partials/events/entry.html
Normal file
75
layouts/partials/events/entry.html
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
<div class="concert-entry">
|
||||||
|
<p class="concert-date">
|
||||||
|
{{ $t := time.AsTime .context.Params.ConcertDate }}
|
||||||
|
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
||||||
|
{{ time.Format $format $t | humanize }}
|
||||||
|
</p>
|
||||||
|
<div class="concert-cover">
|
||||||
|
{{ with .context.Resources.GetMatch "cover.*" }}
|
||||||
|
<img
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
width="{{ .Width }}"
|
||||||
|
height="{{ .Height }}"
|
||||||
|
alt="Concert cover"
|
||||||
|
/>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<div class="concert-overview">
|
||||||
|
<h2><a href="{{ .RelPermalink }}">{{ .context.LinkTitle }}</a></h2>
|
||||||
|
<h3>{{ .context.Summary }}</h3>
|
||||||
|
<h4>{{ .context.Description }}</h4>
|
||||||
|
|
||||||
|
<img src="bar.png" class="separator" />
|
||||||
|
<div class="concert-buttons">
|
||||||
|
{{ if .tickets }}
|
||||||
|
<a class="concert-button" href="{{ .Params.TicketsLink }}">
|
||||||
|
<img src="billets.png" />
|
||||||
|
<span>Billets</span>
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
<a class="concert-button" href="{{ .RelPermalink }}">
|
||||||
|
<img src="info.png" />
|
||||||
|
<span>Infos</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="concert-entry-small">
|
||||||
|
<h4 class="concert-date">
|
||||||
|
{{ $t := time.AsTime .context.Params.ConcertDate }}
|
||||||
|
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
||||||
|
{{ time.Format $format $t | humanize }}
|
||||||
|
</h4>
|
||||||
|
<img src="bar.png" class="separator" />
|
||||||
|
<div class="concert-entry-container">
|
||||||
|
<div class="concert-cover">
|
||||||
|
{{ with .context.Resources.GetMatch "cover.*" }}
|
||||||
|
<img
|
||||||
|
src="{{ .RelPermalink }}"
|
||||||
|
width="{{ .Width }}"
|
||||||
|
height="{{ .Height }}"
|
||||||
|
alt="Concert cover"
|
||||||
|
/>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
<div class="concert-overview">
|
||||||
|
<a href="{{ .RelPermalink }}"><h3>{{ .context.LinkTitle }}</h3></a>
|
||||||
|
<h4>{{ .context.Description }}</h4>
|
||||||
|
<p>{{ .context.Summary }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<img src="bar.png" class="separator" />
|
||||||
|
<div class="concert-buttons">
|
||||||
|
{{ if .tickets }}
|
||||||
|
<a class="concert-button" href="{{ .Params.TicketsLink }}">
|
||||||
|
<img src="billets.png" />
|
||||||
|
<span>Billets</span>
|
||||||
|
</a>
|
||||||
|
{{ end }}
|
||||||
|
<a class="concert-button" href="{{ .RelPermalink }}">
|
||||||
|
<img src="info.png" />
|
||||||
|
<span>Infos</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -6,83 +6,7 @@
|
||||||
{{ $currentTime := (time now) }}
|
{{ $currentTime := (time now) }}
|
||||||
{{ $delta := $currentTime.Sub (time .Params.ConcertDate ) }}
|
{{ $delta := $currentTime.Sub (time .Params.ConcertDate ) }}
|
||||||
{{ if gt $delta 0 }}
|
{{ if gt $delta 0 }}
|
||||||
<div class="concert-entry">
|
{{ partial "events/entry.html" (dict "context" . "tickets" false) }}
|
||||||
<p class="concert-date">
|
|
||||||
{{ $t := time.AsTime .Params.ConcertDate }}
|
|
||||||
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
|
||||||
{{ time.Format $format $t | humanize }}
|
|
||||||
</p>
|
|
||||||
<div class="concert-cover">
|
|
||||||
{{ with .Resources.GetMatch "cover.*" }}
|
|
||||||
<img
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
alt="Concert cover"
|
|
||||||
/>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="concert-overview">
|
|
||||||
<h2>
|
|
||||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
|
||||||
</h2>
|
|
||||||
<h3>{{ .Summary }}</h3>
|
|
||||||
<h4>{{ .Description }}</h4>
|
|
||||||
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-buttons">
|
|
||||||
<a
|
|
||||||
class="concert-button"
|
|
||||||
href="{{ .RelPermalink }}"
|
|
||||||
>
|
|
||||||
<img src="info.png" />
|
|
||||||
<span>Infos</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="concert-entry-small">
|
|
||||||
<h4 class="concert-date">
|
|
||||||
{{ $t := time.AsTime .Params.ConcertDate }}
|
|
||||||
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
|
||||||
{{ time.Format $format $t | humanize }}
|
|
||||||
</h4>
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-entry-container">
|
|
||||||
<div class="concert-cover">
|
|
||||||
{{ with .Resources.GetMatch "cover.*" }}
|
|
||||||
<img
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
alt="Concert cover"
|
|
||||||
/>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="concert-overview">
|
|
||||||
<a href="{{ .RelPermalink }}"
|
|
||||||
><h3>{{ .LinkTitle }}</h3></a
|
|
||||||
>
|
|
||||||
<h4>{{ .Description }}</h4>
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-buttons">
|
|
||||||
<a
|
|
||||||
class="concert-button"
|
|
||||||
href="{{ .Params.TicketsLink }}"
|
|
||||||
>
|
|
||||||
<img src="billets.png" />
|
|
||||||
<span>Billets</span>
|
|
||||||
</a>
|
|
||||||
<a class="concert-button" href="{{ .RelPermalink }}">
|
|
||||||
<img src="info.png" />
|
|
||||||
<span>Infos</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -6,90 +6,7 @@
|
||||||
{{ $currentTime := (time now) }}
|
{{ $currentTime := (time now) }}
|
||||||
{{ $delta := $currentTime.Sub (time .Params.ConcertDate ) }}
|
{{ $delta := $currentTime.Sub (time .Params.ConcertDate ) }}
|
||||||
{{ if lt $delta 0 }}
|
{{ if lt $delta 0 }}
|
||||||
<div class="concert-entry">
|
{{ partial "events/entry.html" (dict "context" . "tickets" true) }}
|
||||||
<p class="concert-date">
|
|
||||||
{{ $t := time.AsTime .Params.ConcertDate }}
|
|
||||||
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
|
||||||
{{ time.Format $format $t | humanize }}
|
|
||||||
</p>
|
|
||||||
<div class="concert-cover">
|
|
||||||
{{ with .Resources.GetMatch "cover.*" }}
|
|
||||||
<img
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
alt="Concert cover"
|
|
||||||
/>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="concert-overview">
|
|
||||||
<h2>
|
|
||||||
<a href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
|
||||||
</h2>
|
|
||||||
<h3>{{ .Summary }}</h3>
|
|
||||||
<h4>{{ .Description }}</h4>
|
|
||||||
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-buttons">
|
|
||||||
<a
|
|
||||||
class="concert-button"
|
|
||||||
href="{{ .Params.TicketsLink }}"
|
|
||||||
>
|
|
||||||
<img src="billets.png" />
|
|
||||||
<span>Billets</span>
|
|
||||||
</a>
|
|
||||||
<a
|
|
||||||
class="concert-button"
|
|
||||||
href="{{ .RelPermalink }}"
|
|
||||||
>
|
|
||||||
<img src="info.png" />
|
|
||||||
<span>Infos</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="concert-entry-small">
|
|
||||||
<h4 class="concert-date">
|
|
||||||
{{ $t := time.AsTime .Params.ConcertDate }}
|
|
||||||
{{ $format := "Monday 2 Jan 2006 15h04" }}
|
|
||||||
{{ time.Format $format $t | humanize }}
|
|
||||||
</h4>
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-entry-container">
|
|
||||||
<div class="concert-cover">
|
|
||||||
{{ with .Resources.GetMatch "cover.*" }}
|
|
||||||
<img
|
|
||||||
src="{{ .RelPermalink }}"
|
|
||||||
width="{{ .Width }}"
|
|
||||||
height="{{ .Height }}"
|
|
||||||
alt="Concert cover"
|
|
||||||
/>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
<div class="concert-overview">
|
|
||||||
<a href="{{ .RelPermalink }}"
|
|
||||||
><h3>{{ .LinkTitle }}</h3></a
|
|
||||||
>
|
|
||||||
<h4>{{ .Description }}</h4>
|
|
||||||
<p>{{ .Summary }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<img src="bar.png" class="separator" />
|
|
||||||
<div class="concert-buttons">
|
|
||||||
<a
|
|
||||||
class="concert-button"
|
|
||||||
href="{{ .Params.TicketsLink }}"
|
|
||||||
>
|
|
||||||
<img src="billets.png" />
|
|
||||||
<span>Billets</span>
|
|
||||||
</a>
|
|
||||||
<a class="concert-button" href="{{ .RelPermalink }}">
|
|
||||||
<img src="info.png" />
|
|
||||||
<span>Infos</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue