2018-04-29 19:56:37 +00:00
|
|
|
{{ define "title" }}{{ .Data.event.Title }}{{ end }}
|
|
|
|
{{ define "content" }}
|
|
|
|
|
2018-05-12 04:29:18 +00:00
|
|
|
{{ $authedContact := .Data.authedContact }}
|
|
|
|
{{ $authedRSVP := .Data.authedRSVP }}
|
|
|
|
|
2018-04-29 19:56:37 +00:00
|
|
|
{{ with .Data.event }}
|
2018-05-12 04:29:18 +00:00
|
|
|
{{ if and $authedContact $authedRSVP.ID }}
|
|
|
|
<div class="row mb-4">
|
|
|
|
<div class="col-8">
|
|
|
|
<p>
|
|
|
|
<strong>{{ $authedContact.Name }}</strong>, you have been invited to...
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
<div class="col-4 text-right">
|
|
|
|
<form name="rsvpAnswerForm" action="/e/{{ .Fragment }}" method="POST">
|
|
|
|
<input type="hidden" name="_csrf" value="{{ $.CSRF }}">
|
|
|
|
<input type="hidden" name="action" value="answer-rsvp">
|
|
|
|
<div class="btn-group">
|
|
|
|
<button type="submit" name="submit" value="going" class="btn{{ if eq $authedRSVP.Status "going" }} btn-success{{ end }}">Going</button>
|
|
|
|
<button type="submit" name="submit" value="maybe" class="btn{{ if eq $authedRSVP.Status "maybe" }} btn-warning{{ end }}">Maybe</button>
|
|
|
|
<button type="submit" name="submit" value="not going" class="btn{{ if eq $authedRSVP.Status "not going" }} btn-danger{{ end }}">Not Going</button>
|
|
|
|
</div>
|
|
|
|
<p class="small">
|
|
|
|
[<a href="/c/logout?next={{ $.Request.URL.Path }}">not {{ $authedContact.Name }}?</a>]
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{ end }}
|
2018-04-29 19:56:37 +00:00
|
|
|
<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
|
2018-05-12 04:29:18 +00:00
|
|
|
{{ else if eq .Status "going"}}border-success
|
|
|
|
{{ else if eq .Status "not going"}}border-danger
|
|
|
|
{{ else if eq .Status "maybe"}}border-warning{{ end }}">
|
2018-05-12 03:15:16 +00:00
|
|
|
{{ 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 }}
|
2018-05-12 04:29:18 +00:00
|
|
|
<ul class="list-inline small">
|
2018-05-12 03:15:16 +00:00
|
|
|
{{ 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>
|
2018-04-29 19:56:37 +00:00
|
|
|
</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 }}"
|
2018-04-29 19:56:37 +00:00
|
|
|
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 }}
|