diff options
author | jan <jan@ruken.pw> | 2016-10-12 14:58:08 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-10-12 14:58:08 (UTC) |
commit | caa0e61762511c32e45caf0df4e9dca4d4670849 (patch) | |
tree | 9fac5dbabd3a9b2fb72f43a429c12a856f1cc79d /views | |
parent | edccb755f60fd135e09db5c60385961eccc72818 (diff) |
globale Notification eingefuegt. Wir brauchen noch irgendienen weg, das zB bei redirects zu verwenden
Diffstat (limited to 'views')
-rw-r--r-- | views/includes/navbar.html | 1 | ||||
-rw-r--r-- | views/includes/notification.html | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/views/includes/navbar.html b/views/includes/navbar.html index 23514f8..13fd22d 100644 --- a/views/includes/navbar.html +++ b/views/includes/navbar.html | |||
@@ -14,4 +14,5 @@ | |||
14 | </ul> | 14 | </ul> |
15 | </div> | 15 | </div> |
16 | </nav> | 16 | </nav> |
17 | {{ if .notification }}{{ template "notification" .notification }}{{ end }} | ||
17 | {{ end }} | 18 | {{ end }} |
diff --git a/views/includes/notification.html b/views/includes/notification.html new file mode 100644 index 0000000..d8323b7 --- /dev/null +++ b/views/includes/notification.html | |||
@@ -0,0 +1,23 @@ | |||
1 | {{ define "notification" }} | ||
2 | <style scoped> | ||
3 | #notification { | ||
4 | transition: opacity .5s; | ||
5 | opacity: 1.0; | ||
6 | padding: 8px; | ||
7 | } | ||
8 | |||
9 | #notification div { | ||
10 | padding: 8px; | ||
11 | border-radius: 4px; | ||
12 | } | ||
13 | </style> | ||
14 | <div class="row" id="notification"> | ||
15 | <div class="col s12 center-align white-text {{ if eq .Type "error" }}red darken-2 {{ else }}green lighten-2{{ end }}"> | ||
16 | {{ .Message }} | ||
17 | </div> | ||
18 | </div> | ||
19 | <script>'use strict'; | ||
20 | const el = document.getElementById('notification'); | ||
21 | setTimeout(() => el.style.opacity = 0.0, 3000); | ||
22 | </script> | ||
23 | {{ end }} | ||