aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/series/series.go10
-rw-r--r--modules/tags/tags.go9
2 files changed, 17 insertions, 2 deletions
diff --git a/modules/series/series.go b/modules/series/series.go
index 295e16b..c354de7 100644
--- a/modules/series/series.go
+++ b/modules/series/series.go
@@ -5,7 +5,9 @@ import (
5 "strconv" 5 "strconv"
6 6
7 "fagott.pw/charakterin" 7 "fagott.pw/charakterin"
8 "fagott.pw/grilist/eventlogging"
8 "fagott.pw/grilist/grilist" 9 "fagott.pw/grilist/grilist"
10
9 "github.com/julienschmidt/httprouter" 11 "github.com/julienschmidt/httprouter"
10) 12)
11 13
@@ -32,13 +34,17 @@ func (m *Module) ProvideDashboardData(user *charakterin.User) []grilist.Dashboar
32} 34}
33 35
34func (m *Module) viewSeries(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 36func (m *Module) viewSeries(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
35 _, _ = m.g.Charakterin.GetUserFromRequest(r) 37 el := m.g.EventLogger(r)
38 user, _ := m.g.Charakterin.GetUserFromRequest(r)
36 39
37 _, err := strconv.Atoi(p.ByName("id")) 40 id, err := strconv.Atoi(p.ByName("id"))
38 if err != nil { 41 if err != nil {
39 http.Redirect(w, r, "/", 302) 42 http.Redirect(w, r, "/", 302)
40 return 43 return
41 } 44 }
42 45
43 http.Error(w, "not implemented", 500) 46 http.Error(w, "not implemented", 500)
47 el.ViewSeries(user, eventlogging.ViewSeriesData{
48 SeriesID: id,
49 })
44} 50}
diff --git a/modules/tags/tags.go b/modules/tags/tags.go
index 4019f8a..e295b34 100644
--- a/modules/tags/tags.go
+++ b/modules/tags/tags.go
@@ -7,6 +7,7 @@ import (
7 "strconv" 7 "strconv"
8 8
9 "fagott.pw/charakterin" 9 "fagott.pw/charakterin"
10 "fagott.pw/grilist/eventlogging"
10 "fagott.pw/grilist/frontend" 11 "fagott.pw/grilist/frontend"
11 "fagott.pw/grilist/grilist" 12 "fagott.pw/grilist/grilist"
12 "fagott.pw/grilist/modules/grils" 13 "fagott.pw/grilist/modules/grils"
@@ -55,6 +56,7 @@ func (m *Module) viewTag(w http.ResponseWriter, r *http.Request, p httprouter.Pa
55} 56}
56 57
57func (m *Module) viewTagPage(w http.ResponseWriter, r *http.Request, p httprouter.Params) { 58func (m *Module) viewTagPage(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
59 el := m.g.EventLogger(r)
58 user, _ := m.g.Charakterin.GetUserFromRequest(r) 60 user, _ := m.g.Charakterin.GetUserFromRequest(r)
59 tag := p.ByName("tag") 61 tag := p.ByName("tag")
60 var tagID int 62 var tagID int
@@ -125,4 +127,11 @@ func (m *Module) viewTagPage(w http.ResponseWriter, r *http.Request, p httproute
125 data["cards"] = cards 127 data["cards"] = cards
126 data["pagination"] = frontend.PaginationFromPage(3, pageNumber, pageCount) 128 data["pagination"] = frontend.PaginationFromPage(3, pageNumber, pageCount)
127 m.g.Renderer.RenderPage("tag", w, data) 129 m.g.Renderer.RenderPage("tag", w, data)
130 el.ViewTag(user, eventlogging.ViewTagData{
131 Tag: tag,
132 TagID: tagID,
133 Results: pageNum,
134 Pages: pageCount,
135 Page: pageNumber,
136 })
128} 137}