This repository was archived by the owner on Jul 21, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathsingle.html
More file actions
117 lines (113 loc) · 4.26 KB
/
single.html
File metadata and controls
117 lines (113 loc) · 4.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{{ define "main" }}
<div>
{{ .Content }}
</div>
<div class = "row">
<div class = "col-md-12">
<h2>Future</h2>
</div>
</div>
<div class = "row">
{{- $.Scratch.Set "close-tag" "false" -}}
{{- range sort $.Site.Data.events "startdate" -}}
{{- if .startdate -}}
{{- if ge (time .enddate) now -}}
{{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year-displayed" "false" -}}
{{- end -}}
{{- if ne ($.Scratch.Get "month") (dateFormat "January 2006" .startdate ) -}}
{{- $.Scratch.Set "month" (dateFormat "January 2006" .startdate ) -}}
{{- $.Scratch.Set "month-displayed" "false" -}}
{{- end -}}
{{- if ne ($.Scratch.Get "month-displayed") "true" -}}
{{- if eq ($.Scratch.Get "close-tag") "true"}}
</div>
{{- end -}}
<div class = "col-md-6 col-lg-3 events-page-col">
<h4 class="events-page-months">{{ dateFormat "January 2006" .startdate }}</h4>
{{- $.Scratch.Set "month-displayed" "true" -}}
{{- $.Scratch.Set "close-tag" "true" -}}
{{- end -}}
{{- if ne .startdate .enddate }}
{{- if eq (time .startdate).Month (time .enddate).Month -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "2" .enddate }}:
{{ .city }}
</a><br />
{{- else -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "Jan 2" .enddate }}:
{{ .city }}
</a><br />
{{- end -}}
{{- else -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }}:
{{ .city }}
</a><br />
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</div>
<div class = "col-md-6 col-lg-3 events-page-col">
<h4 class="events-page-months">TBD</h4>
{{- range $.Site.Data.events -}}
{{- if not .startdate -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">{{ .city }}</a><br />
{{- end -}}
{{- end -}}
</div>
</div>
<div class = "row">
<div class = "col-md-12">
<h2>Past</h2>
</div>
</div>
{{- range sort $.Site.Data.events "startdate" "desc" -}}
{{- if .startdate -}}
{{- if le (time .enddate) now -}}
{{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year-displayed" "false" -}}
{{- end -}}
{{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}}
{{- $.Scratch.Set "year-displayed" "false" -}}
{{- end -}}
{{- if ne ($.Scratch.Get "month") (dateFormat "January 2006" .startdate ) -}}
{{- $.Scratch.Set "month" (dateFormat "January 2006" .startdate ) -}}
{{- $.Scratch.Set "month-displayed" "false" -}}
{{- end -}}
{{- if ne ($.Scratch.Get "month-displayed") "true" -}}
{{- if eq ($.Scratch.Get "close-tag") "true"}}
</div>
{{- end -}}
<div class = "col-md-6 col-lg-3 events-page-col">
<h4 class="events-page-months">{{ dateFormat "January 2006" .startdate }}</h4>
{{- $.Scratch.Set "month-displayed" "true" -}}
{{- $.Scratch.Set "close-tag" "true" -}}
{{- end -}}
{{- if ne .startdate .enddate }}
{{- if eq (time .startdate).Month (time .enddate).Month -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "2" .enddate }}:
{{ .city }}
</a><br />
{{- else -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "Jan 2" .enddate }}:
{{ .city }}
</a><br />
{{- end -}}
{{- else -}}
<a href = "{{ (printf "events/%s" .name) | absURL }}" class = "events-page-event">
{{ dateFormat "Jan 2" .startdate }}:
{{ .city }}
</a><br />
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ end }}