diff options
author | rtz12 <koenig@fagott.pw> | 2016-10-11 19:02:59 (UTC) |
---|---|---|
committer | rtz12 <koenig@fagott.pw> | 2016-10-11 19:02:59 (UTC) |
commit | ce5973c4024f22a8f8c63818109a2ca4f3be7bc4 (patch) | |
tree | e7b6b5d5c6e73451b489e97f90206a96bf9ed2df /modules/series | |
parent | fbd746aef8c78067593f901afb0f255574392499 (diff) | |
parent | b5051d2358e12f877e5c52053dcf1a16959e4ded (diff) |
Merge branch 'master' of projekte.fagott.pw:grilist
Diffstat (limited to 'modules/series')
-rw-r--r-- | modules/series/module.go | 44 |
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 @@ | |||
1 | package series | ||
2 | |||
3 | import ( | ||
4 | "net/http" | ||
5 | "strconv" | ||
6 | |||
7 | "fagott.pw/charakterin" | ||
8 | "fagott.pw/grilist/grilist" | ||
9 | "github.com/julienschmidt/httprouter" | ||
10 | ) | ||
11 | |||
12 | type Module struct { | ||
13 | g *grilist.Grilist | ||
14 | } | ||
15 | |||
16 | func New() *Module { | ||
17 | return &Module{} | ||
18 | } | ||
19 | |||
20 | func (m *Module) Name() string { | ||
21 | return "Series" | ||
22 | } | ||
23 | |||
24 | func (m *Module) Init(g *grilist.Grilist) { | ||
25 | m.g = g | ||
26 | |||
27 | m.g.Router.GET("/series/:id", m.viewSeries) | ||
28 | } | ||
29 | |||
30 | func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.DashboardCategory { | ||
31 | return make([]grilist.DashboardCategory, 0) | ||
32 | } | ||
33 | |||
34 | func (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 | } | ||