aboutsummaryrefslogtreecommitdiff
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
parentb868b32d348e6350225560b71c8712c2e932b063 (diff)
Ordnung in die Templates gebracht
-rw-r--r--frontend/renderer.go14
-rw-r--r--views/includes/card.html (renamed from views/card.html)0
-rw-r--r--views/includes/instant_search_results.html (renamed from views/instant_search_results.html)0
-rw-r--r--views/includes/list_gril.html (renamed from views/list_gril.html)0
-rw-r--r--views/includes/materialize.html (renamed from views/materialize.html)0
-rw-r--r--views/includes/navbar.html (renamed from views/navbar.html)0
-rw-r--r--views/pages/create_list.html (renamed from views/create_list.html)0
-rw-r--r--views/pages/dashboard.html (renamed from views/dashboard.html)0
-rw-r--r--views/pages/gril.html (renamed from views/gril.html)0
-rw-r--r--views/pages/list.html (renamed from views/list.html)0
-rw-r--r--views/pages/login.html (renamed from views/login.html)0
-rw-r--r--views/pages/register.html (renamed from views/register.html)0
-rw-r--r--views/pages/tag.html (renamed from views/tag.html)0
-rw-r--r--views/pages/user.html (renamed from views/user.html)0
-rw-r--r--views/pages/user_settings.html (renamed from views/user_settings.html)0
15 files changed, 13 insertions, 1 deletions
diff --git a/frontend/renderer.go b/frontend/renderer.go
index eeff58e..d39dfe1 100644
--- a/frontend/renderer.go
+++ b/frontend/renderer.go
@@ -3,6 +3,9 @@ package frontend
3import ( 3import (
4 "html/template" 4 "html/template"
5 "net/http" 5 "net/http"
6 "os"
7 "path/filepath"
8 "strings"
6) 9)
7 10
8// Action ist die Aktion auf einer Card. 11// Action ist die Aktion auf einer Card.
@@ -70,8 +73,17 @@ func New(path string) *Renderer {
70 }, 73 },
71 } 74 }
72 75
76 files := make([]string, 0)
77 filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
78 if info.IsDir() || !strings.HasSuffix(path, ".html") {
79 return nil
80 }
81 files = append(files, path)
82 return nil
83 })
84
73 r := &Renderer{ 85 r := &Renderer{
74 template.Must(template.New("").Funcs(funcMap).ParseGlob(path + "/*")), 86 template.Must(template.New("").Funcs(funcMap).ParseFiles(files...)),
75 make(map[string]interface{}), 87 make(map[string]interface{}),
76 } 88 }
77 89
diff --git a/views/card.html b/views/includes/card.html
index be28272..be28272 100644
--- a/views/card.html
+++ b/views/includes/card.html
diff --git a/views/instant_search_results.html b/views/includes/instant_search_results.html
index 0dd445c..0dd445c 100644
--- a/views/instant_search_results.html
+++ b/views/includes/instant_search_results.html
diff --git a/views/list_gril.html b/views/includes/list_gril.html
index f719dae..f719dae 100644
--- a/views/list_gril.html
+++ b/views/includes/list_gril.html
diff --git a/views/materialize.html b/views/includes/materialize.html
index 7c40c0d..7c40c0d 100644
--- a/views/materialize.html
+++ b/views/includes/materialize.html
diff --git a/views/navbar.html b/views/includes/navbar.html
index a0db664..a0db664 100644
--- a/views/navbar.html
+++ b/views/includes/navbar.html
diff --git a/views/create_list.html b/views/pages/create_list.html
index ead61dd..ead61dd 100644
--- a/views/create_list.html
+++ b/views/pages/create_list.html
diff --git a/views/dashboard.html b/views/pages/dashboard.html
index 045d4ab..045d4ab 100644
--- a/views/dashboard.html
+++ b/views/pages/dashboard.html
diff --git a/views/gril.html b/views/pages/gril.html
index 776f14f..776f14f 100644
--- a/views/gril.html
+++ b/views/pages/gril.html
diff --git a/views/list.html b/views/pages/list.html
index c85e147..c85e147 100644
--- a/views/list.html
+++ b/views/pages/list.html
diff --git a/views/login.html b/views/pages/login.html
index 65c4857..65c4857 100644
--- a/views/login.html
+++ b/views/pages/login.html
diff --git a/views/register.html b/views/pages/register.html
index b946518..b946518 100644
--- a/views/register.html
+++ b/views/pages/register.html
diff --git a/views/tag.html b/views/pages/tag.html
index d0d4180..d0d4180 100644
--- a/views/tag.html
+++ b/views/pages/tag.html
diff --git a/views/user.html b/views/pages/user.html
index 2cf9c54..2cf9c54 100644
--- a/views/user.html
+++ b/views/pages/user.html
diff --git a/views/user_settings.html b/views/pages/user_settings.html
index cf350a5..cf350a5 100644
--- a/views/user_settings.html
+++ b/views/pages/user_settings.html