diff options
author | Unknown <joe2010xtmf@163.com> | 2014-03-25 12:12:27 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-03-25 12:12:27 -0400 |
commit | 2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf (patch) | |
tree | 7fdae59ac504c0aedd0a657ff9a9bd9f30de3b22 /modules | |
parent | 23d103c72163cdb4ea65c9756edf22c597060a7e (diff) | |
download | gitea-2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf.tar.gz gitea-2fa8d0c8dd43f95e1659a266e84c7713cc8f2fcf.zip |
Added create issue
Diffstat (limited to 'modules')
-rw-r--r-- | modules/auth/issue.go | 9 | ||||
-rw-r--r-- | modules/avatar/avatar.go | 3 | ||||
-rw-r--r-- | modules/base/tool.go | 5 | ||||
-rw-r--r-- | modules/middleware/repo.go | 5 |
4 files changed, 14 insertions, 8 deletions
diff --git a/modules/auth/issue.go b/modules/auth/issue.go index e2b1f9f2a7..8bf49684c6 100644 --- a/modules/auth/issue.go +++ b/modules/auth/issue.go @@ -17,9 +17,8 @@ import ( ) type CreateIssueForm struct { - IssueName string `form:"name" binding:"Required;MaxSize(50)"` - RepoId int64 `form:"repoid" binding:"Required"` - MilestoneId int64 `form:"milestoneid" binding:"Required"` + IssueName string `form:"title" binding:"Required;MaxSize(50)"` + MilestoneId int64 `form:"milestoneid"` AssigneeId int64 `form:"assigneeid"` Labels string `form:"labels"` Content string `form:"content"` @@ -27,9 +26,7 @@ type CreateIssueForm struct { func (f *CreateIssueForm) Name(field string) string { names := map[string]string{ - "IssueName": "Issue name", - "RepoId": "Repository ID", - "MilestoneId": "Milestone ID", + "IssueName": "Issue name", } return names[field] } diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index 3b423a6d15..449c9656dc 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -30,8 +30,9 @@ import ( "sync" "time" - "github.com/gogits/gogs/modules/log" "github.com/nfnt/resize" + + "github.com/gogits/gogs/modules/log" ) var ( diff --git a/modules/base/tool.go b/modules/base/tool.go index 0dec7aa8dd..c23f5de6cc 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -102,7 +102,10 @@ func CreateTimeLimitCode(data string, minutes int, startInf interface{}) string // AvatarLink returns avatar link by given e-mail. func AvatarLink(email string) string { - return "/avatar/" + EncodeMd5(email) + if Service.EnableCacheAvatar { + return "/avatar/" + EncodeMd5(email) + } + return "http://1.gravatar.com/avatar/" + EncodeMd5(email) } // Seconds-based time units diff --git a/modules/middleware/repo.go b/modules/middleware/repo.go index b23bccb104..bc90c05cc7 100644 --- a/modules/middleware/repo.go +++ b/modules/middleware/repo.go @@ -76,6 +76,11 @@ func RepoAssignment(redirect bool) martini.Handler { ctx.Repo.CloneLink.SSH = fmt.Sprintf("%s@%s:%s/%s.git", base.RunUser, base.Domain, user.LowerName, repo.LowerName) ctx.Repo.CloneLink.HTTPS = fmt.Sprintf("%s://%s/%s/%s.git", scheme, base.Domain, user.LowerName, repo.LowerName) + if len(params["branchname"]) == 0 { + params["branchname"] = "master" + } + ctx.Data["Branchname"] = params["branchname"] + ctx.Data["IsRepositoryValid"] = true ctx.Data["Repository"] = repo ctx.Data["Owner"] = user |