aboutsummaryrefslogtreecommitdiff
path: root/modules/grils
diff options
context:
space:
mode:
Diffstat (limited to 'modules/grils')
-rw-r--r--modules/grils/grils.go32
1 files changed, 31 insertions, 1 deletions
diff --git a/modules/grils/grils.go b/modules/grils/grils.go
index 047385e..fbe57e3 100644
--- a/modules/grils/grils.go
+++ b/modules/grils/grils.go
@@ -2,7 +2,9 @@ package grils
2 2
3import ( 3import (
4 "fagott.pw/charakterin" 4 "fagott.pw/charakterin"
5 "fagott.pw/grilist/frontend"
5 "fagott.pw/grilist/grilist" 6 "fagott.pw/grilist/grilist"
7 "fmt"
6 "github.com/julienschmidt/httprouter" 8 "github.com/julienschmidt/httprouter"
7 "net/http" 9 "net/http"
8 "strconv" 10 "strconv"
@@ -27,7 +29,35 @@ func (m *GrilsModule) Interface() interface{} {
27} 29}
28 30
29func (m *GrilsModule) ProvideDashboardData(user *charakterin.User) []grilist.DashboardCategory { 31func (m *GrilsModule) ProvideDashboardData(user *charakterin.User) []grilist.DashboardCategory {
30 return []grilist.DashboardCategory{} 32 var categories []grilist.DashboardCategory
33
34 var grils []*Gril
35
36 // TODO
37 // NUR TEMPORÄR
38 g, _ := m.FromID(1)
39 grils = append(grils, g)
40
41 cat := grilist.DashboardCategory{
42 Title: "Neue Grils",
43 }
44
45 for _, gril := range grils {
46 cat.Cards = append(cat.Cards, frontend.Card{
47 Title: gril.RomajiName,
48 Description: gril.KanjiName,
49 Size: "medium",
50 Actions: []frontend.Action{
51 frontend.Action{
52 Name: "anguckieren",
53 Link: fmt.Sprintf("/gril/%d", gril.ID),
54 },
55 },
56 })
57 }
58
59 categories = append(categories, cat)
60 return categories
31} 61}
32 62
33func (m *GrilsModule) FromID(id int) (*Gril, error) { 63func (m *GrilsModule) FromID(id int) (*Gril, error) {