This commit is contained in:
Unknown 2014-07-04 16:48:36 -04:00
parent 7f3015b32b
commit be8ac7fb75
6 changed files with 20 additions and 6 deletions

View File

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.4.5.0702 Alpha" const APP_VER = "0.4.5.0704 Alpha"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -215,7 +215,7 @@ func CreateUser(u *User) (*User, error) {
// GetUsers returns given number of user objects with offset. // GetUsers returns given number of user objects with offset.
func GetUsers(num, offset int) ([]User, error) { func GetUsers(num, offset int) ([]User, error) {
users := make([]User, 0, num) 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 return users, err
} }

View File

@ -687,9 +687,17 @@ func Comment(ctx *middleware.Context, params martini.Params) {
} }
// Notify watchers. // Notify watchers.
if err = models.NotifyWatchers(&models.Action{ActUserId: ctx.User.Id, ActUserName: ctx.User.Name, ActEmail: ctx.User.Email, act := &models.Action{
OpType: models.OP_COMMENT_ISSUE, Content: fmt.Sprintf("%d|%s", issue.Index, strings.Split(content, "\n")[0]), ActUserId: ctx.User.Id,
RepoId: ctx.Repo.Repository.Id, RepoName: ctx.Repo.Repository.Name, RefName: ""}); err != nil { 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) ctx.Handle(500, "issue.CreateIssue(NotifyWatchers)", err)
return return
} }

View File

@ -1 +1 @@
0.4.5.0702 Alpha 0.4.5.0704 Alpha

View File

@ -15,6 +15,7 @@
<input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" /> <input class="form-control input-lg" type="text" name="title" required="required" placeholder="Title" value="{{.title}}" />
</div> </div>
<div class="form-group panel-body"> <div class="form-group panel-body">
{{if .IsRepositoryOwner}}
<span><strong id="assigned" data-no-assigned="No one">No one</strong> will be assigned</span> <span><strong id="assigned" data-no-assigned="No one">No one</strong> will be assigned</span>
<input type="hidden" name="assigneeid" value="0" id="assignee"/>&nbsp;&nbsp; <input type="hidden" name="assigneeid" value="0" id="assignee"/>&nbsp;&nbsp;
<div style="display: inline-block;position: relative"> <div style="display: inline-block;position: relative">
@ -82,6 +83,7 @@
</div> </div>
</div> </div>
</div> </div>
{{end}}
<div class="form-group panel-body"> <div class="form-group panel-body">
<div class="md-help pull-right"><!-- todo help link --> <div class="md-help pull-right"><!-- todo help link -->
Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a> Content with <a href="https://help.github.com/articles/markdown-basics">Markdown</a>

View File

@ -119,6 +119,7 @@
<div class="issue-bar col-md-2"> <div class="issue-bar col-md-2">
<div class="labels" data-ajax="{{.Issue.Index}}/label"> <div class="labels" data-ajax="{{.Issue.Index}}/label">
{{if .IsRepositoryOwner}}
<div class="pull-right action"> <div class="pull-right action">
<button class="btn btn-default btn-sm" data-toggle="dropdown"> <button class="btn btn-default btn-sm" data-toggle="dropdown">
<i class="fa fa-tags"></i> <i class="fa fa-tags"></i>
@ -136,6 +137,7 @@
</ul> </ul>
</div> </div>
</div> </div>
{{end}}
<h4>Labels</h4> <h4>Labels</h4>
{{if .Issue.Labels}} {{if .Issue.Labels}}
{{range .Issue.Labels}} {{range .Issue.Labels}}
@ -147,6 +149,7 @@
</div> </div>
<div class="milestone" data-milestone="{{.Milestone.Id}}" data-ajax="{{.Issue.Index}}/milestone"> <div class="milestone" data-milestone="{{.Milestone.Id}}" data-ajax="{{.Issue.Index}}/milestone">
<div class="pull-right action"> <div class="pull-right action">
{{if .IsRepositoryOwner}}
<button class="btn btn-default btn-sm" data-toggle="dropdown"> <button class="btn btn-default btn-sm" data-toggle="dropdown">
<i class="fa fa-check-square-o"></i> <i class="fa fa-check-square-o"></i>
<span class="caret"></span> <span class="caret"></span>
@ -193,6 +196,7 @@
</li> </li>
</ul> </ul>
</div> </div>
{{end}}
</div> </div>
<h4>Milestone</h4> <h4>Milestone</h4>
{{if .Milestone}} {{if .Milestone}}