aboutsummaryrefslogtreecommitdiff
path: root/modules/series
diff options
context:
space:
mode:
authorjan <jan@ruken.pw>2016-10-11 14:31:52 (UTC)
committerjan <jan@ruken.pw>2016-10-11 14:31:52 (UTC)
commite2d40c07c10ba46c7b32bbfbbf00493f40fe3c56 (patch)
treebfa093fccae95e186f3e26aa1b6423bfaf3168d2 /modules/series
parentf958866bbb20f824ea231fc31158412210fd62dd (diff)
serienmodul hinzugefuegt, die datenbank muss aber erst mal gerichtet werden
Diffstat (limited to 'modules/series')
-rw-r--r--modules/series/module.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/modules/series/module.go b/modules/series/module.go
new file mode 100644
index 0000000..295e16b
--- /dev/null
+++ b/modules/series/module.go
@@ -0,0 +1,44 @@
1package series
2
3import (
4 "net/http"
5 "strconv"
6
7 "fagott.pw/charakterin"
8 "fagott.pw/grilist/grilist"
9 "github.com/julienschmidt/httprouter"
10)
11
12type Module struct {
13 g *grilist.Grilist
14}
15
16func New() *Module {
17 return &Module{}
18}
19
20func (m *Module) Name() string {
21 return "Series"
22}
23
24func (m *Module) Init(g *grilist.Grilist) {
25 m.g = g
26
27 m.g.Router.GET("/series/:id", m.viewSeries)
28}
29
30func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.DashboardCategory {
31 return make([]grilist.DashboardCategory, 0)
32}
33
34func (m *Module) viewSeries(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
35 _, _ = m.g.Charakterin.GetUserFromRequest(r)
36
37 _, err := strconv.Atoi(p.ByName("id"))
38 if err != nil {
39 http.Redirect(w, r, "/", 302)
40 return
41 }
42
43 http.Error(w, "not implemented", 500)
44}