aboutsummaryrefslogtreecommitdiff
path: root/views/list.html
blob: c85e147eecd874430fedf29999a5fc19096482f0 (plain)
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
{{ define "list" }}
{{ $list := .list }}
{{ $user := .user }}
<html>
	<head>
		{{ template "materialize" }}
		<title>grilist</title>
		<link rel="stylesheet" href="/assets/css/list.css" />
		<link rel="stylesheet" href="/assets/css/search.css" />
		<script src="/assets/js/search.js"></script>
		<script src="/assets/js/list.js"></script>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
	</head>
	<body>
		{{ template "navbar" . }}
		<div class="container">
			<h1>{{ $list.Name }}<small>von <a href="/user/{{ $list.Owner.ID }}/{{ $list.Owner.GetName}}">{{ $list.Owner.GetName }}</a></small></h1>
			<blockquote>{{ $list.Description }}</blockquote><br />
			<div class="row">
				<div class="col s12 {{ if ($user) and eq $user.ID $list.Owner.ID }}l8{{ end }}">
					<ul id="gril-list" class="gril-list">
					{{ range $index, $lg := $list.Grils }}
						{{ if $user }}
							{{ template "list_gril" makeRangePair $index (makeObject "Gril" $lg "IsListOwner" (eq $user.ID $list.Owner.ID)) }}
						{{ else }}
							{{ template "list_gril" makeRangePair $index (makeObject "Gril" $lg "IsListOwner" false) }}
						{{ end }}
					{{ end }}
					</ul>
				</div>
				{{ if $user}}
					{{ if eq $user.ID $list.Owner.ID }}
					<div class="col s12 l4">
						<div class="card-panel" style="margin-top: 14px">
							<span style="font-size: 130%">Gril hinzufügen</span><br />
							<form>
								<div class="input-field">
									<input id="search" type="search" onKeyDown="instantSearch()" required>
									<label for="search"><i class="material-icons">search</i></label>
									<i class="material-icons">close</i>
								</div>
							</form>
						</div>
						<div class="col s10 offset-s1">
							<ul class="collection search-results" id="search-results">
							</ul>
						</div>
					</div>
					{{ end }}
				{{ end }}
			</div>
		</div>
	</body>
</html>
{{ end }}