blog/root/events/view.gohtml

103 lines
4.2 KiB
Plaintext
Raw Normal View History

{{ define "title" }}{{ .Data.event.Title }}{{ end }}
{{ define "content" }}
{{ with .Data.event }}
<h1>{{ .Title }}</h1>
<div class="row mb-4">
<div class="col-12 col-md-8">
{{ TrustedMarkdown .Description }}
</div>
<div class="col-12 col-md-4">
{{ if .Location }}
<h4>Location</h4>
<address class="mb-4"><a href="https://maps.google.com/?q={{ NewlinesToSpace .Location }}" target="_blank">{{ .Location }}</a></address>
{{ end }}
<h4>Time</h4>
<abbr title="{{ .StartTime.Format "Mon Jan 2 15:04:05 2006" }}">
{{ .StartTime.Format "January 2 @ 3:04 PM" }}
</abbr>
{{ if not .EndTime.IsZero }}
to<br>
<abbr title="{{ .EndTime.Format "Mon Jan 2 15:04:05 2006" }}">
{{ if .AllDay }}
{{ .EndTime.Format "January 2" }}
{{ else }}
{{ .EndTime.Format "January 2 @ 3:04 PM" }}
{{ end }}
</abbr>
{{ end }}
<h4 class="mt-4">Invited</h4>
2018-05-12 03:15:16 +00:00
<div style="max-height: 500px; overflow: auto">
<ul class="list-group">
{{ range .RSVP }}
<li class="list-group-item
{{ if eq .Status "invited" }}bg-light
{{ else if eq .Status "going"}}bg-success text-light
{{ else if eq .Status "not going"}}bg-danger text-light
{{ else if eq .Status "maybe"}}bg-warning text-light{{ end }}">
{{ if .Contact }}
<strong>{{ .Contact.Name }}</strong>
{{ else }}
<strong>{{ .Name }}</strong>
{{ end }}
<br>
{{ .Status }}
{{ if and $.LoggedIn $.CurrentUser.Admin }}
{{ if not .Notified }}
<span class="badge badge-warning">not notified</span>
{{ end }}
<ul class="list-inline">
{{ if .Contact }}
{{ if .Contact.Email }}
<li class="list-inline-item text-muted">
<a href="mailto:{{ .Contact.Email }}">{{ .Contact.Email }}</a>
</li>
{{ end }}
{{ if .Contact.SMS }}
<li class="list-inline-item text-muted">
<a href="tel:{{ .Contact.SMS }}">{{ .Contact.SMS }}</a>
</li>
{{ end }}
{{ else }}
{{ if .Email }}
<li class="list-inline-item text-muted">
<a href="mailto:{{ .Email }}">{{ .Email }}</a>
</li>
{{ end }}
{{ if .SMS }}
<li class="list-inline-item text-muted">
<a href="tel:{{ .SMS }}">{{ .SMS }}</a>
</li>
{{ end }}
{{ end }}
</ul>
{{ end }}
</li>
{{ end }}
</ul>
</div>
</div>
</div>
{{ end }}
{{ if and .LoggedIn .CurrentUser.Admin }}
<div class="alert alert-danger">
<a href="/e/admin/edit?id={{ .Data.event.ID }}"
class="btn btn-primary">edit event</a>
2018-05-01 00:50:39 +00:00
<a href="/e/admin/invite/{{ .Data.event.ID }}"
class="btn btn-success">invite people</a>
</div>
{{ end }}
<h2 id="comments" class="mt-4">Comments</h2>
{{ $idStr := printf "%d" .Data.event.ID }}
{{ RenderComments .Request .Data.event.Title "event" $idStr }}
{{ end }}