summaryrefslogtreecommitdiffstats
path: root/routers
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-03-25 12:12:27 -0400
committerUnknown <joe2010xtmf@163.com>2014-03-25 12:12:27 -0400
commit2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf (patch)
tree7fdae59ac504c0aedd0a657ff9a9bd9f30de3b22 /routers
parent23d103c72163cdb4ea65c9756edf22c597060a7e (diff)
downloadgitea-2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf.tar.gz
gitea-2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf.zip
Added create issue
Diffstat (limited to 'routers')
-rw-r--r--routers/repo/branch.go5
-rw-r--r--routers/repo/issue.go11
-rw-r--r--routers/repo/pull.go5
-rw-r--r--routers/repo/repo.go14
4 files changed, 3 insertions, 32 deletions
diff --git a/routers/repo/branch.go b/routers/repo/branch.go
index 8c953f2ede..aed77cfaa5 100644
--- a/routers/repo/branch.go
+++ b/routers/repo/branch.go
@@ -26,11 +26,6 @@ func Branches(ctx *middleware.Context, params martini.Params) {
ctx.Data["Username"] = params["username"]
ctx.Data["Reponame"] = params["reponame"]
-
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
- ctx.Data["Branchname"] = params["branchname"]
ctx.Data["Branches"] = brs
ctx.Data["IsRepoToolbarBranches"] = true
diff --git a/routers/repo/issue.go b/routers/repo/issue.go
index ab070d724c..4e8324605c 100644
--- a/routers/repo/issue.go
+++ b/routers/repo/issue.go
@@ -30,12 +30,7 @@ func Issues(ctx *middleware.Context, params martini.Params) {
ctx.Handle(200, "issue.Issues: %v", err)
return
}
-
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
- ctx.Data["Branchname"] = params["branchname"]
- ctx.HTML(200, "issue/repo")
+ ctx.HTML(200, "issue/list")
}
func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.CreateIssueForm) {
@@ -57,10 +52,10 @@ func CreateIssue(ctx *middleware.Context, params martini.Params, form auth.Creat
return
}
- issue, err := models.CreateIssue(ctx.User.Id, form.RepoId, form.MilestoneId, form.AssigneeId,
+ issue, err := models.CreateIssue(ctx.User.Id, ctx.Repo.Repository.Id, form.MilestoneId, form.AssigneeId,
form.IssueName, form.Labels, form.Content, false)
if err == nil {
- log.Trace("%s Issue created: %d", form.RepoId, issue.Id)
+ log.Trace("%d Issue created: %d", ctx.Repo.Repository.Id, issue.Id)
ctx.Redirect(fmt.Sprintf("/%s/%s/issues/%d", params["username"], params["reponame"], issue.Index))
return
}
diff --git a/routers/repo/pull.go b/routers/repo/pull.go
index 16c60389da..93b6a9f7cc 100644
--- a/routers/repo/pull.go
+++ b/routers/repo/pull.go
@@ -12,10 +12,5 @@ import (
func Pulls(ctx *middleware.Context, params martini.Params) {
ctx.Data["IsRepoToolbarPulls"] = true
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
-
- ctx.Data["Branchname"] = params["branchname"]
ctx.HTML(200, "repo/pulls")
}
diff --git a/routers/repo/repo.go b/routers/repo/repo.go
index cd28d52caa..acf025a284 100644
--- a/routers/repo/repo.go
+++ b/routers/repo/repo.go
@@ -57,10 +57,6 @@ func Single(ctx *middleware.Context, params martini.Params) {
return
}
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
-
// Get tree path
treename := params["_1"]
@@ -177,7 +173,6 @@ func Single(ctx *middleware.Context, params martini.Params) {
ctx.Data["Username"] = params["username"]
ctx.Data["Reponame"] = params["reponame"]
- ctx.Data["Branchname"] = params["branchname"]
var treenames []string
Paths := make([]string, 0)
@@ -216,10 +211,6 @@ func SingleDownload(ctx *middleware.Context, params martini.Params) {
return
}
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
-
// Get tree path
treename := params["_1"]
@@ -290,11 +281,6 @@ func Setting(ctx *middleware.Context, params martini.Params) {
title = t
}
- if len(params["branchname"]) == 0 {
- params["branchname"] = "master"
- }
-
- ctx.Data["Branchname"] = params["branchname"]
ctx.Data["Title"] = title + " - settings"
ctx.HTML(200, "repo/setting")
}