diff options
author | Jan C <jan@ruken.pw> | 2016-02-20 15:29:33 (UTC) |
---|---|---|
committer | Jan C <jan@ruken.pw> | 2016-02-20 15:29:33 (UTC) |
commit | 3e34dfa6ebbc0d70c4e704fd7f57dca25ecb8c63 (patch) | |
tree | 351d02b87d5f6c285b537a1e178b1528f6e5d3f4 /views | |
parent | 0d76691705dbbaa8b3972e09ed8df1e590b38da5 (diff) |
möglichkeit grils direkt über die gril view zu einer liste hinzuzufügen
Diffstat (limited to 'views')
-rw-r--r-- | views/includes/materialize.html | 1 | ||||
-rw-r--r-- | views/includes/materialize_js.html | 4 | ||||
-rw-r--r-- | views/pages/gril.html | 94 |
3 files changed, 60 insertions, 39 deletions
diff --git a/views/includes/materialize.html b/views/includes/materialize.html index 7c40c0d..9d5d210 100644 --- a/views/includes/materialize.html +++ b/views/includes/materialize.html | |||
@@ -1,6 +1,5 @@ | |||
1 | {{define "materialize"}} | 1 | {{define "materialize"}} |
2 | <link rel="stylesheet" href="/assets/css/materialize.css"> | 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"> | 3 | <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> |
5 | <meta name="viewport" content="width=device_width, initial-scale=1.0" /> | 4 | <meta name="viewport" content="width=device_width, initial-scale=1.0" /> |
6 | {{end}} \ No newline at end of file | 5 | {{end}} \ No newline at end of file |
diff --git a/views/includes/materialize_js.html b/views/includes/materialize_js.html new file mode 100644 index 0000000..be6dda6 --- /dev/null +++ b/views/includes/materialize_js.html | |||
@@ -0,0 +1,4 @@ | |||
1 | {{ define "materialize_js" }} | ||
2 | <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> | ||
3 | <script src="/assets/js/materialize.min.js"></script> | ||
4 | {{ end }} \ No newline at end of file | ||
diff --git a/views/pages/gril.html b/views/pages/gril.html index 776f14f..cd92208 100644 --- a/views/pages/gril.html +++ b/views/pages/gril.html | |||
@@ -19,6 +19,10 @@ | |||
19 | {{ end }} | 19 | {{ end }} |
20 | <div class="row center-align"> | 20 | <div class="row center-align"> |
21 | <img src="/{{ $gril.ImagePath false }}" /> | 21 | <img src="/{{ $gril.ImagePath false }}" /> |
22 | {{ if .user }} | ||
23 | <br /><br /><a class="waves-effect waves-light btn-large modal-trigger purple lighten-2" href="#modal_add_gril">Zu Liste hinzufügen</a> | ||
24 | {{ end }} | ||
25 | |||
22 | </div> | 26 | </div> |
23 | {{ range $tag := $gril.Tags }} | 27 | {{ range $tag := $gril.Tags }} |
24 | <a href="/tag/{{ $tag }}" | 28 | <a href="/tag/{{ $tag }}" |
@@ -32,46 +36,60 @@ | |||
32 | <br /> | 36 | <br /> |
33 | <br /> | 37 | <br /> |
34 | <div class="row"> | 38 | <div class="row"> |
35 | {{ if $gril.Birthday.Valid }} | 39 | {{ if $gril.Birthday.Valid }} |
36 | <div class="col s6 m2 l2"> | 40 | <div class="col s6 m2 l2"> |
37 | <div class="card"> | 41 | <div class="card"> |
38 | <div class="card-content purple-text text-lighten-2 center-align"> | 42 | <div class="card-content purple-text text-lighten-2 center-align"> |
39 | <span class="card-title big">{{ $gril.Birthday.Value}}</span> | 43 | <span class="card-title big">{{ $gril.Birthday.Value}}</span> |
40 | <p>Geburtstag</p> | 44 | <p>Geburtstag</p> |
41 | </div> | 45 | </div> |
42 | </div> | 46 | </div> |
43 | </div> | 47 | </div> |
44 | {{ else if $gril.Age.Valid }} | 48 | {{ else if $gril.Age.Valid }} |
45 | <div class="col s6 m2 l2"> | 49 | <div class="col s6 m2 l2"> |
46 | <div class="card"> | 50 | <div class="card"> |
47 | <div class="card-content purple-text text-lighten-2 center-align"> | 51 | <div class="card-content purple-text text-lighten-2 center-align"> |
48 | <span class="card-title big">{{ $gril.Age.Value }}</span> | 52 | <span class="card-title big">{{ $gril.Age.Value }}</span> |
49 | <p>Jahre alt</p> | 53 | <p>Jahre alt</p> |
50 | </div> | 54 | </div> |
51 | </div> | 55 | </div> |
52 | </div> | 56 | </div> |
53 | {{ end }} | 57 | {{ end }} |
54 | {{ if $gril.Lists }} | 58 | {{ if $gril.Lists }} |
55 | <div class="col s6 m2 l2"> | 59 | <div class="col s6 m2 l2"> |
56 | <div class="card"> | 60 | <div class="card"> |
57 | <div class="card-content center-big purple-text text-lighten-2 center-align"> | 61 | <div class="card-content center-big purple-text text-lighten-2 center-align"> |
58 | <p>in</p> | 62 | <p>in</p> |
59 | <span class="card-title big">{{ len $gril.Lists}}</span> | 63 | <span class="card-title big">{{ len $gril.Lists}}</span> |
60 | <p>Liste{{ if ne (len $gril.Lists) 1 }}n{{ end }}</p> | 64 | <p>Liste{{ if ne (len $gril.Lists) 1 }}n{{ end }}</p> |
61 | </div> | 65 | </div> |
62 | </div> | 66 | </div> |
63 | </div> | 67 | </div> |
64 | {{ end }} | 68 | {{ end }} |
65 | <div class="col s12 m4 l4"> | 69 | <div class="col s12 m4 l4"> |
66 | <div class="card"> | 70 | <div class="card"> |
67 | <div class="card-content purple-text text-lighten-2 center-align"> | 71 | <div class="card-content purple-text text-lighten-2 center-align"> |
68 | <span class="card-title big">{{ $gril.UpdatedAt.Format "Jan 02, 2006" }}</span> | 72 | <span class="card-title big">{{ $gril.UpdatedAt.Format "Jan 02, 2006" }}</span> |
69 | <p>aktualisiert</p> | 73 | <p>aktualisiert</p> |
70 | </div> | 74 | </div> |
71 | </div> | 75 | </div> |
72 | </div> | 76 | </div> |
73 | </div> | 77 | </div> |
74 | </div> | 78 | </div> |
79 | |||
80 | |||
81 | {{ if .user }} | ||
82 | <!-- Modal Structure --> | ||
83 | <div id="modal_add_gril" class="modal bottom-sheet"> | ||
84 | <div class="modal-content"> | ||
85 | <h4>Zu Liste hinzufügen</h4> | ||
86 | <div class="collection" id="modal-add-gril-content"></div> | ||
87 | </div> | ||
88 | </div> | ||
89 | |||
90 | {{ template "materialize_js" }} | ||
91 | <script src="/assets/js/gril.js"></script> | ||
92 | {{ end }} | ||
75 | </body> | 93 | </body> |
76 | </html> | 94 | </html> |
77 | {{ end }} | 95 | {{ end }} |