everything 'works' now
Cette révision appartient à :
Parent
3764919308
révision
771527b518
4 fichiers modifiés avec 14 ajouts et 9 suppressions
|
@ -62,10 +62,11 @@ func UsersListPanel(w http.ResponseWriter, r *http.Request) {
|
||||||
page, _ := strconv.Atoi(r.URL.Query().Get("p"))
|
page, _ := strconv.Atoi(r.URL.Query().Get("p"))
|
||||||
offset := 100
|
offset := 100
|
||||||
|
|
||||||
users := userService.RetrieveUsersForAdmin(page*offset, offset)
|
users := userService.RetrieveUsersForAdmin(offset, page*offset)
|
||||||
languages.SetTranslationFromRequest(panelUserList, r, "en-us")
|
languages.SetTranslationFromRequest(panelUserList, r, "en-us")
|
||||||
htv := PanelUserListVbs{users}
|
htv := PanelUserListVbs{users}
|
||||||
_ = panelUserList.ExecuteTemplate(w, "admin_index.html", htv)
|
err := panelUserList.ExecuteTemplate(w, "admin_index.html", htv)
|
||||||
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func CommentsListPanel(w http.ResponseWriter, r *http.Request) {
|
func CommentsListPanel(w http.ResponseWriter, r *http.Request) {
|
||||||
|
@ -74,10 +75,11 @@ func CommentsListPanel(w http.ResponseWriter, r *http.Request) {
|
||||||
page, _ := strconv.Atoi(r.URL.Query().Get("p"))
|
page, _ := strconv.Atoi(r.URL.Query().Get("p"))
|
||||||
offset := 100
|
offset := 100
|
||||||
|
|
||||||
comments := commentService.GetAllComments(page*offset, offset)
|
comments := commentService.GetAllComments(offset, page * offset)
|
||||||
languages.SetTranslationFromRequest(panelCommentList, r, "en-us")
|
languages.SetTranslationFromRequest(panelCommentList, r, "en-us")
|
||||||
htv := PanelCommentListVbs{comments}
|
htv := PanelCommentListVbs{comments}
|
||||||
_ = panelCommentList.ExecuteTemplate(w, "admin_index.html", htv)
|
err := panelCommentList.ExecuteTemplate(w, "admin_index.html", htv)
|
||||||
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -88,7 +90,8 @@ func TorrentEditModPanel(w http.ResponseWriter, r *http.Request) {
|
||||||
torrent, _ := torrentService.GetTorrentById(id)
|
torrent, _ := torrentService.GetTorrentById(id)
|
||||||
languages.SetTranslationFromRequest(panelTorrentEd, r, "en-us")
|
languages.SetTranslationFromRequest(panelTorrentEd, r, "en-us")
|
||||||
htv := PanelTorrentEdVbs{torrent}
|
htv := PanelTorrentEdVbs{torrent}
|
||||||
_ = panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv)
|
err := panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv)
|
||||||
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,6 +85,8 @@ func init() {
|
||||||
Router.Handle("/mod/torrents", gzipTorrentsListPanel).Name("mod_tlist")
|
Router.Handle("/mod/torrents", gzipTorrentsListPanel).Name("mod_tlist")
|
||||||
Router.Handle("/mod/users", gzipUsersListPanel).Name("mod_ulist")
|
Router.Handle("/mod/users", gzipUsersListPanel).Name("mod_ulist")
|
||||||
Router.Handle("/mod/comments", gzipCommentsListPanel).Name("mod_clist")
|
Router.Handle("/mod/comments", gzipCommentsListPanel).Name("mod_clist")
|
||||||
|
Router.Handle("/mod/comments", gzipCommentsListPanel).Name("mod_cedit")
|
||||||
|
Router.Handle("/mod/comments", gzipCommentsListPanel).Name("mod_cdelete")
|
||||||
Router.Handle("/mod/torrent/", gzipTorrentEditModPanel).Name("mod_tedit")
|
Router.Handle("/mod/torrent/", gzipTorrentEditModPanel).Name("mod_tedit")
|
||||||
Router.Handle("/mod/torrent/", gzipTorrentPostEditModPanel).Name("mod_ptedit")
|
Router.Handle("/mod/torrent/", gzipTorrentPostEditModPanel).Name("mod_ptedit")
|
||||||
Router.Handle("/mod/torrent/delete", gzipCommentDeleteModPanel).Name("mod_tdelete")
|
Router.Handle("/mod/torrent/delete", gzipCommentDeleteModPanel).Name("mod_tdelete")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<table>
|
<table>
|
||||||
{{ range .Comments}}
|
{{ range .Comments}}
|
||||||
|
|
||||||
<tr><td><a href="{{ genRoute "mod_cedit" }}?id={{.Id}}">{{ .Content }}</a></td><td><a href="{{ genRoute "mod_cdelete" }}?id{{ .Id }}">Delete</a></td></tr>
|
<tr><td><a href="{{ genRoute "mod_cedit" }}?id={{.ID}}">{{ .Content }}</a></td><td><a href="{{ genRoute "mod_cdelete" }}?id{{ .ID }}">Delete</a></td></tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
</table>
|
</table>
|
||||||
{{end}}
|
{{end}}
|
|
@ -2,7 +2,7 @@
|
||||||
<table>
|
<table>
|
||||||
{{ range .Users}}
|
{{ range .Users}}
|
||||||
|
|
||||||
<tr><td><a href="{{ genRoute "mod_tedit" }}?id={{.Id}}">{{ .Username }}</a></td><td><a href="{{ genRoute "mod_tdelete" }}?id{{ .Id }}">Delete</a></td></tr>
|
<tr><td><a href="{{ genRoute "mod_tedit" }}?id={{.ID}}">{{ .Username }}</a></td><td><a href="{{ genRoute "mod_tdelete" }}?id{{ .ID }}">Delete</a></td></tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
</table>
|
</table>
|
||||||
{{end}}
|
{{end}}
|
Référencer dans un nouveau ticket