diff --git a/README.md b/README.md index 504c21975ba8..e947d7739a04 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) +Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge") ===================== Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language. @@ -7,7 +7,9 @@ Gogs(Go Git Service) is a Self Hosted Git Service in the Go Programming Language ##### Current version: 0.1.6 Alpha -[简体中文](README_ZH.md) +#### Other language version + +- [简体中文](README_ZH.md) ## Purpose diff --git a/README_ZH.md b/README_ZH.md index 0ab8dfdd0725..78e26fada45d 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -1,4 +1,4 @@ -Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) +Gogs - Go Git Service [![wercker status](https://app.wercker.com/status/ad0bdb0bc450ac6f09bc56b9640a50aa/s/ "wercker status")](https://app.wercker.com/project/bykey/ad0bdb0bc450ac6f09bc56b9640a50aa) [![Build Status](https://drone.io/github.com/gogits/gogs/status.png)](https://drone.io/github.com/gogits/gogs/latest) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/gogits/gogs/trend.png)](https://bitdeli.com/free "Bitdeli Badge") ===================== Gogs(Go Git Service) 是一个由 Go 语言编写的自助 Git 托管服务。 diff --git a/models/action.go b/models/action.go index ca2ff3cbf177..117492935473 100644 --- a/models/action.go +++ b/models/action.go @@ -8,6 +8,7 @@ import ( "encoding/json" "time" + "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/modules/log" ) @@ -47,18 +48,17 @@ func (a Action) GetRepoName() string { return a.RepoName } +func (a Action) GetBranch() string { + return a.RefName +} + func (a Action) GetContent() string { return a.Content } -type PushCommits struct { - Len int - Commits [][]string -} - // CommitRepoAction records action for commit repository. func CommitRepoAction(userId int64, userName string, - repoId int64, repoName string, refName string, commits *PushCommits) error { + repoId int64, repoName string, refName string, commits *base.PushCommits) error { bs, err := json.Marshal(commits) if err != nil { return err diff --git a/models/issue.go b/models/issue.go index f78c240cbc46..929567b1b732 100644 --- a/models/issue.go +++ b/models/issue.go @@ -83,42 +83,42 @@ func GetIssues(userId, repoId, posterId, milestoneId int64, page int, isClosed, sess := orm.Limit(20, (page-1)*20) if repoId > 0 { - sess = sess.Where("repo_id=?", repoId).And("is_closed=?", isClosed) + sess.Where("repo_id=?", repoId).And("is_closed=?", isClosed) } else { - sess = sess.Where("is_closed=?", isClosed) + sess.Where("is_closed=?", isClosed) } if userId > 0 { - sess = sess.And("assignee_id=?", userId) + sess.And("assignee_id=?", userId) } else if posterId > 0 { - sess = sess.And("poster_id=?", posterId) + sess.And("poster_id=?", posterId) } else if isMention { - sess = sess.And("mentions like '%$" + base.ToStr(userId) + "|%'") + sess.And("mentions like '%$" + base.ToStr(userId) + "|%'") } if milestoneId > 0 { - sess = sess.And("milestone_id=?", milestoneId) + sess.And("milestone_id=?", milestoneId) } if len(labels) > 0 { for _, label := range strings.Split(labels, ",") { - sess = sess.And("mentions like '%$" + label + "|%'") + sess.And("mentions like '%$" + label + "|%'") } } switch sortType { case "oldest": - sess = sess.Asc("created") + sess.Asc("created") case "recentupdate": - sess = sess.Desc("updated") + sess.Desc("updated") case "leastupdate": - sess = sess.Asc("updated") + sess.Asc("updated") case "mostcomment": - sess = sess.Desc("num_comments") + sess.Desc("num_comments") case "leastcomment": - sess = sess.Asc("num_comments") + sess.Asc("num_comments") default: - sess = sess.Desc("created") + sess.Desc("created") } var issues []Issue diff --git a/modules/base/tool.go b/modules/base/tool.go index c7ee2ee8577d..b48566f542ce 100644 --- a/modules/base/tool.go +++ b/modules/base/tool.go @@ -471,6 +471,7 @@ type Actioner interface { GetOpType() int GetActUserName() string GetRepoName() string + GetBranch() string GetContent() string } @@ -493,25 +494,34 @@ const ( TPL_COMMIT_REPO_LI = `
{{.Repository.Description}}{{if .Repository.Website}}{{.Repository.Website}}{{end}}
+{{.Repository.Description}}{{if .Repository.Website}} {{.Repository.Website}}{{end}}
Need help cloning? Visit Help!
{{.ErrorMsg}}
{{end}} + {{if .IsSuccess}}Repository option has been successfully updated.
{{else if .HasError}}{{.ErrorMsg}}
{{end}}