* Update profile.go * Update router.go * Update torrents.go * Update router.go * Update announcements.go * Update comments.go * Update oauth.go * Update reports.go * Update router.go * Update index.jet.html * Update torrentlist.jet.html * Update commentlist.jet.html * Update announcements.jet.html * Update clientlist.jet.html * Update torrent_report.jet.html * Update userlist.jet.html * Update userlist.jet.html * Update userlist.jet.html * Update edit.jet.html * Update delete.go * Update edit.jet.html * Update index.jet.html * Update profile.go * Update router.go * Update profile.go * Update edit.jet.html * Update userlist.jet.html * Update index.jet.html * remove hotfix that didn't even hit live
28 lignes
879 o
Go
28 lignes
879 o
Go
package torrentController
|
|
|
|
import (
|
|
"github.com/NyaaPantsu/nyaa/controllers/middlewares"
|
|
"github.com/NyaaPantsu/nyaa/controllers/router"
|
|
)
|
|
|
|
func init() {
|
|
router.Get().Any("/download/:hash", DownloadTorrent)
|
|
router.Get().Any("/stats/:id", GetStatsHandler)
|
|
|
|
torrentRoutes := router.Get().Group("/torrent", middlewares.LoggedInMiddleware())
|
|
{
|
|
torrentRoutes.GET("/", TorrentEditUserPanel)
|
|
torrentRoutes.POST("/", TorrentPostEditUserPanel)
|
|
torrentRoutes.GET("/tag", ViewFormTag)
|
|
torrentRoutes.POST("/tag", ViewFormTag)
|
|
torrentRoutes.GET("/tag/add", AddTag)
|
|
torrentRoutes.GET("/tag/remove", DeleteTag)
|
|
torrentRoutes.POST("/delete", TorrentDeleteUserPanel)
|
|
}
|
|
torrentViewRoutes := router.Get().Group("/view")
|
|
{
|
|
torrentViewRoutes.GET("/:id", ViewHandler)
|
|
torrentViewRoutes.HEAD("/:id", ViewHeadHandler)
|
|
torrentViewRoutes.POST("/:id", PostCommentHandler)
|
|
}
|
|
}
|