# Routes
# This file defines all application routes (Higher priority routes first)
# ~~~~

# This fake route is required to submit a seed to generate Site Secret.
POST           /                                                                      controllers.Application.fake()

# Home page
GET            /                                                                      controllers.Application.index()
GET            /notifications                                                         controllers.Application.notifications()

# Play!Authenticate
GET     /logout                            controllers.Application.oAuthLogout
GET     /authenticate/:provider            controllers.Application.oAuth(provider: String)
GET     /authenticate/:provider/denied     controllers.Application.oAuthDenied(provider: String)
GET     /restricted                        controllers.Restricted.index

# Migration support page
GET            /migration                                                             controllers.MigrationApp.migration()
GET            /migration/projects                                                    controllers.MigrationApp.projects()
GET            /migration/:owner/projects/:projectName                                controllers.MigrationApp.project(owner, projectName)
GET            /migration/:owner/projects/:projectName/labels                         controllers.MigrationApp.exportLabels(owner, projectName)
GET            /migration/:owner/projects/:projectName/issuelabel                     controllers.MigrationApp.exportIssueLabelPairs(owner, projectName)
GET            /migration/:owner/projects/:projectName/milestones                     controllers.MigrationApp.exportMilestones(owner, projectName)
GET            /migration/:owner/projects/:projectName/issues                         controllers.MigrationApp.exportIssues(owner, projectName)
GET            /migration/:owner/projects/:projectName/posts                          controllers.MigrationApp.exportPosts(owner, projectName)

