From fb0424cea33e1c48f940c485bff1f4d0aac31dc4 Mon Sep 17 00:00:00 2001 From: jan Date: Sat, 26 Dec 2015 10:04:06 +0100 Subject: =?UTF-8?q?Neue=20Grils=20f=C3=BCr=20das=20Dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 import ( "fagott.pw/charakterin" + "fagott.pw/grilist/frontend" "fagott.pw/grilist/grilist" + "fmt" "github.com/julienschmidt/httprouter" "net/http" "strconv" @@ -27,7 +29,35 @@ func (m *GrilsModule) Interface() interface{} { } func (m *GrilsModule) ProvideDashboardData(user *charakterin.User) []grilist.DashboardCategory { - return []grilist.DashboardCategory{} + var categories []grilist.DashboardCategory + + var grils []*Gril + + // TODO + // NUR TEMPORÄR + g, _ := m.FromID(1) + grils = append(grils, g) + + cat := grilist.DashboardCategory{ + Title: "Neue Grils", + } + + for _, gril := range grils { + cat.Cards = append(cat.Cards, frontend.Card{ + Title: gril.RomajiName, + Description: gril.KanjiName, + Size: "medium", + Actions: []frontend.Action{ + frontend.Action{ + Name: "anguckieren", + Link: fmt.Sprintf("/gril/%d", gril.ID), + }, + }, + }) + } + + categories = append(categories, cat) + return categories } func (m *GrilsModule) FromID(id int) (*Gril, error) { -- cgit v0.10.1