From 3705a683482141481d6e4f1e563bc239fed05514 Mon Sep 17 00:00:00 2001
From: jan <jan@ruken.pw>
Date: Sun, 13 Nov 2016 17:57:29 +0100
Subject: fixieren von userangucken wenn man nicht eingeloggt ist


diff --git a/frontend/renderer.go b/frontend/renderer.go
index 3fb79bf..d529dff 100644
--- a/frontend/renderer.go
+++ b/frontend/renderer.go
@@ -50,7 +50,7 @@ func (r *Renderer) SetDefaultData(data map[string]interface{}) {
 }
 
 // New erstellt einen neuen Renderer und sucht alle Templates aus dem gegebenen pfad.
-func New(path string) *Renderer {
+func New(path string, functions map[string]interface{}) *Renderer {
 	// Custom Template Funcs
 	funcMap := template.FuncMap{
 		"html": func(in string) template.HTML {
@@ -73,6 +73,10 @@ func New(path string) *Renderer {
 		},
 	}
 
+	for k, v := range functions {
+		funcMap[k] = v
+	}
+
 	files := make([]string, 0)
 	filepath.Walk(path, func(path string, info os.FileInfo, err error) error {
 		if info.IsDir() || !strings.HasSuffix(path, ".html") {
diff --git a/main.go b/main.go
index 240ca1a..dd00a9b 100644
--- a/main.go
+++ b/main.go
@@ -63,7 +63,9 @@ func main() {
 		}
 	}
 
-	renderer := frontend.New("views")
+	functions := charakterin.GetRendererFunctions()
+
+	renderer := frontend.New("views", functions)
 	login := charakterin.New(db)
 	login.UseRenderer(renderer)
 	if config.AnilistAPI.ClientID != "" && config.AnilistAPI.ClientSecret != "" {
diff --git a/views/pages/user.html b/views/pages/user.html
index 3c9d145..66cd62d 100644
--- a/views/pages/user.html
+++ b/views/pages/user.html
@@ -1,5 +1,5 @@
 {{ define "user" }}
-{{ $isCurrentUser := (and .user (eq .DisplayUser.ID .user.ID)) }}
+{{ $isCurrentUser := isSameUser .DisplayUser .user }}
 <html>
 	<head>
 		{{ template "materialize" }}
-- 
cgit v0.10.1


From aec3f635032120b0d5ca5ada7959d3f09b7fa94c Mon Sep 17 00:00:00 2001
From: jan <jan@ruken.pw>
Date: Sun, 13 Nov 2016 18:26:54 +0100
Subject: namen nicht umbrechen


diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index be6e399..c287dc5 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -200,7 +200,7 @@ func ListsToCards(lists []*models.List) []frontend.Card {
 					Link: fmt.Sprintf("/list/%d", list.ID),
 				},
 				frontend.Action{
-					Name:     fmt.Sprintf(`<span class="chip">von <a class="purple-text text-lighten-2" style="margin-right: 0px" href="/user/%d/%s">%s</a></span>`, list.Owner.ID, list.Owner.GetName(), list.Owner.GetName()),
+					Name:     fmt.Sprintf(`<span class="chip" style="white-space: nowrap">von <a class="purple-text text-lighten-2" style="margin-right: 0px" href="/user/%d/%s">%s</a></span>`, list.Owner.ID, list.Owner.GetName(), list.Owner.GetName()),
 					Link:     "#",
 					Disabled: true,
 				},
-- 
cgit v0.10.1