# Map static resources from the /public folder to the /assets URL path
GET            /messages.js                                                           controllers.Application.jsMessages()
GET            /favicon.ico                                                           controllers.Assets.at(path="/public", file="images/favicon.ico")
GET            /assets/*file                                                          controllers.Assets.at(path="/public", file)

# Bootstrapping for test
GET            /_init                                                                  controllers.Application.init()
GET            /_UIKit                                                                  controllers.Application.UIKit()

# Search
GET            /search                                                                 controllers.SearchApp.searchInAll()

GET            /-_-api                                                                 controllers.Application.index()
GET            /-_-api/v1/                                                             controllers.Application.index()
GET            /-_-api/v1/owners/:owner/projects/:projectName/exports                  controllers.api.ProjectApi.exports(owner:String, projectName:String)
GET            /-_-api/v1/owners/:owner/projects/:projectName/posts/$number<[0-9]+>/watchers   controllers.api.WatcherApi.getWatchers(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/posts                    controllers.api.BoardApi.newPostings(owner:String, projectName:String)
PATCH          /-_-api/v1/owners/:owner/projects/:projectName/posts/:number/content    controllers.api.BoardApi.updatePostingContent(owner: String, projectName: String, number: Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/posts/:number/comments   controllers.api.BoardApi.newPostingComment(owner:String, projectName:String, number:Long)

POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/imports           controllers.api.IssueApi.imports(owner:String, projectName:String)

POST           /-_-api/v1/owners/:owner/projects/:projectName/postlabel/:number        controllers.api.BoardApi.updatePostLabel(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues                   controllers.api.IssueApi.newIssues(owner:String, projectName:String)
POST            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/commentNotiReceivers  controllers.api.IssueApi.commentNotiRecivers(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/comments  controllers.api.IssueApi.newIssueComment(owner:String, projectName:String, number:Long)
PUT            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/comments/:commentId  controllers.api.IssueApi.updateIssueComment(owner:String, projectName:String, number:Long, commentId:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issuelabel/:number       controllers.api.IssueApi.updateIssueLabel(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/milestones               controllers.api.MilestoneApi.newMilestone(owner:String, projectName:String)
GET            /-_-api/v1/hello                                                        controllers.api.GlobalApi.hello()
GET            /-_-api/v1/favoriteProjects                                             controllers.api.UserApi.getFoveriteProjects
POST           /-_-api/v1/favoriteProjects/:projectId                                  controllers.api.UserApi.toggleFoveriteProject(projectId:String)
GET            /-_-api/v1/favoriteOrganizations                                        controllers.api.UserApi.getFoveriteOrganizations
POST           /-_-api/v1/favoriteOrganizations/:organizationId                        controllers.api.UserApi.toggleFoveriteOrganization(organizationId:String)
GET            /-_-api/v1/favoriteIssues                                               controllers.api.UserApi.getFoveriteIssues
POST           /-_-api/v1/favoriteIssues/:issueId                                      controllers.api.UserApi.toggleFoveriteIssue(issueId:String)
GET            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/assignableUsers    controllers.api.IssueApi.findAssignableUsers(owner:String, projectName:String, number:Long, query: String ?= "")
GET            /-_-api/v1/owners/:owner/projects/:projectName/assignableUsers                   controllers.api.IssueApi.findAssignableUsersOfProject(owner:String, projectName:String, query: String ?= "")
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/assignees          controllers.api.IssueApi.updateAssginees(owner:String, projectName:String, number:Long)
GET            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/findSharer         controllers.api.IssueApi.findSharerByloginIds(owner:String, projectName:String, number:Long, query: String ?= "")
GET            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/sharableUsers      controllers.api.IssueApi.findSharableUsers(owner:String, projectName:String, number:Long, query: String ?= "")
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/share              controllers.api.IssueApi.updateSharer(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/upvoteWeight       controllers.api.IssueApi.upvoteWeight(owner:String, projectName:String, number:Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/downvoteWeight     controllers.api.IssueApi.downvoteWeight(owner:String, projectName:String, number:Long)
GET            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number                    controllers.api.IssueApi.getIssue(owner: String, projectName: String, number: Long)
POST           /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/detectChange       controllers.api.IssueApi.detectChange(owner: String, projectName: String, number: Long)
PUT            /-_-api/v1/owners/:owner/projects/:projectName/issues/:number                    controllers.api.IssueApi.updateIssue(owner: String, projectName: String, number: Long)
PATCH          /-_-api/v1/owners/:owner/projects/:projectName/issues/:number                    controllers.api.IssueApi.updateIssueState(owner: String, projectName: String, number: Long)
PATCH          /-_-api/v1/owners/:owner/projects/:projectName/issues/:number/content            controllers.api.IssueApi.updateIssueContent(owner: String, projectName: String, number: Long)
GET            /-_-api/v1/users                                                        controllers.UserApp.users(query: String ?= "")
POST           /-_-api/v1/users                                                        controllers.api.UserApi.newUser()
POST           /-_-api/v1/users/token                                                  controllers.api.UserApi.newToken()
GET            /-_-api/v1/user/issues                                                  controllers.api.UserApi.getIssuesByUser(filter:String ?= "assigned", page: Int ?= 1, pageNum: Int ?= 10)
POST           /-_-api/v1/owners/:owner/projects                                       controllers.api.ProjectApi.newProject(owner:String)
POST           /-_-api/v1/owners/:owner/projects/:projectName/labels                   controllers.api.ProjectApi.newLabel(owner:String, projectName:String)
GET            /-_-api/v1/owners/:owner/projects/:projectName/titleHeads               controllers.api.ProjectApi.titleHeads(owner:String, projectName:String, query: String ?= "")
GET            /-_-api/v1/users/:user/statistics                                       controllers.api.UserApi.statistics(user: String)

POST           /-_-api/v1/user/defultLoginPage                                         controllers.UserApp.setDefaultLoginPage()
POST           /-_-api/v1/translation                                                  controllers.api.IssueApi.translate()

GET            /-_-api/v1/admin/users                                                  controllers.api.UserApi.users()
PATCH          /-_-api/v1/admin/users/:user                                            controllers.api.UserApi.updateUserState(user: String)

# Import
GET            /_import                                                                 controllers.ImportApp.importForm()
POST           /_import                                                                 controllers.ImportApp.newProject()

# Organization
GET            /organizations/new                                                      controllers.OrganizationApp.newForm()
POST           /organizations/new                                                      controllers.OrganizationApp.newOrganization()
GET            /organizations/:organizationName                                       controllers.OrganizationApp.organization(organizationName: String)
GET            /organizations/:organizationName/issues                                controllers.IssueApp.organizationIssues(organizationName: String, state:String ?= "", format:String ?= "html", pageNum: Int ?= 1)
GET            /organizations/:organizationName/boards                                controllers.BoardApp.organizationBoards(organizationName: String, pageNum: Int ?= 1)
GET            /organizations/:organizationName/pullrequests                          controllers.OrganizationApp.organizationPullRequests(organizationName: String, category: String ?= "open")
GET            /organizations/:organizationName/closedPullrequests                    controllers.OrganizationApp.organizationClosedPullRequests(organizationName: String)
GET            /organizations/:organizationName/settingform                           controllers.OrganizationApp.settingForm(organizationName: String)
GET            /organizations/:organizationName/deleteForm                            controllers.OrganizationApp.deleteForm(organizationName: String)
DELETE         /organizations/:organizationName                                       controllers.OrganizationApp.deleteOrganization(organizationName: String)
POST           /organizations/:organizationName/setting                               controllers.OrganizationApp.updateOrganizationInfo(organizationName: String)
GET            /organizations/:organizationName/members                               controllers.OrganizationApp.members(organizationName: String)
POST           /organizations/:organizationName/members                               controllers.OrganizationApp.addMember(organizationName: String)
POST           /organizations/:organizationName/member/:userId/edit                   controllers.OrganizationApp.editMember(organizationName: String, userId: Long)
DELETE         /organizations/:organizationName/member/:userId/delete                 controllers.OrganizationApp.deleteMember(organizationName: String, userId: Long)
DELETE         /organizations/:organizationName/member/leave                          controllers.OrganizationApp.leave(organizationName: String)
GET            /organizations/:organizationName/search                                controllers.SearchApp.searchInAGroup(organizationName)

# Enrolling Organization
POST           /organizations/:organizationName/enroll                                controllers.EnrollOrganizationApp.enroll(organizationName)
POST           /organizations/:organizationName/cancel/enroll                         controllers.EnrollOrganizationApp.cancelEnroll(organizationName)

# Notification
POST           /noti/toggle/:projectId/:notiType                                      controllers.WatchProjectApp.toggle(projectId: Long, notiType)

# User
GET            /user/sidebar                                                          controllers.Application.sidebar()
GET            /user/issues                                                           controllers.IssueApp.userIssuesPage()
GET            /user/issues                                                           controllers.IssueApp.userIssues(state:String ?= "", format:String ?= "html", pageNum: Int ?= 1)
GET            /user/issues/new                                                       controllers.IssueApp.newDirectIssueForm(commentId:Long ?= -1)
GET            /user/issues/new/mine                                                  controllers.IssueApp.newDirectMyIssueForm()
GET            /user/files                                                            controllers.UserApp.userFiles()
GET            /users/loginform                                                       controllers.UserApp.loginForm()
GET            /users/login                                                           controllers.Application.index()
POST           /users/login                                                           controllers.UserApp.login()
GET            /users/logout                                                          controllers.UserApp.logout()
GET            /users/signupform                                                      controllers.UserApp.signupForm()
POST           /users/signup                                                          controllers.UserApp.newUser()
GET            /user/editform                                                         controllers.UserApp.editUserInfoForm()
GET            /user/editform/:tabId                                                  controllers.UserApp.editUserInfoByTabForm(tabId: String)
POST            /user/editform/:tabId                                                  controllers.UserApp.editUserInfoByTabForm(tabId: String)
POST           /user/edit                                                             controllers.UserApp.editUserInfo()
POST           /user/resetPassword                                                    controllers.UserApp.resetUserPassword()
POST           /user/resetVisitedList                                                 controllers.UserApp.resetUserVisitedList()
GET            /user/isUsed                                                           controllers.UserApp.isUsed(name:String)
GET            /user/isEmailExist                                                     controllers.UserApp.isEmailExist(email:String)
GET            /user/usermenuTabContentList                                           controllers.UserApp.usermenuTabContentList()
GET            /info/leave/:user/:project                                             controllers.UserApp.leave(user, project)
POST           /user/email                                                            controllers.UserApp.addEmail()
DELETE         /user/email/delete/:emailId                                            controllers.UserApp.deleteEmail(emailId:Long)
PUT            /user/email/setAsMain/:emailId                                         controllers.UserApp.setAsMainEmail(emailId:Long)
POST           /user/email/sendValidationEmail/:emailId                               controllers.UserApp.sendValidationEmail(emailId:Long)
GET            /user/email/confirm/:emailId/:token                                    controllers.UserApp.confirmEmail(emailId: Long, token: String)

# Site
GET            /sites/data                                                            controllers.SiteApp.data()
GET            /sites/export                                                          controllers.SiteApp.exportData()
POST           /sites/import                                                          controllers.SiteApp.importData()
GET            /sites/mail                                                            controllers.SiteApp.writeMail(errorMessage:String ?= "", sended:Boolean ?= false)
POST           /sites/mail                                                            controllers.SiteApp.sendMail()
GET            /sites/massmail                                                        controllers.SiteApp.massMail()
POST           /sites/mailList                                                        controllers.SiteApp.mailList()
GET            /sites/userList                                                        controllers.SiteApp.userList(pageNum: Int ?= 1, query: String ?= null)
DELETE         /sites/user/delete:userId                                              controllers.SiteApp.deleteUser(userId:Long)
POST           /sites/toggleSiteAdminRole/:loginId                                    controllers.SiteApp.toggleSiteAdminRole(loginId:String)
GET            /sites/projectList                                                     controllers.SiteApp.projectList(filter:String ?= "", pageNum: Int ?=0)
DELETE         /sites/project/delete/:projectId                                       controllers.SiteApp.deleteProject(projectId:Long)
POST           /sites/toggleAccountLock                                               controllers.SiteApp.toggleAccountLock(loginId: String, state: String ?= null, query: String ?= null)
POST           /sites/toggleGuestMode                                               controllers.SiteApp.toggleGuestMode(loginId: String, state: String ?= null, query: String ?= null)
GET            /sites/update                                                          controllers.SiteApp.update()
POST           /sites/unwatchUpdate                                                   controllers.SiteApp.unwatchUpdate()
GET            /sites/diagnostic                                                      controllers.SiteApp.diagnose()
GET            /lostPassword                                                          controllers.PasswordResetApp.lostPassword
POST           /lostPassword                                                          controllers.PasswordResetApp.requestResetPasswordEmail()
GET            /resetPassword                                                         controllers.PasswordResetApp.resetPasswordForm(s:String)
POST           /resetPassword                                                         controllers.PasswordResetApp.resetPassword()
GET            /verify/:loginId/:verificationCode                                     controllers.UserApp.verifyUser(loginId:String, verificationCode:String)
GET            /sites/postList                                                        controllers.SiteApp.postList(pageNum: Int ?= 1)
GET            /sites/issueList                                                       controllers.SiteApp.issueList(pageNum: Int ?= 1)
GET            /sites/noAvatarUsers                                                   controllers.SiteApp.noAvatarUsers()
POST           /sites/setAttachmentToUserAvatar                                       controllers.SiteApp.setAttachmentToUserAvatar()

# Attachments
GET            /files                                                                 controllers.AttachmentApp.getFileList()
POST           /files                                                                 controllers.AttachmentApp.uploadFile()
GET            /files/:id                                                             controllers.AttachmentApp.getFile(id: Long)
GET            /files/:id/?                                                           controllers.AttachmentApp.getFile(id: Long)
POST           /files/:id/?                                                           controllers.AttachmentApp.deleteFile(id: Long)
POST           /files/:id                                                             controllers.AttachmentApp.deleteFile(id: Long)

# Pull Request Comment
POST           /:ownerName/:project/pullRequest/:pullRequestId/comments               controllers.PullRequestApp.newComment(ownerName, project, pullRequestId: Long, commitId: String ?= null)

# Boards
GET            /:user/:project/posts                                                  controllers.BoardApp.posts(user, project, pageNum: Int ?= 1)
GET            /:user/:project/postform                                               controllers.BoardApp.newPostForm(user, project)
POST           /:user/:project/posts                                                  controllers.BoardApp.newPost(user, project)
GET            /:user/:project/post/:number                                           controllers.BoardApp.post(user, project, number:Long)
POST           /:user/:project/post/:number/comment                                   controllers.BoardApp.newComment(user, project, number:Long)
POST           /:user/:project/post/:number/comment/:commentId                        controllers.BoardApp.updateComment(user, project, number:Long, commentId:Long)
PATCH          /:user/:project/post/:number/comment/:commentId                        controllers.api.BoardApi.updatePostingComment(user, project, number:Long, commentId:Long)
DELETE         /:user/:project/post/:number/delete                                    controllers.BoardApp.deletePost(user, project, number:Long)
GET            /:user/:project/post/:number/editform                                  controllers.BoardApp.editPostForm(user, project, number:Long)
POST           /:user/:project/post/:number/edit                                      controllers.BoardApp.editPost(user, project, number:Long)
DELETE         /:user/:project/post/:number/comment/:commentId/delete                 controllers.BoardApp.deleteComment(user, project, number:Long, commentId:Long)


# Labels
GET            /labels                                                                controllers.LabelApp.labels(query: String ?= "", category: String ?= "", limit: Integer ?= null)
GET            /categories                                                            controllers.LabelApp.categories(query: String ?= "", limit: Integer ?= null)
GET            /:user/:project/labels                                                 controllers.ProjectApp.labels(user, project)
POST           /:user/:project/labels                                                 controllers.ProjectApp.attachLabel(user, project)
POST           /:user/:project/labels/:id                                             controllers.ProjectApp.detachLabel(user, project, id: Long)

# Notifications
GET            /notification                                                         controllers.NotificationApp.notifications(from: Integer, limit: Integer)

# Projects
GET            /projectform                                                           controllers.ProjectApp.newProjectForm()
POST           /projects                                                              controllers.ProjectApp.newProject()
GET            /projects                                                              controllers.ProjectApp.projects(filter:String ?= "", pageNum: Int ?= 1)
GET            /orgs                                                                  controllers.OrganizationApp.orgList(filter:String ?= "", pageNum: Int ?= 1)
GET            /:user/:project                                                        controllers.ProjectApp.project(user, project)
PUT            /:user/:project                                                        controllers.ProjectApp.projectOverviewUpdate(user, project)
GET            /:user/:project/settingform                                            controllers.ProjectApp.settingForm(user, project)
POST           /:user/:project/setting                                                controllers.ProjectApp.settingProject(user, project)
GET            /:user/:project/deleteform                                             controllers.ProjectApp.deleteForm(user, project)
DELETE         /:user/:project/delete                                                 controllers.ProjectApp.deleteProject(user, project)
GET            /:user/:project/mentionList                                            controllers.ProjectApp.mentionList(user, project, number:Long ?= -1, resourceType:String ?= "", query: String ?= "", mentionType: String ?= "")
GET            /:user/:project/mentionListAtCommitDiff                                controllers.ProjectApp.mentionListAtCommitDiff(user, project, commitId:String ?= "", pullRequestId:Long ?= -1)
GET            /:user/:project/mentionListAtPullRequest                               controllers.ProjectApp.mentionListAtPullRequest(user, project, commitId:String ?= "", pullRequestId:Long)
GET            /:user/:project/members                                                controllers.ProjectApp.members(user, project)
POST           /:user/:project/members                                                controllers.ProjectApp.newMember(user, project)
POST           /:user/:project/member/:id/edit                                        controllers.ProjectApp.editMember(user, project, id:Long)
DELETE         /:user/:project/member/:id/delete                                      controllers.ProjectApp.deleteMember(user, project, id:Long)
GET            /:user/:project/webhooks                                               controllers.ProjectApp.webhooks(user, project)
POST           /:user/:project/webhooks                                               controllers.ProjectApp.newWebhook(user, project)
DELETE         /:user/:project/webhooks/:id                                           controllers.ProjectApp.deleteWebhook(user, project, id: Long)
GET            /:user/:project/watchers                                               controllers.ProjectApp.watchers(user, project)
DELETE         /:user/:project/pushedBranch/:id/delete                                controllers.ProjectApp.deletePushedBranch(user, project, id:Long)
GET            /:user/:project/transfer                                               controllers.ProjectApp.transferForm(user, project)
PUT            /:user/:project/transfer                                               controllers.ProjectApp.transferProject(user, project)
GET            /project/transfer/:id/:key                                             controllers.ProjectApp.acceptTransfer(id: Long, key)
GET            /:user/:project/search                                                 controllers.SearchApp.searchInAProject(user, project)
GET            /:user/:project/changeVCS                                              controllers.ProjectApp.changeVCSForm(user, project)
POST           /:user/:project/changeVCS                                              controllers.ProjectApp.changeVCS(user, project)

# Project menu forwarding
GET            /:user/:project/go                                                     controllers.ProjectApp.goConventionMenu(user, project, state:String ?= "", format:String ?= "html", pageNum: Int ?= 1)

# Project Review Menu
GET            /:user/:project/reviews                                                controllers.ReviewThreadApp.reviewThreads(user, project)

# Milestones
GET            /:user/:project/milestones                                             controllers.MilestoneApp.milestones(user, project)
GET            /:user/:project/newMilestoneForm                                       controllers.MilestoneApp.newMilestoneForm(user, project)
POST           /:user/:project/milestones                                             controllers.MilestoneApp.newMilestone(user, project)
GET            /:user/:project/milestone/:id/editform                                 controllers.MilestoneApp.editMilestoneForm(user, project, id: Long)
POST           /:user/:project/milestone/:id/edit                                     controllers.MilestoneApp.editMilestone(user, project, id: Long)
DELETE         /:user/:project/milestone/:id/delete                                   controllers.MilestoneApp.deleteMilestone(user, project, id: Long)
POST           /:user/:project/milestone/:id/open                                     controllers.MilestoneApp.open(user, project, id: Long)
POST           /:user/:project/milestone/:id/close                                    controllers.MilestoneApp.close(user, project, id: Long)
GET            /:user/:project/milestone/:id                                          controllers.MilestoneApp.milestone(user, project, id: Long)


# Issues
GET            /:user/:project/issues                                                 controllers.IssueApp.issues(user, project, state:String ?= "", format:String ?= "html", pageNum: Int ?= 1)
GET            /:user/:project/issueform                                              controllers.IssueApp.newIssueForm(user, project)
POST           /:user/:project/issues                                                 controllers.IssueApp.massUpdate(user, project)
POST           /:user/:project/issues/latest                                          controllers.IssueApp.newIssue(user, project)
GET            /:user/:project/issue/$number<[0-9]+>                                  controllers.IssueApp.issue(user, project, number:Long)
GET            /:user/:project/issue/$number<[0-9]+>/editform                         controllers.IssueApp.editIssueForm(user, project, number:Long)
POST           /:user/:project/issue/$number<[0-9]+>/edit                             controllers.IssueApp.editIssue(user, project, number:Long)
GET            /:user/:project/issue/$number<[0-9]+>/nextstate                        controllers.IssueApp.nextState(user, project, number:Long)
DELETE         /:user/:project/issue/$number<[0-9]+>/delete                           controllers.IssueApp.deleteIssue(user, project, number:Long)
POST           /:user/:project/issue/$number<[0-9]+>/comments                         controllers.IssueApp.newComment(user, project, number:Long)
POST           /:user/:project/issue/$number<[0-9]+>/comments/:commentId              controllers.IssueApp.updateComment(user, project, number:Long, commentId:Long)
PATCH          /:user/:project/issue/$number<[0-9]+>/comments/:commentId              controllers.api.IssueApi.updateIssueComment(user, project, number:Long, commentId:Long)
DELETE         /:user/:project/issue/$number<[0-9]+>/comment/:commentId/delete        controllers.IssueApp.deleteComment(user, project, number:Long, commentId:Long)
GET            /:user/:project/issue/$number<[0-9]+>/timeline                         controllers.IssueApp.timeline(user, project, number:Long)

# Issue Labels
GET            /:user/:project/issue/labels                                           controllers.IssueLabelApp.labels(user, project)
POST           /:user/:project/issue/labels                                           controllers.IssueLabelApp.newLabel(user, project)
GET            /:user/:project/issue/labelsform                                       controllers.IssueLabelApp.labelsForm(user, project)
POST           /:user/:project/issue/label/:id/delete                                 controllers.IssueLabelApp.delete(user, project, id:Long)
PUT            /:user/:project/issue/label/:id                                        controllers.IssueLabelApp.update(user, project, id:Long)
GET            /:user/:project/issue/labels.css                                       controllers.IssueLabelApp.labelStyles(user, project)
GET            /:user/:project/issue/label/categories                                 controllers.IssueLabelApp.categories(user, project)
GET            /:user/:project/issue/label/category/:id                               controllers.IssueLabelApp.category(user, project, id:Long)
PUT            /:user/:project/issue/label/category/:id                               controllers.IssueLabelApp.updateCategory(user, project, id:Long)
POST           /:user/:project/issue/label/categories                                 controllers.IssueLabelApp.newCategory(user, project)
DELETE         /:user/:project/issue/label/category/:id                               controllers.IssueLabelApp.deleteCategory(user, project, id: Long)
POST           /:user/:project/copyLabels                                             controllers.IssueLabelApp.copyLabels(user, project)

# Git
GET            /:ownerName/:project/info/refs                                         controllers.GitApp.advertise(ownerName:String, project:String, service:String ?= null)
POST           /:ownerName/:project/$service<git-upload-pack|git-receive-pack>        controllers.GitApp.serviceRpc(ownerName:String, project:String, service:String)

# Fork & Pull Request
GET            /:ownerName/:project/newFork                                           controllers.PullRequestApp.newFork(ownerName:String, project:String, forkOwner:String ?= null)
POST           /:ownerName/:project/fork                                              controllers.PullRequestApp.fork(ownerName:String, project:String)
POST           /:ownerName/:project/clone                                             controllers.PullRequestApp.doClone(ownerName:String, project:String)
GET            /:ownerName/:project/pullRequests                                      controllers.PullRequestApp.pullRequests(ownerName, project)

GET            /:ownerName/:project/closedPullRequests                                controllers.PullRequestApp.closedPullRequests(ownerName, project)
GET            /:ownerName/:project/sentPullRequests                                  controllers.PullRequestApp.sentPullRequests(ownerName, project)
GET            /:ownerName/:project/pullRequest/:id                                   controllers.PullRequestApp.pullRequest(ownerName, project, id: Long)
GET            /:ownerName/:project/pullRequest/:id/changes                           controllers.PullRequestApp.pullRequestChanges(ownerName, project, id: Long)
GET            /:ownerName/:project/pullRequest/:id/changes/:commitId                 controllers.PullRequestApp.specificChange(ownerName, project, id: Long, commitId: String)
GET            /:ownerName/:project/pullRequest/:id/state                             controllers.PullRequestApp.pullRequestState(ownerName, project, id: Long)
GET            /:ownerName/:project/newPullRequestForm                                controllers.PullRequestApp.newPullRequestForm(ownerName:String, project:String)
GET            /:ownerName/:project/newPullRequest/mergeResult                        controllers.PullRequestApp.mergeResult(ownerName, project)
POST           /:ownerName/:project/pullRequests                                      controllers.PullRequestApp.newPullRequest(ownerName, project)
POST           /:ownerName/:project/pullRequest/:id/accept                            controllers.PullRequestApp.accept(ownerName, project, id: Long)
POST           /:ownerName/:project/pullRequest/:id/close                             controllers.PullRequestApp.close(ownerName, project, id: Long)
POST           /:ownerName/:project/pullRequest/:id/open                              controllers.PullRequestApp.open(ownerName, project, id: Long)
GET            /:ownerName/:project/pullRequest/:id/editform                          controllers.PullRequestApp.editPullRequestForm(ownerName, project, id: Long)
POST           /:ownerName/:project/pullRequest/:id/edit                              controllers.PullRequestApp.editPullRequest(ownerName, project, id: Long)
DELETE         /:ownerName/:project/pullRequest/:id/deletefrombranch                  controllers.PullRequestApp.deleteFromBranch(ownerName, project, id: Long)
POST           /:ownerName/:project/pullRequest/:id/restorefrombranch                 controllers.PullRequestApp.restoreFromBranch(ownerName, project, id: Long)

# SVN
HEAD           /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
GET            /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
POST           /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
OPTIONS        /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
DELETE         /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
PUT            /svn/*path                                                             controllers.SvnApp.serviceWithPath(path:String)
POST           /!svn-fake/sevice/                                                     controllers.SvnApp.service()

# Code
#for AJAX
GET            /:user/:project/code/!                                                 controllers.CodeApp.ajaxRequest(user, project, path = "")
GET            /:user/:project/code/!/                                                controllers.CodeApp.ajaxRequest(user, project, path = "")
GET            /:user/:project/code/!/*path                                           controllers.CodeApp.ajaxRequest(user, project, path:String)
GET            /:user/:project/code/:branch/!                                         controllers.CodeApp.ajaxRequestWithBranch(user, project, branch:String, path="")
GET            /:user/:project/code/:branch/!/                                        controllers.CodeApp.ajaxRequestWithBranch(user, project, branch:String, path="")
GET            /:user/:project/code/:branch/!/*path                                   controllers.CodeApp.ajaxRequestWithBranch(user, project, branch:String, path:String)
#for normal
GET            /:user/:project/code                                                   controllers.CodeApp.codeBrowser(user, project)
GET            /:user/:project/code/:branch                                           controllers.CodeApp.codeBrowserWithBranch(user, project, branch:String, path="")
GET            /:user/:project/code/:branch/download                                  controllers.CodeApp.download(user, project, branch:String, path="")
GET            /:user/:project/code/:branch/*path                                     controllers.CodeApp.codeBrowserWithBranch(user, project, branch:String, path:String)
GET            /:user/:project/rawcode/:rev/*path                                     controllers.CodeApp.showRawFile(user, project, rev:String, path:String)
GET            /:user/:project/files/:rev/*path                                       controllers.CodeApp.openFile(user, project, rev:String, path:String)
GET            /:user/:project/image/:rev/*path                                       controllers.CodeApp.showImageFile(user, project, rev:String, path:String)

# Commits
GET            /:user/:project/commits                                                controllers.CodeHistoryApp.historyUntilHead(user, project)
GET            /:user/:project/commits/:branch/                                       controllers.CodeHistoryApp.history(user, project, branch:String, path=null)
GET            /:user/:project/commits/:branch/*path                                  controllers.CodeHistoryApp.history(user, project, branch:String, path:String)
GET            /:user/:project/commit/:id                                             controllers.CodeHistoryApp.show(user, project, id:String)
POST           /:user/:project/commit/:commitId/comments                              controllers.CodeHistoryApp.newComment(user, project, commitId)
DELETE         /:user/:project/commit/:commitId/comments/:id/delete                   controllers.CodeHistoryApp.deleteComment(user, project, commitId, id: Long)

# Branches
GET            /:user/:project/branches                                               controllers.BranchApp.branches(user, project)
DELETE         /:user/:project/code/:branch/                                          controllers.BranchApp.deleteBranch(user, project, branch)
POST           /:user/:project/code/:branch/setAsDefault                              controllers.BranchApp.setAsDefault(user, project, branch)

# Help
GET            /_help                                                                  controllers.HelpApp.help()

# Watch
POST           /watch                                                                 controllers.WatchApp.watch(resource: models.resource.ResourceParam)
POST           /unwatch                                                               controllers.WatchApp.unwatch(resource: models.resource.ResourceParam)
GET            /unwatch                                                               controllers.WatchApp.unwatch(resource: models.resource.ResourceParam)

# Statistics
GET            /:user/:project/statistics                                             controllers.StatisticsApp.statistics(user, project)
GET            /:user                                                                 controllers.UserApp.userInfo(user, daysAgo :Int ?= 0, selected: String ?= "issues")
POST           /:user                                                                 controllers.UserApp.resetUserPasswordBySiteManager(user)

# Watching Projects
POST           /:user/:project/watch                                                  controllers.WatchProjectApp.watch(user, project)
POST           /:user/:project/unwatch                                                controllers.WatchProjectApp.unwatch(user, project)

# Enrolling Projects
POST           /:user/:project/enroll                                                 controllers.EnrollProjectApp.enroll(user, project)
POST           /:user/:project/cancel/enroll                                          controllers.EnrollProjectApp.cancelEnroll(user, project)

# Comment
DELETE         /comments/:type/:id                                                    controllers.CommentApp.delete(type, id)

# Review
POST           /:user/:project/pullRequest/:number/review                             controllers.ReviewApp.review(user, project, number: Long)
POST           /:user/:project/pullRequest/:number/unreview                           controllers.ReviewApp.unreview(user, project, number: Long)

# Compare
GET            /:user/:project/compare/:revA..:revB                                   controllers.CompareApp.compare(user, project, revA, revB)

# Vote
POST           /:user/:project/issue/:number/vote                                     controllers.VoteApp.vote(user, project, number: Long)
POST           /:user/:project/issue/:number/unvote                                   controllers.VoteApp.unvote(user, project, number: Long)
POST           /:user/:project/issue/:number/comment/:commentId/vote                  controllers.VoteApp.voteComment(user, project, number: Long, commentId: Long)
POST           /:user/:project/issue/:number/comment/:commentId/unvote                controllers.VoteApp.unvoteComment(user, project, number: Long, commentId: Long)

# Comment Thread
POST           /threads/:id/open                                                      controllers.CommentThreadApp.open(id: Long)
POST           /threads/:id/close                                                     controllers.CommentThreadApp.close(id: Long)

# Markdown Renderer
POST           /markdown/:user/:project                                               controllers.MarkdownApp.render(user, project)

# remove trailing slash - must be the bottom of this file
GET            /*paths                                                                controllers.Application.removeTrailer(paths)
