summaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
authorBrad Albright <32200834+bhalbright@users.noreply.github.com>2019-12-15 08:20:08 -0600
committerzeripath <art27@cantab.net>2019-12-15 14:20:08 +0000
commitf6b29012e09d5f7770a0b1ea8659da5172e155b3 (patch)
treecf78ded22aee572c91e93e2a2a3db8a7f9fd903c /routers/routes
parent7cc16740a56072465b3938cbb9cd326d40bd7ba9 (diff)
downloadgitea-f6b29012e09d5f7770a0b1ea8659da5172e155b3.tar.gz
gitea-f6b29012e09d5f7770a0b1ea8659da5172e155b3.zip
Add /milestones endpoint (#8733)
Create a /milestones endpoint which basically serves as a dashboard view for milestones, very similar to the /issues or /pulls page. Closes #8232
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index cfd4a60974..60fd93df9c 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -254,6 +254,13 @@ func RegisterRoutes(m *macaron.Macaron) {
}
}
+ reqMilestonesDashboardPageEnabled := func(ctx *context.Context) {
+ if !setting.Service.ShowMilestonesDashboardPage {
+ ctx.Error(403)
+ return
+ }
+ }
+
m.Use(user.GetNotificationCount)
// FIXME: not all routes need go through same middlewares.
@@ -276,6 +283,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Combo("/install", routers.InstallInit).Get(routers.Install).
Post(bindIgnErr(auth.InstallForm{}), routers.InstallPost)
m.Get("/^:type(issues|pulls)$", reqSignIn, user.Issues)
+ m.Get("/milestones", reqSignIn, reqMilestonesDashboardPageEnabled, user.Milestones)
// ***** START: User *****
m.Group("/user", func() {
@@ -556,6 +564,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/:org", func() {
m.Get("/dashboard", user.Dashboard)
m.Get("/^:type(issues|pulls)$", user.Issues)
+ m.Get("/milestones", reqMilestonesDashboardPageEnabled, user.Milestones)
m.Get("/members", org.Members)
m.Get("/members/action/:action", org.MembersAction)