aboutsummaryrefslogtreecommitdiff
path: root/modules/lists
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-03-27 17:46:17 (UTC)
committerjan <jan@ruken.pw>2016-03-27 17:46:17 (UTC)
commitc7f28c0032163075bd21f899c37ae992e3eece80 (patch)
tree18c580c2f260e93ac97ddb4b4ec42bcae7e58254 /modules/lists
parent876530b3da8377e7072824bca5b3844c682eb37a (diff)
temporaer laufzeiten der module (dashboard data) loggen, views angepasst, dashboard in goroutines aufgeteilt, weniger daten fuers listendashboard holen (reduktion von 6s -> 300ms insgesamt)
Diffstat (limited to 'modules/lists')
-rw-r--r--modules/lists/lists.go18
1 files changed, 7 insertions, 11 deletions
diff --git a/modules/lists/lists.go b/modules/lists/lists.go
index 3febdba..836f6af 100644
--- a/modules/lists/lists.go
+++ b/modules/lists/lists.go
@@ -180,10 +180,6 @@ func ListsToCards(lists []*List) []frontend.Card {
180 var cards []frontend.Card 180 var cards []frontend.Card
181 181
182 for _, list := range lists { 182 for _, list := range lists {
183 s := "s"
184 if len(list.Grils) == 1 {
185 s = ""
186 }
187 cards = append(cards, frontend.Card{ 183 cards = append(cards, frontend.Card{
188 Title: list.Name, 184 Title: list.Name,
189 Description: list.Description, 185 Description: list.Description,
@@ -194,7 +190,7 @@ func ListsToCards(lists []*List) []frontend.Card {
194 Link: fmt.Sprintf("/list/%d", list.ID), 190 Link: fmt.Sprintf("/list/%d", list.ID),
195 }, 191 },
196 frontend.Action{ 192 frontend.Action{
197 Name: fmt.Sprintf(`<span class="chip">%d gril%s</span>`, len(list.Grils), s), 193 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()),
198 Link: "#", 194 Link: "#",
199 Disabled: true, 195 Disabled: true,
200 }, 196 },
@@ -214,11 +210,11 @@ func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.Dashboar
214 log.Println(err) 210 log.Println(err)
215 return categories 211 return categories
216 } 212 }
217 for _, list := range lists { 213 //for _, list := range lists {
218 if err := m.getListGrils(list); err != nil { 214 //if err := m.getListGrils(list); err != nil {
219 log.Println(err) 215 // log.Println(err)
220 } 216 //}
221 } 217 //}
222 218
223 categories = append(categories, grilist.DashboardCategory{ 219 categories = append(categories, grilist.DashboardCategory{
224 Title: "Neueste Listen", 220 Title: "Neueste Listen",
@@ -230,7 +226,7 @@ func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.Dashboar
230 } 226 }
231 227
232 // Listen des Benutzers 228 // Listen des Benutzers
233 lists = m.GetUserLists(user, true) 229 lists = m.GetUserLists(user, false)
234 230
235 categories = append(categories, grilist.DashboardCategory{ 231 categories = append(categories, grilist.DashboardCategory{
236 Title: "Meine Listen", 232 Title: "Meine Listen",