Added create issue

This commit is contained in:
Unknown 2014-03-25 12:12:27 -04:00
parent 23d103c721
commit 2fa8d0c8dd
14 changed files with 34 additions and 52 deletions

View file

@ -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]
}

View file

@ -30,8 +30,9 @@ import (
"sync"
"time"
"github.com/gogits/gogs/modules/log"
"github.com/nfnt/resize"
"github.com/gogits/gogs/modules/log"
)
var (

View file

@ -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

View file

@ -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