2017-07-16 17:14:21 +02:00
package moderatorController
import (
"github.com/NyaaPantsu/nyaa/controllers/middlewares"
"github.com/NyaaPantsu/nyaa/controllers/router"
)
func init ( ) {
2017-08-02 15:06:34 +02:00
// We create a subroute group to apply a modmiddleware on all routes inside it
// The following routes all start at /mod
2017-07-16 17:14:21 +02:00
modRoutes := router . Get ( ) . Group ( "/mod" , middlewares . ModMiddleware ( ) )
{
2017-08-02 15:06:34 +02:00
/* Panel index route */
2017-07-16 17:14:21 +02:00
modRoutes . Any ( "/" , IndexModPanel )
2017-08-02 15:06:34 +02:00
/* Torrent Listing routes */
2017-07-16 17:14:21 +02:00
modRoutes . GET ( "/torrents" , TorrentsListPanel )
modRoutes . GET ( "/torrents/p/:page" , TorrentsListPanel )
modRoutes . POST ( "/torrents" , TorrentsPostListPanel )
modRoutes . POST ( "/torrents/p/:page" , TorrentsPostListPanel )
2017-08-02 15:06:34 +02:00
/* Deleted torrents listing routes */
2017-07-16 17:14:21 +02:00
modRoutes . GET ( "/torrents/deleted" , DeletedTorrentsModPanel )
modRoutes . GET ( "/torrents/deleted/p/:page" , DeletedTorrentsModPanel )
modRoutes . POST ( "/torrents/deleted" , DeletedTorrentsPostPanel )
modRoutes . POST ( "/torrents/deleted/p/:page" , DeletedTorrentsPostPanel )
2017-08-02 15:06:34 +02:00
/* Report listing routes */
2017-07-16 17:14:21 +02:00
modRoutes . Any ( "/reports" , TorrentReportListPanel )
modRoutes . Any ( "/reports/p/:page" , TorrentReportListPanel )
2017-08-02 15:06:34 +02:00
/* User listing routes */
2017-07-16 17:14:21 +02:00
modRoutes . Any ( "/users" , UsersListPanel )
modRoutes . Any ( "/users/p/:page" , UsersListPanel )
2017-08-02 15:06:34 +02:00
/* Comments listing routes */
2017-07-16 17:14:21 +02:00
modRoutes . Any ( "/comments" , CommentsListPanel )
modRoutes . Any ( "/comments/p/:page" , CommentsListPanel )
2017-08-02 15:06:34 +02:00
modRoutes . Any ( "/comment" , CommentsListPanel ) // TODO Edit comment view
2017-08-03 03:38:07 +02:00
/* Announcement listing routes */
modRoutes . Any ( "/announcement" , listAnnouncements )
modRoutes . Any ( "/announcement/p/:page" , listAnnouncements )
2017-08-02 15:06:34 +02:00
/* Torrent edit view */
2017-07-16 17:14:21 +02:00
modRoutes . GET ( "/torrent" , TorrentEditModPanel )
modRoutes . POST ( "/torrent" , TorrentPostEditModPanel )
2017-08-02 15:06:34 +02:00
/* Torrent delete routes */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/torrent/delete" , TorrentDeleteModPanel )
2017-08-02 15:06:34 +02:00
2017-08-03 03:38:07 +02:00
/* Announcement edit view */
modRoutes . GET ( "/announcement/form" , addAnnouncement )
modRoutes . POST ( "/announcement/form" , postAnnouncement )
/* Announcement delete routes */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/announcement/delete" , deleteAnnouncement )
2017-08-03 03:38:07 +02:00
2017-08-02 15:06:34 +02:00
/* Torrent lock/unlock route */
2017-07-16 17:14:21 +02:00
modRoutes . Any ( "/torrent/block" , TorrentBlockModPanel )
2017-08-02 15:06:34 +02:00
/* Tags delete route */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/tags/delete" , DeleteTagsModPanel )
2017-08-02 15:06:34 +02:00
/* Report delete route */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/report/delete" , TorrentReportDeleteModPanel )
2017-08-02 15:06:34 +02:00
/* Comment delete route */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/comment/delete" , CommentDeleteModPanel )
2017-08-02 15:06:34 +02:00
/* Reassign form routes */
2017-07-16 17:14:21 +02:00
modRoutes . GET ( "/reassign" , TorrentReassignModPanel )
modRoutes . POST ( "/reassign" , TorrentPostReassignModPanel )
2017-08-02 15:06:34 +02:00
/* Oauth clients listing routes */
2017-07-28 05:46:40 +02:00
modRoutes . GET ( "/oauth_client" , clientsListPanel )
modRoutes . GET ( "/oauth_client/p/:page" , clientsListPanel )
2017-08-02 15:06:34 +02:00
/* Oauth client delete route */
2017-10-12 02:54:01 +02:00
modRoutes . POST ( "/oauth_client/delete" , clientsDeleteModPanel )
2017-08-02 15:06:34 +02:00
/* Oauth client edit routes */
2017-07-28 05:46:40 +02:00
modRoutes . GET ( "/oauth_client/form" , formClientController )
modRoutes . POST ( "/oauth_client/form" , formPostClientController )
2017-08-02 15:06:34 +02:00
/* Mod Api routes */
2017-07-16 17:14:21 +02:00
apiMod := modRoutes . Group ( "/api" )
apiMod . Any ( "/torrents" , APIMassMod )
}
}