This repository has been 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
/
single.html
154 lines (148 loc) · 7.27 KB
/
single.html
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{{ define "main" }}
<h2>Program</h2>
{{ .Content }}
{{- $.Scratch.Set "first" "true" -}}
{{- $e := (index $.Site.Data.events (index (split (.Permalink | relURL) "/") 2)) -}}
{{- if $e.startdate -}}
{{- range where $.Site.Pages "Type" "talk" -}}
{{/* {{- $talk_path := split .File.Path .Site.Params.PathSeparator -}} */}}
{{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}}
{{- $.Scratch.Set "base_file_name" .File.BaseFileName -}}
{{- $.Scratch.Set .File.BaseFileName .Title -}}
{{- if isset .Params "speakers" -}}
{{- if ne .Params.speakers "" -}}
{{- $.Scratch.Set "speaker_len" (.Params.speakers | len) -}}
{{- $.Scratch.Set "speaker_count" 0 -}}
{{- end -}}
{{- end -}}
{{- range .Params.speakers -}}
{{- $.Scratch.Set "speaker_count" (add ($.Scratch.Get "speaker_count") 1) -}}
{{- $.Scratch.Set "speakername" . -}}
{{- range where $.Site.Pages "Type" "speaker" -}}
{{- if eq (index (split (.Permalink | relURL) "/") 2) $e.name -}}
{{- if eq .File.BaseFileName ($.Scratch.Get "speakername") -}}
{{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) .Title -}}
{{- if ne ($.Scratch.Get "speaker_count") ($.Scratch.Get "speaker_len") -}}
{{- $.Scratch.Add (printf "%s-speaker" ($.Scratch.Get "base_file_name")) ", " -}}
{{- end -}}
{{- end -}}
{{- end -}}
<!-- end if eq $speaker_slug $e.name -->
{{- end -}}
<!-- end range where $.Site.Pages "Type" "speaker" -->
{{- end -}}
<!-- end ranging over speakers -->
{{- end -}}
<!-- end if eq $talk_slug $e.name -->
{{- end -}}
<!-- end range where $.Site.Pages "Type" "speaker" -->
<!-- Get the dates for the program -->
{{- with $e -}}
{{- range .program -}}
{{- $.Scratch.SetInMap "dates" .date .date -}}
{{- end -}}
{{- end -}}
<!-- new experimental program end -->
<div class="row">
<div class="col">
<div id="accordion" role="tablist" aria-multiselectable="true">
{{- range ($.Scratch.GetSortedMapValues "dates") -}}
{{- $.Scratch.Set "date" . -}}
{{- with $e -}}
{{- if .program -}}
<div class="card">
<div class="card-header" role="tab" id="{{printf "headingOne-%s" ($.Scratch.Get "date") }}">
<h5 class="mb-0">
{{- dateFormat "January 2, 2006" ($.Scratch.Get "date") -}}
</a>
</h5>
</div>
<div id="{{printf "#collapse-%s" ($.Scratch.Get "date") }}" class="collapse show" role="tabpanel" aria-labelledby="{{printf "headingOne-%s" ($.Scratch.Get "date") }}">
<div class="card-block">
<div class="row">
<div class="col-lg-6">
{{- $program := (where .program "date" ($.Scratch.Get "date")) -}}
{{- $program_len := (len $program) -}}
{{- $.Scratch.Set "program_len" $program_len -}}
{{- $.Scratch.Set "program_counter" 0 -}}
{{- range where .program "date" ($.Scratch.Get "date") -}}
{{- $.Scratch.Set "program_counter" (add ($.Scratch.Get "program_counter") 1) -}}
<div class = "row program-row">
<div class="col-lg-3 col-md-3 program-element {{ printf "program-%s" .type }}" {{ if .background_color }}style="background-color: {{ .background_color }}"{{end}}>
{{ .start_time }}
-
{{ .end_time }}
</div>
<div class="col-lg-8 col-md-6 program-element {{ printf "program-%s" .type }}" {{ if .background_color }}style="background-color: {{ .background_color }}"{{end}}>
{{- if eq .type "custom" -}}
{{ .title }}<br/>
{{- if .comments -}}
<span class="program-page-desc">{{ .comments | markdownify }}<br/></span>
{{- end -}}
{{- else if or (eq .type "talk") (eq .type "workshop") -}}
<a href="{{ (printf "events/%s/program/%s" $e.name .title) | absURL }}">
{{ $.Scratch.Get (printf "%s-speaker" .title) }}
-
{{ $.Scratch.Get .title }}
</a><br/>
{{- if .comments -}}
<span class="program-page-desc">{{ .comments | markdownify }}<br/></span>
{{- end -}}
{{- else if eq .type "ignite" -}}
{{ .title }}
<!-- do ignite stuff here -->
{{- with $e -}}
{{- if .ignites -}}
{{- $ignites := (where $e.ignites "date" ($.Scratch.Get "date")) -}}
{{- $ignites_len := (len $ignites) -}}
{{- if ge $ignites_len 1 -}}
<ul class="list-unstyled">
{{- range where $e.ignites "date" ($.Scratch.Get "date") -}}
{{- if ($.Scratch.Get .title) -}}
<li>
<a href="/events/{{ $e.name}}/program/{{ .title }}">{{ $.Scratch.Get (printf "%s-speaker" .title) }}
-
{{ $.Scratch.Get .title }}</a>
</li>
{{- else -}}
<li>
{{.title}}
</li>
{{- end -}}
{{- end -}}
</ul>
{{- end -}}
{{- end -}}
{{- end -}}
<!-- end ignite stuff here -->
<!-- do open-space stuff here -->
{{- else if (eq .type "open-space") -}}
<a href="{{ "open-space-format/" | absURL }}">
{{ .title }}
</a><br/>
{{- else -}}
{{ .title }}
{{- end -}}
</div>
</div>
{{- if eq (div ($.Scratch.Get "program_len") 2) ($.Scratch.Get "program_counter") -}}
</div>
<div class="col-lg-6">
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
</div>
</div>
</div>
</div>
</div>
{{- end -}}
</div>
</div>
</div>
<!--end row-->
</div>
</div>
{{- end -}}
{{ end }}