mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	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
This commit is contained in:
		@@ -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)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user