diff options
Diffstat (limited to 'templates/repo/issue')
-rw-r--r-- | templates/repo/issue/labels.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/issue/milestone_new.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/milestones.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/issue/view_content.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/issue/view_content/comments.tmpl | 2 | ||||
-rw-r--r-- | templates/repo/issue/view_content/sidebar.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/issue/view_title.tmpl | 2 |
7 files changed, 17 insertions, 17 deletions
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl index 38d9145206..c89d3740ee 100644 --- a/templates/repo/issue/labels.tmpl +++ b/templates/repo/issue/labels.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> <div class="navbar"> {{template "repo/issue/navbar" .}} - {{if .IsRepositoryWriter}} + {{if or .CanWriteIssues .CanWritePulls}} <div class="ui right"> <div class="ui green new-label button">{{.i18n.Tr "repo.issues.new_label"}}</div> </div> @@ -57,7 +57,7 @@ {{template "base/alert" .}} <div class="ui black label">{{.i18n.Tr "repo.issues.label_count" .NumLabels}}</div> <div class="label list"> - {{if and $.IsRepositoryWriter (eq .NumLabels 0)}} + {{if and (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0)}} <div class="ui centered grid"> <div class="twelve wide column eight wide computer column"> <div class="ui attached left aligned segment"> @@ -105,7 +105,7 @@ <a class="ui right open-issues" href="{{$.RepoLink}}/issues?labels={{.ID}}"><i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.label_open_issues" .NumOpenIssues}}</a> </div> <div class="three wide column"> - {{if $.IsRepositoryWriter}} + {{if or $.CanWriteIssues $.CanWritePulls}} <a class="ui right delete-button" href="#" data-url="{{$.RepoLink}}/labels/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a> <a class="ui right edit-label-button" href="#" data-id="{{.ID}}" data-title="{{.Name}}" data-description="{{.Description}}" data-color={{.Color}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> {{end}} @@ -117,7 +117,7 @@ </div> </div> -{{if .IsRepositoryWriter}} +{{if or $.CanWriteIssues $.CanWritePulls}} <div class="ui small basic delete modal"> <div class="ui icon header"> <i class="trash icon"></i> diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl index bd2f79389a..30a7d7ebbb 100644 --- a/templates/repo/issue/milestone_new.tmpl +++ b/templates/repo/issue/milestone_new.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> <div class="navbar"> {{template "repo/issue/navbar" .}} - {{if and .IsRepositoryWriter .PageIsEditMilestone}} + {{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}} <div class="ui right floated secondary menu"> <a class="ui green button" href="{{$.RepoLink}}/milestones/new">{{.i18n.Tr "repo.milestones.new"}}</a> </div> diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl index 75bd8db8ed..7b98c0cf56 100644 --- a/templates/repo/issue/milestones.tmpl +++ b/templates/repo/issue/milestones.tmpl @@ -4,7 +4,7 @@ <div class="ui container"> <div class="navbar"> {{template "repo/issue/navbar" .}} - {{if .IsRepositoryWriter}} + {{if or .CanWriteIssues .CanWritePulls}} <div class="ui right"> <a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a> </div> @@ -67,7 +67,7 @@ {{if .TotalTrackedTime}}<i class="octicon octicon-clock"></i> {{.TotalTrackedTime|Sec2Time}}{{end}} </span> </div> - {{if $.IsRepositoryWriter}} + {{if or $.CanWriteIssues $.CanWritePulls}} <div class="ui right operate"> <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a> {{if .IsClosed}} @@ -111,7 +111,7 @@ </div> </div> -{{if .IsRepositoryWriter}} +{{if or .CanWriteIssues .CanWritePulls}} <div class="ui small basic delete modal"> <div class="ui icon header"> <i class="trash icon"></i> diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index e133ee9dc3..54531cf4d8 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -20,7 +20,7 @@ <span class="text grey"><a {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>{{.Issue.Poster.Name}}</a> {{.i18n.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr | Safe}}</span> <div class="ui right actions"> {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} - {{if .IsIssueOwner}} + {{if or .IsIssueWriter .IsIssuePoster}} <div class="item action"> <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a> </div> @@ -79,7 +79,7 @@ {{.CsrfTokenHtml}} <input id="status" name="status" type="hidden"> <div class="text right"> - {{if and .IsIssueOwner (not .DisableStatusChange)}} + {{if and (or .IsIssueWriter .IsIssuePoster) (not .DisableStatusChange)}} {{if .Issue.IsClosed}} <div id="status-button" class="ui green basic button" tabindex="6" data-status="{{.i18n.Tr "repo.issues.reopen_issue"}}" data-status-and-comment="{{.i18n.Tr "repo.issues.reopen_comment_issue"}}" data-status-val="reopen"> {{.i18n.Tr "repo.issues.reopen_issue"}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 4e79fd866c..953aa4c2f0 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -23,7 +23,7 @@ </div> {{end}} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) }} - {{if or $.IsRepositoryAdmin (eq .Poster.ID $.SignedUserID)}} + {{if or $.Permission.IsAdmin (eq .Poster.ID $.SignedUserID)}} <div class="item action"> <a class="edit-content" href="#"><i class="octicon octicon-pencil"></i></a> <a class="delete-comment" href="#" data-comment-id={{.HashTag}} data-url="{{$.RepoLink}}/comments/{{.ID}}/delete" data-locale="{{$.i18n.Tr "repo.issues.delete_comment_confirm"}}"><i class="octicon octicon-x"></i></a> diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index fa7a05512d..ee8ed0e1a1 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -2,7 +2,7 @@ <div class="ui segment metas"> {{template "repo/issue/branch_selector_field" .}} - <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-label dropdown"> + <div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-label dropdown"> <span class="text"> <strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong> <span class="octicon octicon-gear"></span> @@ -27,7 +27,7 @@ <div class="ui divider"></div> - <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-milestone dropdown"> + <div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-milestone dropdown"> <span class="text"> <strong>{{.i18n.Tr "repo.issues.new.milestone"}}</strong> <span class="octicon octicon-gear"></span> @@ -68,7 +68,7 @@ <div class="ui divider"></div> <input id="assignee_id" name="assignee_id" type="hidden" value="{{.assignee_id}}"> - <div class="ui {{if not .IsRepositoryWriter}}disabled{{end}} floating jump select-assignees-modify dropdown"> + <div class="ui {{if not .IsIssueWriter}}disabled{{end}} floating jump select-assignees-modify dropdown"> <span class="text"> <strong>{{.i18n.Tr "repo.issues.new.assignees"}}</strong> <span class="octicon octicon-gear"></span> @@ -223,7 +223,7 @@ {{if .Issue.IsOverdue}} <span style="color: red;">{{.i18n.Tr "repo.issues.due_date_overdue"}}</span> {{end}} - {{if and .IsSigned .IsRepositoryWriter}} + {{if .IsIssueWriter}} <br/> <a style="cursor:pointer;" onclick="toggleDeadlineForm();"><i class="edit icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_edit"}}</a> - <a style="cursor:pointer;" onclick="updateDeadline('');"><i class="remove icon"></i>{{$.i18n.Tr "repo.issues.due_date_form_remove"}}</a> @@ -233,7 +233,7 @@ <p><i>{{.i18n.Tr "repo.issues.due_date_not_set"}}</i></p> {{end}} - {{if and .IsSigned .IsRepositoryWriter}} + {{if .IsIssueWriter}} <div {{if ne .Issue.DeadlineUnix 0}} style="display: none;"{{end}} id="deadlineForm"> <form class="ui fluid action input" action="{{AppSubUrl}}/api/v1/repos/{{.Repository.Owner.Name}}/{{.Repository.Name}}/issues/{{.Issue.Index}}" method="post" id="update-issue-deadline-form" onsubmit="setDeadline();return false;"> {{$.CsrfTokenHtml}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl index d69f699ac1..b9edd0b562 100644 --- a/templates/repo/issue/view_title.tmpl +++ b/templates/repo/issue/view_title.tmpl @@ -6,7 +6,7 @@ <input value="{{.Issue.Title}}"> </div> </h1> - {{if .IsIssueOwner}} + {{if or .IsIssueWriter .IsIssuePoster}} <div class="four wide column"> <div class="edit-zone text right"> <div id="edit-title" class="ui basic green not-in-edit button">{{.i18n.Tr "repo.issues.edit"}}</div> |