Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit 7942a8c

Browse files
authored
Clean up events page (#290)
Made events page look pretty. Could still use some improvements but it’s good enough. Signed-off-by: Matt Stratton <matt.stratton@gmail.com>
1 parent c1acb93 commit 7942a8c

5 files changed

Lines changed: 80 additions & 12 deletions

File tree

layouts/events/single.html

Lines changed: 56 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,65 @@
11
{{ define "main" }}
22

3-
{{/* site data query copypasta */}}
4-
{{ $path := split $.Source.File.Path .Site.Params.PathSeparator }}
5-
{{ $event_slug := index $path 1 }}
6-
{{ $e := (index $.Site.Data.events $event_slug) }}
7-
{{/* end site data query */}}
8-
93
<div>
104
{{ .Content }}
115
</div>
126

13-
{{ partial "future.html" . }}
7+
<div class = "row">
8+
<div class = "col-md-12">
9+
<h2>Future</h2>
10+
</div>
11+
</div>
12+
13+
<div class = "row">
14+
{{ $.Scratch.Set "close-tag" "false" }}
15+
{{- range sort $.Site.Data.events "startdate" -}}
16+
{{- if .startdate -}}
17+
{{- if ge (dateFormat "2006-01-02" .enddate) (dateFormat "2006-01-02" ($.Now.Format "2006-01-02")) -}}
18+
{{- if ne ($.Scratch.Get "year") (dateFormat "2006" .startdate) -}}
19+
{{- $.Scratch.Set "year" (dateFormat "2006" .startdate) -}}
20+
{{- $.Scratch.Set "year-displayed" "false" -}}
21+
{{- end -}}
22+
{{- if ne ($.Scratch.Get "month") (dateFormat "January" .startdate ) -}}
23+
{{- $.Scratch.Set "month" (dateFormat "January" .startdate ) -}}
24+
{{- $.Scratch.Set "month-displayed" "false" -}}
25+
{{- end -}}
26+
27+
28+
{{- if ne ($.Scratch.Get "month-displayed") "true" -}}
29+
{{- if eq ($.Scratch.Get "close-tag") "true"}}
30+
</div>
31+
{{ end }}
32+
<div class = "col-md-6 col-lg-3 events-page-col">
33+
<h4 class="events-page-months">{{ dateFormat "January" .startdate }}</h4>
34+
{{- $.Scratch.Set "month-displayed" "true" -}}
35+
{{ $.Scratch.Set "close-tag" "true" }}
36+
{{- end -}}
37+
{{- if ne .startdate .enddate }}
38+
<a href = "/events/{{ .name }}/" class = "events-page-event">
39+
{{ dateFormat "Jan 2" .startdate }} - {{ dateFormat "Jan 2" .enddate }}
40+
{{ .city }}
41+
</a><br />
42+
{{- else -}}
43+
<a href = "/events/{{ .name }}/" class = "events-page-event">
44+
{{ dateFormat "Jan 2" .startdate }}
45+
{{ .city }}
46+
</a><br />
47+
{{- end -}}
48+
{{- end -}}
49+
{{- end -}}
50+
{{- end -}}
51+
</div>
52+
<div class = "col-md-6 col-lg-3 events-page-col">
53+
<h4 class="events-page-months">TBD</h4>
54+
{{- range $.Site.Data.events -}}
55+
{{- if not .startdate -}}
56+
<a href = "/events/{{ .name }}/" class = "events-page-event">{{ .city }}</a><br />
57+
{{- end -}}
58+
{{- end -}}
59+
</div>
60+
</div>
61+
62+
1463
{{ partial "past.html" . }}
1564

1665
{{ end }}

layouts/partials/past.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ <h2>Past</h2>
2727
<div class = "row">
2828
<!-- Now scan through all the years that were marked as active in order to print the headline -->
2929
{{ range ($.Scratch.GetSortedMapValues "active_years") }}
30-
<div class = "col-md-4">
31-
<strong>{{ . }}</strong>
30+
<div class = "col-md-6 col-lg-3 events-page-col">
31+
<h4 class="events-page-months">{{ . }}</h4>
3232
<br/>
3333
<!-- Finally, scan throug the scratch with the ID of that year and print all the events sorted by startdate
3434
Chomping here in order to convert int to string -->
3535
{{ range ($.Scratch.GetSortedMapValues (print (chomp .))) }}
3636
{{ $.Scratch.Set "citydisplay" (index $.Site.Data.events . "city") }}
3737
{{ $friendly := (index $.Site.Data.events . "name") }}
38-
<a href="/events/{{ $friendly }}/">{{ $.Scratch.Get "citydisplay" }}</a>
38+
<a href="/events/{{ $friendly }}/" class = "events-page-event">{{ $.Scratch.Get "citydisplay" }}</a>
3939
<br/>
4040
{{ end }}
4141
</div>

static/css/site.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/css/site.css.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/scss/custom.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,3 +476,22 @@ a:hover.welcome-page-masthead-link {
476476
.organizer-card {
477477
padding-bottom: 20px;
478478
}
479+
480+
.events-page-col {
481+
padding: 30px;
482+
}
483+
484+
.events-page-months {
485+
font-family: 'Roboto', sans-serif;
486+
font-weight: 300;
487+
font-size: 14pt;
488+
text-transform: uppercase;
489+
color: #000000;
490+
}
491+
492+
.events-page-event {
493+
font-family: 'Roboto', sans-serif;
494+
font-weight: 100;
495+
font-size: 11pt;
496+
text-transform: capitalize;
497+
}

0 commit comments

Comments
 (0)