summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
Diffstat (limited to 'templates')
-rw-r--r--templates/repo/issue/list.tmpl21
-rw-r--r--templates/repo/issue/milestone_issues.tmpl21
-rw-r--r--templates/repo/issue/view_content/comments.tmpl22
-rw-r--r--templates/repo/issue/view_content/pull.tmpl22
-rw-r--r--templates/repo/issue/view_content/sidebar.tmpl91
-rw-r--r--templates/user/dashboard/issues.tmpl21
6 files changed, 181 insertions, 17 deletions
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 05018bacdd..4fe0aaa00d 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -271,14 +271,25 @@
{{if .IsPull}}
{{$approveOfficial := call $approvalCounts .ID "approve"}}
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
- {{if or (gt $approveOfficial 0) (gt $rejectOfficial 0)}}
+ {{$waitingOfficial := call $approvalCounts .ID "waiting"}}
+ {{if gt $approveOfficial 0}}
<span class="approvals">{{svg "octicon-check" 16}}
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
- {{if or (gt $rejectOfficial 0)}}
- <span class="rejects">{{svg "octicon-x" 16}}
- {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
- {{end}}
+ </span>
{{end}}
+
+ {{if gt $rejectOfficial 0}}
+ <span class="rejects">{{svg "octicon-request-changes" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
+ </span>
+ {{end}}
+
+ {{if gt $waitingOfficial 0}}
+ <span class="waiting">{{svg "octicon-eye" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
+ </span>
+ {{end}}
+
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
{{end}}
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
index d144a97f14..5307c05733 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -241,14 +241,25 @@
{{if .IsPull}}
{{$approveOfficial := call $approvalCounts .ID "approve"}}
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
- {{if or (gt $approveOfficial 0) (gt $rejectOfficial 0)}}
+ {{$waitingOfficial := call $approvalCounts .ID "waiting"}}
+ {{if gt $approveOfficial 0}}
<span class="approvals">{{svg "octicon-check" 16}}
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
- {{if or (gt $rejectOfficial 0)}}
- <span class="rejects">{{svg "octicon-x" 16}}
- {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
- {{end}}
+ </span>
{{end}}
+
+ {{if gt $rejectOfficial 0}}
+ <span class="rejects">{{svg "octicon-request-changes" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
+ </span>
+ {{end}}
+
+ {{if gt $waitingOfficial 0}}
+ <span class="waiting">{{svg "octicon-eye" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
+ </span>
+ {{end}}
+
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
{{end}}
diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl
index bb8188def9..022e96a02e 100644
--- a/templates/repo/issue/view_content/comments.tmpl
+++ b/templates/repo/issue/view_content/comments.tmpl
@@ -7,7 +7,7 @@
13 = STOP_TRACKING, 14 = ADD_TIME_MANUAL, 16 = ADDED_DEADLINE, 17 = MODIFIED_DEADLINE,
18 = REMOVED_DEADLINE, 19 = ADD_DEPENDENCY, 20 = REMOVE_DEPENDENCY, 21 = CODE,
22 = REVIEW, 23 = ISSUE_LOCKED, 24 = ISSUE_UNLOCKED, 25 = TARGET_BRANCH_CHANGED,
- 26 = DELETE_TIME_MANUAL -->
+ 26 = DELETE_TIME_MANUAL, 27 = REVIEW_REQUEST -->
{{if eq .Type 0}}
<div class="comment" id="{{.HashTag}}">
{{if .OriginalAuthor }}
@@ -468,5 +468,25 @@
<span class="text grey">{{.Content}}</span>
</div>
</div>
+ {{else if eq .Type 27}}
+ <div class="event" id="{{.HashTag}}">
+ <span class="issue-symbol">{{svg "octicon-eye" 16}}</span>
+ <a class="ui avatar image" href="{{.Poster.HomeLink}}">
+ <img src="{{.Poster.RelAvatarLink}}">
+ </a>
+ <span class="text grey">
+ <a href="{{.Poster.HomeLink}}">{{.Poster.GetDisplayName}}</a>
+ {{if .RemovedAssignee}}
+ {{if eq .PosterID .AssigneeID}}
+ {{$.i18n.Tr "repo.issues.review.remove_review_request_self" $createdStr | Safe}}
+ {{else}}
+ {{$.i18n.Tr "repo.issues.review.remove_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
+ {{end}}
+ {{else}}
+ {{$.i18n.Tr "repo.issues.review.add_review_request" (.Assignee.GetDisplayName|Escape) $createdStr | Safe}}
+ {{end}}
+ </span>
+ </div>
+
{{end}}
{{end}}
diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl
index c7cf737b34..09c7cd1d9f 100644
--- a/templates/repo/issue/view_content/pull.tmpl
+++ b/templates/repo/issue/view_content/pull.tmpl
@@ -10,7 +10,25 @@
<span class="type-icon text {{if eq .Type 1}}green
{{- else if eq .Type 2}}grey
{{- else if eq .Type 3}}red
- {{- else}}grey{{end}}">
+ {{- else if eq .Type 4}}yellow
+ {{else}}grey{{end}}">
+
+ {{$canChoose := false}}
+ {{if eq .Type 4}}
+ {{if or (eq .ReviewerID $.SignedUserID) $.Permission.IsAdmin}}
+ {{$canChoose = true}}
+ {{end}}
+ {{else}}
+ {{if and (or $.IsIssuePoster $.CanChooseReviewer) (not (eq $.SignedUserID .ReviewerID))}}
+ {{$canChoose = true}}
+ {{end}}
+ {{end}}
+
+ {{if $canChoose }}
+ <a href="#" class="ui poping up icon re-request-review" data-is-checked="{{if eq .Type 4}}remove{{else}}add{{end}}" data-issue-id="{{$.Issue.ID}}" data-content="{{ if eq .Type 4 }} {{$.i18n.Tr "repo.issues.remove_request_review"}} {{else}} {{$.i18n.Tr "repo.issues.re_request_review"}} {{end}}" data-id="{{.ReviewerID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
+ {{svg "octicon-sync" 16}}
+ </a>
+ {{end}}
{{svg (printf "octicon-%s" .Type.Icon) 16}}
</span>
{{if .Stale}}
@@ -28,6 +46,8 @@
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
{{else if eq .Type 3}}
{{$.i18n.Tr "repo.issues.review.reject" $createdStr | Safe}}
+ {{else if eq .Type 4}}
+ {{$.i18n.Tr "repo.issues.review.wait" $createdStr | Safe}}
{{else}}
{{$.i18n.Tr "repo.issues.review.comment" $createdStr | Safe}}
{{end}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index 2aed8f3158..941141b55f 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -2,6 +2,97 @@
<div class="ui segment metas">
{{template "repo/issue/branch_selector_field" .}}
+ {{if .Issue.IsPull }}
+
+ <input id="reviewer_id" name="reviewer_id" type="hidden" value="{{.reviewer_id}}">
+ <div class="ui {{if or (not .CanChooseReviewer) .Repository.IsArchived}}disabled{{end}} floating jump select-reviewers-modify dropdown">
+ <span class="text">
+ <strong>{{.i18n.Tr "repo.issues.review.reviewers"}}</strong>
+ {{if and .CanChooseReviewer (not .Repository.IsArchived)}}
+ {{svg "octicon-gear" 16}}
+ {{end}}
+ </span>
+ <div class="filter menu" data-action="" data-issue-id="{{$.Issue.ID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
+ <div class="header" style="text-transform: none;font-size:16px;">{{.i18n.Tr "repo.issues.new.add_reviewer_title"}}</div>
+ {{if .Reviewers}}
+ <div class="ui icon search input">
+ <i class="search icon"></i>
+ <input type="text" placeholder="{{.i18n.Tr "repo.issues.filter_reviewers"}}">
+ </div>
+ {{end}}
+ {{range .Reviewers}}
+ {{$ReviewerID := .ID}}
+ {{$checked := false}}
+ {{$canChoose := false}}
+ {{$notReviewed := true}}
+
+ {{range $.PullReviewers}}
+ {{if eq .ReviewerID $ReviewerID }}
+ {{$notReviewed = false }}
+ {{if eq .Type 4 }}
+ {{$checked = true}}
+ {{if or (eq $ReviewerID $.SignedUserID) $.Permission.IsAdmin}}
+ {{$canChoose = true}}
+ {{end}}
+ {{else}}
+ {{$canChoose = true}}
+ {{end}}
+ {{end}}
+ {{end}}
+
+ {{ if $notReviewed}}
+ {{$canChoose = true}}
+ {{end}}
+
+ <a class="{{if not $canChoose}}ui poping up{{end}} item {{if $checked}} checked {{end}}" href="#" data-id="{{.ID}}" data-id-selector="#review_request_{{.ID}}" data-can-change="{{if not $canChoose}}block{{end}}" {{if not $canChoose}} data-content="{{$.i18n.Tr "repo.issues.remove_request_review_block"}}"{{end}} data-is-checked="{{if $checked}}add{{else}}remove{{end}}">
+ <span class="octicon-check {{if not $checked}}invisible{{end}}">{{svg "octicon-check" 16}}</span>
+ <span class="text">
+ <img class="ui avatar image" src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
+ </span>
+ </a>
+ {{end}}
+ </div>
+ </div>
+
+ <div class="ui assignees list">
+ <span class="no-select item {{if .PullReviewers}}hide{{end}}">{{.i18n.Tr "repo.issues.new.no_reviewers"}}</span>
+ <div class="selected">
+ {{range .PullReviewers}}
+ <div class="item" style="margin-bottom: 10px;">
+ <a href="{{.Reviewer.HomeLink}}"><img class="ui avatar image" src="{{.Reviewer.RelAvatarLink}}">&nbsp;{{.Reviewer.GetDisplayName}}</a>
+ <span class="ui right type-icon text {{if eq .Type 1}}green
+ {{- else if eq .Type 2}}grey
+ {{- else if eq .Type 3}}red
+ {{- else if eq .Type 4}}yellow
+ {{- else}}grey{{end}} right ">
+
+ {{$canChoose := false}}
+ {{if eq .Type 4}}
+ {{if or (eq .ReviewerID $.SignedUserID) $.Permission.IsAdmin}}
+ {{$canChoose = true}}
+ {{end}}
+ {{else}}
+ {{if and (or $.IsIssuePoster $.CanChooseReviewer) (not (eq $.SignedUserID .ReviewerID))}}
+ {{$canChoose = true}}
+ {{end}}
+ {{end}}
+
+ {{if $canChoose}}
+ <a href="#" class="ui poping up icon re-request-review" data-is-checked="{{if eq .Type 4}}remove{{else}}add{{end}}" data-content="{{ if eq .Type 4 }} {{$.i18n.Tr "repo.issues.remove_request_review"}} {{else}} {{$.i18n.Tr "repo.issues.re_request_review"}} {{end}}" data-issue-id="{{$.Issue.ID}}" data-id="{{.ReviewerID}}" data-update-url="{{$.RepoLink}}/issues/request_review">
+ {{svg "octicon-sync" 16}}
+ </a>
+ {{end}}
+ {{svg (printf "octicon-%s" .Type.Icon) 16}}
+ </span>
+ </div>
+ {{end}}
+ </div>
+ </div>
+
+ {{end}}
+
+ <div class="ui divider"></div>
+
<div class="ui {{if or (not .HasIssuesOrPullsWritePermission) .Repository.IsArchived}}disabled{{end}} floating jump select-label dropdown">
<span class="text">
<strong>{{.i18n.Tr "repo.issues.new.labels"}}</strong>
diff --git a/templates/user/dashboard/issues.tmpl b/templates/user/dashboard/issues.tmpl
index 447801d849..780c8c1257 100644
--- a/templates/user/dashboard/issues.tmpl
+++ b/templates/user/dashboard/issues.tmpl
@@ -173,14 +173,25 @@
{{if .IsPull}}
{{$approveOfficial := call $approvalCounts .ID "approve"}}
{{$rejectOfficial := call $approvalCounts .ID "reject"}}
- {{if or (gt $approveOfficial 0) (gt $rejectOfficial 0) }}
+ {{$waitingOfficial := call $approvalCounts .ID "waiting"}}
+ {{if gt $approveOfficial 0}}
<span class="approvals">{{svg "octicon-check" 16}}
{{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
- {{if or (gt $rejectOfficial 0)}}
- <span class="rejects">{{svg "octicon-x" 16}}
- {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
- {{end}}
+ </span>
+ {{end}}
+
+ {{if gt $rejectOfficial 0}}
+ <span class="rejects">{{svg "octicon-request-changes" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
+ </span>
{{end}}
+
+ {{if gt $waitingOfficial 0}}
+ <span class="waiting">{{svg "octicon-eye" 16}}
+ {{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
+ </span>
+ {{end}}
+
{{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
<span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
{{end}}