aboutsummaryrefslogtreecommitdiff
path: root/views/includes
diff options
context:
space:
mode:
authorrtz12 <koenig@fagott.pw>2016-01-17 20:31:26 (UTC)
committerrtz12 <koenig@fagott.pw>2016-01-17 20:31:26 (UTC)
commit6cb2de0a1f583ef8d018e430181a7414fa7faff1 (patch)
treee2c60cc9ae28ef98bcc410e54b99a613b7267831 /views/includes
parentb868b32d348e6350225560b71c8712c2e932b063 (diff)
Ordnung in die Templates gebracht
Diffstat (limited to 'views/includes')
-rw-r--r--views/includes/card.html20
-rw-r--r--views/includes/instant_search_results.html8
-rw-r--r--views/includes/list_gril.html38
-rw-r--r--views/includes/materialize.html6
-rw-r--r--views/includes/navbar.html17
5 files changed, 89 insertions, 0 deletions
diff --git a/views/includes/card.html b/views/includes/card.html
new file mode 100644
index 0000000..be28272
--- /dev/null
+++ b/views/includes/card.html
@@ -0,0 +1,20 @@
1{{ define "card" }}
2{{ $card := . }}
3<div class="col s12 m6 l4">
4 <div class="card white">
5 <div class="card-content black-text">
6 <span class="card-title">{{ $card.Title | html }}</span>
7 <p>{{ $card.Description | html }}</p>
8 </div>
9 <div class="card-action">
10 {{ range $action := $card.Actions }}
11 {{ if $action.Disabled }}
12 <span>{{ $action.Name | html }}</span>
13 {{ else }}
14 <a href="{{ $action.Link }}">{{ $action.Name | html }}</a>
15 {{ end }}
16 {{ end }}
17 </div>
18 </div>
19</div>
20{{ end }}
diff --git a/views/includes/instant_search_results.html b/views/includes/instant_search_results.html
new file mode 100644
index 0000000..0dd445c
--- /dev/null
+++ b/views/includes/instant_search_results.html
@@ -0,0 +1,8 @@
1{{ define "instant_search_results" }}
2{{ range .results }}
3<li class="collection-item search-result avatar hoverable valign-wrapper" onClick="clickSearchResult({{ .ID }})" >
4 <img src="/{{ .ImagePath }}" alt="" class="circle">
5 <span class="title valign">{ {{ .Name }} }</span>
6</li>
7{{ end }}
8{{ end }} \ No newline at end of file
diff --git a/views/includes/list_gril.html b/views/includes/list_gril.html
new file mode 100644
index 0000000..f719dae
--- /dev/null
+++ b/views/includes/list_gril.html
@@ -0,0 +1,38 @@
1{{ define "list_gril" }}
2<li id="{{ .Index }}">
3 <div class="card-panel hoverable list-entry">
4 <div class="row valign-wrapper">
5 <div class="col s3 m2 {{ if not .Value.IsListOwner }}offset-s1 offset-m1{{ end }}">
6 <div class="circle gril-img" style="background-image: url(/{{ .Value.Gril.Gril.ImagePath true }})"> </div>
7 </div>
8 <div class="col {{ if .Value.IsListOwner }}s6 m3{{ else }}s8 m9{{ end }}">
9 <span><a href="/gril/{{ .Value.Gril.Gril.Slug }}">{{ .Value.Gril.Gril.RomajiName }}</a><br />
10 <span class="jap-name truncate">{{ .Value.Gril.Gril.KanjiName }}</span>
11 </span>
12 </div>
13 {{ if .Value.IsListOwner }}
14 <div class="col s3 m5">
15 <div class="hide-on-med-and-up">
16 <div class="row list-controls valign-wrapper">
17 <div class="col s6 left-align">
18 <i class="material-icons grey-text" onClick="">keyboard_arrow_up</i>
19 <i class="material-icons grey-text" onClick="">keyboard_arrow_down</i>
20 </div>
21 <div class="col s4 left-align">
22 <i class="hide-on-med-and-up material-icons delete-icon grey-text" onClick="">delete</i>
23 </div>
24 </div>
25 </div>
26 <div class="hide-on-small-only">
27 <div class="valign-wrapper">
28 <i class="medium material-icons grey-text" onClick="">keyboard_arrow_up</i>
29 <i class="medium material-icons grey-text" onClick="">keyboard_arrow_down</i>
30 <i class="material-icons grey-text" onClick="">delete</i>
31 </div>
32 </div>
33 </div>
34 {{ end }}
35 </div>
36 </div>
37</li>
38{{ end }} \ No newline at end of file
diff --git a/views/includes/materialize.html b/views/includes/materialize.html
new file mode 100644
index 0000000..7c40c0d
--- /dev/null
+++ b/views/includes/materialize.html
@@ -0,0 +1,6 @@
1{{define "materialize"}}
2 <link rel="stylesheet" href="/assets/css/materialize.css">
3 <script src="/assets/js/materialize.min.js"></script>
4 <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
5 <meta name="viewport" content="width=device_width, initial-scale=1.0" />
6{{end}} \ No newline at end of file
diff --git a/views/includes/navbar.html b/views/includes/navbar.html
new file mode 100644
index 0000000..a0db664
--- /dev/null
+++ b/views/includes/navbar.html
@@ -0,0 +1,17 @@
1{{ define "navbar" }}
2 <nav>
3 <div class="nav-wrapper purple lighten-2">
4 <a href="/" class="brand-logo center">grilist</a>
5 <ul id="nav-mobile" class="right hide-on-med-and-down">
6 {{ if .user }}
7 <li><a href="/new/list">Liste erstellen</a></li>
8 <li><a href="/user/{{ .user.ID }}/{{ .user.GetName }}">{{ .user.GetName }}</a></li>
9 <li><a href="/logout">Ausloggen</a></li>
10 {{ else }}
11 <li><a href="/login">Einloggen</a></li>
12 <li><a href="/register">Registrieren</a></li>
13 {{ end }}
14 </ul>
15 </div>
16 </nav>
17{{ end }} \ No newline at end of file