summaryrefslogtreecommitdiffstats
path: root/routers/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routers/routes')
-rw-r--r--routers/routes/routes.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index 5fa93fdb09..938dec1dcf 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -484,6 +484,19 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/content", repo.UpdateIssueContent)
m.Post("/watch", repo.IssueWatch)
m.Combo("/comments").Post(bindIgnErr(auth.CreateCommentForm{}), repo.NewComment)
+ m.Group("/times", func() {
+ m.Post("/add", bindIgnErr(auth.AddTimeManuallyForm{}), repo.AddTimeManually)
+ m.Group("/stopwatch", func() {
+ m.Post("/toggle", repo.IssueStopwatch)
+ m.Post("/cancel", repo.CancelStopwatch)
+ })
+
+ }, func(ctx *context.Context) {
+ if !ctx.Repo.CanUseTimetracker(repo.GetActionIssue(ctx), ctx.User) {
+ ctx.Handle(404, ctx.Req.RequestURI, nil)
+ return
+ }
+ })
})
m.Post("/labels", repo.UpdateIssueLabel, reqRepoWriter)