From be8ac7fb75a389402929dd726f39bbbbdb9a6531 Mon Sep 17 00:00:00 2001 From: Unknown Date: Fri, 4 Jul 2014 16:48:36 -0400 Subject: [PATCH] fix #273 --- gogs.go | 2 +- models/user.go | 2 +- routers/repo/issue.go | 14 +++++++++++--- templates/VERSION | 2 +- templates/repo/issue/create.tmpl | 2 ++ templates/repo/issue/view.tmpl | 4 ++++ 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/gogs.go b/gogs.go index df736647cd..7207baaade 100644 --- a/gogs.go +++ b/gogs.go @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.4.5.0702 Alpha" +const APP_VER = "0.4.5.0704 Alpha" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/user.go b/models/user.go index d273d57f9f..b98e81babe 100644 --- a/models/user.go +++ b/models/user.go @@ -215,7 +215,7 @@ func CreateUser(u *User) (*User, error) { // GetUsers returns given number of user objects with offset. func GetUsers(num, offset int) ([]User, error) { users := make([]User, 0, num) - err := x.Limit(num, offset).Asc("id").Find(&users) + err := x.Limit(num, offset).Where("type=0").Asc("id").Find(&users) return users, err } diff --git a/routers/repo/issue.go b/routers/repo/issue.go index cf454bc8fb..5fe9ebc390 100644 --- a/routers/repo/issue.go +++ b/routers/repo/issue.go @@ -687,9 +687,17 @@ func Comment(ctx *middleware.Context, params martini.Params) { } // Notify watchers. - if err = models.NotifyWatchers(&models.Action{ActUserId: ctx.User.Id, ActUserName: ctx.User.Name, ActEmail: ctx.User.Email, - OpType: models.OP_COMMENT_ISSUE, Content: fmt.Sprintf("%d|%s", issue.Index, strings.Split(content, "\n")[0]), - RepoId: ctx.Repo.Repository.Id, RepoName: ctx.Repo.Repository.Name, RefName: ""}); err != nil { + act := &models.Action{ + ActUserId: ctx.User.Id, + ActUserName: ctx.User.LowerName, + ActEmail: ctx.User.Email, + OpType: models.OP_COMMENT_ISSUE, + Content: fmt.Sprintf("%d|%s", issue.Index, strings.Split(content, "\n")[0]), + RepoId: ctx.Repo.Repository.Id, + RepoUserName: ctx.Repo.Owner.LowerName, + RepoName: ctx.Repo.Repository.LowerName, + } + if err = models.NotifyWatchers(act); err != nil { ctx.Handle(500, "issue.CreateIssue(NotifyWatchers)", err) return } diff --git a/templates/VERSION b/templates/VERSION index 8777e13060..6237548bbc 100644 --- a/templates/VERSION +++ b/templates/VERSION @@ -1 +1 @@ -0.4.5.0702 Alpha \ No newline at end of file +0.4.5.0704 Alpha \ No newline at end of file diff --git a/templates/repo/issue/create.tmpl b/templates/repo/issue/create.tmpl index 34cecc78bd..b548b1e749 100644 --- a/templates/repo/issue/create.tmpl +++ b/templates/repo/issue/create.tmpl @@ -15,6 +15,7 @@
+ {{if .IsRepositoryOwner}} No one will be assigned   
@@ -82,6 +83,7 @@
+ {{end}}
Content with Markdown diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl index ba1fe16b79..d95fba40d8 100644 --- a/templates/repo/issue/view.tmpl +++ b/templates/repo/issue/view.tmpl @@ -119,6 +119,7 @@
+ {{if .IsRepositoryOwner}}
+ {{end}}

Labels

{{if .Issue.Labels}} {{range .Issue.Labels}} @@ -147,6 +149,7 @@
+ {{if .IsRepositoryOwner}}
+ {{end}}

Milestone

{{if .Milestone}}