aboutsummaryrefslogtreecommitdiff
path: root/themes/alps/calendar.html
blob: 5bdd6eb8a9bbc923bf76dd094da4c0e980f612bd (plain) (blame)
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
{{template "head.html" .}}
{{template "nav.html" .}}

<div class="page-wrap">
  <aside>
    <a href="/calendar/create" class="new">New event</a>
    <!-- TODO: fetch list of address books -->
    <a href="#" class="active">{{.Calendar.Name}}</a>
    <a href="#">Personal</a>
  </aside>

  <div class="container">
    <main class="calendar">
      <section class="actions">
        {{ template "calendar-header.html" . }}
      </section>

      <section class="dates">
        <h4 class="weekday sunday-top">Sunday</h4>
        <h4 class="weekday monday-top">Monday</h4>
        <h4 class="weekday tuesday-top">Tuesday</h4>
        <h4 class="weekday wednesday-top">Wednesday</h4>
        <h4 class="weekday thursday-top">Thursday</h4>
        <h4 class="weekday friday-top">Friday</h4>
        <h4 class="weekday saturday-top">Saturday</h4>

        {{$base := .}}
        {{range .Dates}}
        <div class="date
          {{if ne $base.Time.Month .Month}}extra{{end}}
          {{if and (eq $base.Now.Month .Month) (eq $base.Now.Day .Day)}}active{{end}}
          ">
          {{if eq $base.Time.Month .Month}}
            <a href="#" class="date-link"></a>
          {{end}}
          <div class="events">
            {{$events := (call $base.EventsForDate .)}}
            {{if $events}}
            <ul>
              {{$overflow := 0}}
              {{if gt (len $events) 3}}
              {{$overflow = call $base.Sub (len $events) 3}}
              {{$events = slice $events 0 3}}
              {{end}}

              {{range $events}}
              {{$event := index .Data.Events 0}}
              <li>
                <span class="start-time">
                  {{($event.DateTimeStart nil).Format "15:04"}}
                </span>
                {{$event.Props.Text "SUMMARY"}}
              </li>
              {{end}}
              {{if ne $overflow 0}}
              <li class="overflow">...and {{$overflow}} more</li>
              {{end}}
            </ul>
            {{end}}
          </div>
          <h4>
            <span class="mo">{{.Format "Jan"}}</span>
            <span class="da">{{.Format "2"}}{{call $base.DaySuffix .Day}}</span>
          </h4>
        </div>
        {{end}}

        <h4 class="weekday sunday-bottom">Sunday</h4>
        <h4 class="weekday monday-bottom">Monday</h4>
        <h4 class="weekday tuesday-bottom">Tuesday</h4>
        <h4 class="weekday wednesday-bottom">Wednesday</h4>
        <h4 class="weekday thursday-bottom">Thursday</h4>
        <h4 class="weekday friday-bottom">Friday</h4>
        <h4 class="weekday saturday-bottom">Saturday</h4>
      </section>

      <section class="actions">
        {{ template "calendar-header.html" . }}
      </section>
    </main>
  </div>
</div>

{{template "foot.html"}}