diff --git a/CODEOWNERS b/CODEOWNERS
index 88c71ba17e..e30d2c42b4 100644
--- a/CODEOWNERS
+++ b/CODEOWNERS
@@ -16,6 +16,8 @@ web_src/.* @caesar @crystal @gusted
# HTML templates used by the backend.
templates/.* @caesar @crystal @gusted
+## the issue sidebar was touched by fnetx
+templates/repo/issue/view_content/sidebar.* @fnetx
# Files related to Go development.
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index 88a6c39e52..465cb44f6f 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -47,7 +47,7 @@
- {{template "repo/issue/branch_selector_field" .}}
+ {{template "repo/issue/view_content/sidebar/branch_selector_field" .}}
{{template "repo/issue/labels/labels_selector_field" .}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl
index cbea32d303..ba15539841 100644
--- a/templates/repo/issue/view_content/sidebar.tmpl
+++ b/templates/repo/issue/view_content/sidebar.tmpl
@@ -1,129 +1,8 @@
- {{template "repo/issue/branch_selector_field" .}}
+ {{template "repo/issue/view_content/sidebar/branch_selector_field" .}}
{{if .Issue.IsPull}}
-
-
-
-
-
{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}
-
- {{range .PullReviewers}}
-
-
- {{if .User}}
-
- {{else if .Team}}
- {{svg "octicon-people" 20 "tw-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
- {{end}}
-
-
- {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged))}}
-
- {{svg "octicon-x" 20}}
-
-
-
-
-
- {{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}}
-
-
-
-
- {{end}}
- {{if .Review.Stale}}
-
- {{svg "octicon-hourglass" 16}}
-
- {{end}}
- {{if and .CanChange (or .Checked (and (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged)))}}
-
{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}
- {{end}}
- {{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}}
-
-
- {{end}}
- {{range .OriginalReviews}}
-
-
-
- {{svg (printf "octicon-%s" .Type.Icon) 16 (printf "text %s" (.HTMLTypeColorName))}}
-
-
- {{end}}
-
-
- {{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed)}}
-
- {{end}}
+ {{template "repo/issue/view_content/sidebar/pull_review" .}}
+ {{template "repo/issue/view_content/sidebar/pull_wip" .}}
{{end}}
@@ -132,567 +11,56 @@
-
-
-
{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}
-
- {{if .Issue.Milestone}}
-
- {{end}}
-
-
-
+ {{template "repo/issue/view_content/sidebar/milestones" .}}
-
-
-
{{ctx.Locale.Tr "repo.issues.new.no_projects"}}
-
- {{if .Issue.Project}}
-
- {{end}}
-
-
-
+ {{template "repo/issue/view_content/sidebar/projects" .}}
-
-
-
-
{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}
-
- {{range .Issue.Assignees}}
-
-
-
- {{end}}
-
-
-
+ {{template "repo/issue/view_content/sidebar/assignees" .}}
{{if .Participants}}
-
{{ctx.Locale.TrN .NumParticipants "repo.issues.num_participants_one" "repo.issues.num_participants_few" .NumParticipants}}
-
+ {{template "repo/issue/view_content/sidebar/participants" .}}
{{end}}
{{if and $.IssueWatch (not .Repository.IsArchived)}}
-
-
{{ctx.Locale.Tr "notification.notifications"}}
-
- {{template "repo/issue/view_content/watching" .}}
-
-
+ {{template "repo/issue/view_content/sidebar/watch" .}}
{{end}}
+
{{if .Repository.IsTimetrackerEnabled $.Context}}
- {{if and .CanUseTimetracker (not .Repository.IsArchived)}}
-
-
-
{{ctx.Locale.Tr "repo.issues.tracker"}}
-
-
-
- {{if $.IsStopwatchRunning}}
-
-
- {{else}}
- {{if .HasUserStopwatch}}
-
- {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}
-
- {{end}}
-
-
-
-
-
-
-
-
-
-
-
-
- {{end}}
-
-
- {{end}}
- {{if .WorkingUsers}}
-
-
- {{end}}
+ {{template "repo/issue/view_content/sidebar/timetracking" .}}
{{end}}
-
{{ctx.Locale.Tr "repo.issues.due_date"}}
-
+ {{template "repo/issue/view_content/sidebar/due_deadline" .}}
{{if .Repository.IsDependenciesEnabled $.Context}}
-
- {{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
-
{{ctx.Locale.Tr "repo.issues.dependency.title"}}
-
-
- {{if .Issue.IsPull}}
- {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
- {{else}}
- {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
- {{end}}
-
- {{end}}
-
- {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
-
- {{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}
-
-
- {{range .BlockingDependencies}}
-
- {{end}}
- {{if .BlockingDependenciesNotPermitted}}
-
- {{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}
-
- {{end}}
-
- {{end}}
-
- {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
-
- {{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}
-
-
- {{range .BlockedByDependencies}}
-
- {{end}}
- {{if $.CanCreateIssueDependencies}}
- {{range .BlockedByDependenciesNotPermitted}}
-
-
-
- {{svg "octicon-lock" 16}}
-
- #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
-
-
-
- {{.Repository.OwnerName}}/{{.Repository.Name}}
-
-
-
-
- {{end}}
- {{else if .BlockedByDependenciesNotPermitted}}
-
- {{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}
-
- {{end}}
-
- {{end}}
-
- {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
-
- {{end}}
-
-
- {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
-
-
-
-
-
-
-
{{if .Issue.IsPull}}
- {{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
- {{else}}
- {{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
- {{end}}
-
- {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
- {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
- {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
-
- {{end}}
+ {{template "repo/issue/view_content/sidebar/dependencies" .}}
{{end}}
-
- {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
-
- {{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}
-
-
-
+ {{template "repo/issue/view_content/sidebar/reference" .}}
{{if and .IsRepoAdmin (not .Repository.IsArchived)}}
- {{if or .PinEnabled .Issue.IsPinned}}
-
- {{end}}
-
-
-
-
-
-
- {{if .Issue.IsLocked}}
- {{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}
- {{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}
- {{else}}
- {{ctx.Locale.Tr "repo.issues.lock.notice_1"}}
- {{ctx.Locale.Tr "repo.issues.lock.notice_2"}}
- {{ctx.Locale.Tr "repo.issues.lock.notice_3"}}
- {{end}}
-
-
-
-
-
-
-
+ {{template "repo/issue/view_content/sidebar/actions" .}}
{{end}}
- {{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}}
- {{if and (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName)) .CanWriteToHeadRepo}}
-
-
-
-
-
-
-
- {{end}}
+ {{if and
+ .Issue.IsPull
+ .IsIssuePoster
+ (not .Issue.IsClosed)
+ .Issue.PullRequest.HeadRepo
+ (not (eq .Issue.PullRequest.HeadRepo.FullName .Issue.PullRequest.BaseRepo.FullName))
+ .CanWriteToHeadRepo
+ }}
+
+ {{template "repo/issue/view_content/sidebar/pull_maintainer_edits" .}}
{{end}}
diff --git a/templates/repo/issue/view_content/sidebar/actions.tmpl b/templates/repo/issue/view_content/sidebar/actions.tmpl
new file mode 100644
index 0000000000..36f21822aa
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/actions.tmpl
@@ -0,0 +1,114 @@
+{{if or .PinEnabled .Issue.IsPinned}}
+
+{{end}}
+
+
+
+
+
+
+ {{if .Issue.IsLocked}}
+ {{ctx.Locale.Tr "repo.issues.unlock.notice_1"}}
+ {{ctx.Locale.Tr "repo.issues.unlock.notice_2"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.lock.notice_1"}}
+ {{ctx.Locale.Tr "repo.issues.lock.notice_2"}}
+ {{ctx.Locale.Tr "repo.issues.lock.notice_3"}}
+ {{end}}
+
+
+
+
+
+
+
diff --git a/templates/repo/issue/view_content/sidebar/assignees.tmpl b/templates/repo/issue/view_content/sidebar/assignees.tmpl
new file mode 100644
index 0000000000..e51bda95de
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/assignees.tmpl
@@ -0,0 +1,45 @@
+
+
+
+
{{ctx.Locale.Tr "repo.issues.new.no_assignees"}}
+
+ {{range .Issue.Assignees}}
+
+
+
+ {{end}}
+
+
diff --git a/templates/repo/issue/branch_selector_field.tmpl b/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl
similarity index 100%
rename from templates/repo/issue/branch_selector_field.tmpl
rename to templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl
diff --git a/templates/repo/issue/view_content/sidebar/dependencies.tmpl b/templates/repo/issue/view_content/sidebar/dependencies.tmpl
new file mode 100644
index 0000000000..791bd5c4a1
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/dependencies.tmpl
@@ -0,0 +1,145 @@
+
+ {{if (and (not .BlockedByDependencies) (not .BlockedByDependenciesNotPermitted) (not .BlockingDependencies) (not .BlockingDependenciesNotPermitted))}}
+
{{ctx.Locale.Tr "repo.issues.dependency.title"}}
+
+
+ {{if .Issue.IsPull}}
+ {{ctx.Locale.Tr "repo.issues.dependency.pr_no_dependencies"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.dependency.issue_no_dependencies"}}
+ {{end}}
+
+ {{end}}
+
+ {{if or .BlockingDependencies .BlockingDependenciesNotPermitted}}
+
+ {{ctx.Locale.Tr "repo.issues.dependency.blocks_short"}}
+
+
+ {{range .BlockingDependencies}}
+
+ {{end}}
+ {{if .BlockingDependenciesNotPermitted}}
+
+ {{ctx.Locale.TrN (len .BlockingDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockingDependenciesNotPermitted)}}
+
+ {{end}}
+
+ {{end}}
+
+ {{if or .BlockedByDependencies .BlockedByDependenciesNotPermitted}}
+
+ {{ctx.Locale.Tr "repo.issues.dependency.blocked_by_short"}}
+
+
+ {{range .BlockedByDependencies}}
+
+ {{end}}
+ {{if $.CanCreateIssueDependencies}}
+ {{range .BlockedByDependenciesNotPermitted}}
+
+
+
+ {{svg "octicon-lock" 16}}
+
+ #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}}
+
+
+
+ {{.Repository.OwnerName}}/{{.Repository.Name}}
+
+
+
+
+ {{end}}
+ {{else if .BlockedByDependenciesNotPermitted}}
+
+ {{ctx.Locale.TrN (len .BlockedByDependenciesNotPermitted) "repo.issues.dependency.no_permission_1" "repo.issues.dependency.no_permission_n" (len .BlockedByDependenciesNotPermitted)}}
+
+ {{end}}
+
+ {{end}}
+
+ {{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
+
+ {{end}}
+
+
+{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}}
+
+
+
+
+
+
+
{{if .Issue.IsPull}}
+ {{ctx.Locale.Tr "repo.issues.dependency.pr_remove_text"}}
+ {{else}}
+ {{ctx.Locale.Tr "repo.issues.dependency.issue_remove_text"}}
+ {{end}}
+
+ {{$ModalButtonCancelText := ctx.Locale.Tr "repo.issues.dependency.cancel"}}
+ {{$ModalButtonOkText := ctx.Locale.Tr "repo.issues.dependency.remove"}}
+ {{template "base/modal_actions_confirm" (dict "." . "ModalButtonCancelText" $ModalButtonCancelText "ModalButtonOkText" $ModalButtonOkText)}}
+
+{{end}}
diff --git a/templates/repo/issue/view_content/sidebar/due_deadline.tmpl b/templates/repo/issue/view_content/sidebar/due_deadline.tmpl
new file mode 100644
index 0000000000..2de836b4ed
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/due_deadline.tmpl
@@ -0,0 +1,41 @@
+
{{ctx.Locale.Tr "repo.issues.due_date"}}
+
diff --git a/templates/repo/issue/view_content/sidebar/milestones.tmpl b/templates/repo/issue/view_content/sidebar/milestones.tmpl
new file mode 100644
index 0000000000..661ca80743
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/milestones.tmpl
@@ -0,0 +1,22 @@
+
+
+
{{ctx.Locale.Tr "repo.issues.new.no_milestone"}}
+
+ {{if .Issue.Milestone}}
+
+ {{end}}
+
+
diff --git a/templates/repo/issue/view_content/sidebar/participants.tmpl b/templates/repo/issue/view_content/sidebar/participants.tmpl
new file mode 100644
index 0000000000..93e2579d8f
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/participants.tmpl
@@ -0,0 +1,8 @@
+
{{ctx.Locale.TrN .NumParticipants "repo.issues.num_participants_one" "repo.issues.num_participants_few" .NumParticipants}}
+
diff --git a/templates/repo/issue/view_content/sidebar/projects.tmpl b/templates/repo/issue/view_content/sidebar/projects.tmpl
new file mode 100644
index 0000000000..91d75f3bd9
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/projects.tmpl
@@ -0,0 +1,54 @@
+
+
+
{{ctx.Locale.Tr "repo.issues.new.no_projects"}}
+
+ {{if .Issue.Project}}
+
+ {{end}}
+
+
diff --git a/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl
new file mode 100644
index 0000000000..6ec5c05fd7
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl
@@ -0,0 +1,10 @@
+
+
+
+
+
+
diff --git a/templates/repo/issue/view_content/sidebar/pull_review.tmpl b/templates/repo/issue/view_content/sidebar/pull_review.tmpl
new file mode 100644
index 0000000000..930c2a6392
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/pull_review.tmpl
@@ -0,0 +1,45 @@
+
+
+{{template "repo/issue/view_content/sidebar/pull_reviewers" .}}
diff --git a/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl b/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl
new file mode 100644
index 0000000000..102508fdaf
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl
@@ -0,0 +1,67 @@
+
+
{{ctx.Locale.Tr "repo.issues.new.no_reviewers"}}
+
+ {{range .PullReviewers}}
+
+
+ {{if .User}}
+
+ {{else if .Team}}
+ {{svg "octicon-people" 20 "tw-mr-2"}}{{$.Issue.Repo.OwnerName}}/{{.Team.Name}}
+ {{end}}
+
+
+ {{if (and $.Permission.IsAdmin (or (eq .Review.Type 1) (eq .Review.Type 3)) (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged))}}
+
+ {{svg "octicon-x" 20}}
+
+
+
+
+
+ {{ctx.Locale.Tr "repo.issues.dismiss_review_warning"}}
+
+
+
+
+ {{end}}
+ {{if .Review.Stale}}
+
+ {{svg "octicon-hourglass" 16}}
+
+ {{end}}
+ {{if and .CanChange (or .Checked (and (not $.Issue.IsClosed) (not $.Issue.PullRequest.HasMerged)))}}
+
{{if .Checked}}{{svg "octicon-trash"}}{{else}}{{svg "octicon-sync"}}{{end}}
+ {{end}}
+ {{svg (printf "octicon-%s" .Review.Type.Icon) 16 (printf "text %s" (.Review.HTMLTypeColorName))}}
+
+
+ {{end}}
+ {{range .OriginalReviews}}
+
+
+
+ {{svg (printf "octicon-%s" .Type.Icon) 16 (printf "text %s" (.HTMLTypeColorName))}}
+
+
+ {{end}}
+
+
diff --git a/templates/repo/issue/view_content/sidebar/pull_wip.tmpl b/templates/repo/issue/view_content/sidebar/pull_wip.tmpl
new file mode 100644
index 0000000000..f1588b3f80
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/pull_wip.tmpl
@@ -0,0 +1,11 @@
+{{if and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .HasMerged) (not .Issue.IsClosed)}}
+
+{{end}}
diff --git a/templates/repo/issue/view_content/sidebar/reference.tmpl b/templates/repo/issue/view_content/sidebar/reference.tmpl
new file mode 100644
index 0000000000..bbbc099558
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/reference.tmpl
@@ -0,0 +1,7 @@
+
+ {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}}
+
+ {{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}}
+
+
+
diff --git a/templates/repo/issue/view_content/sidebar/timetracking.tmpl b/templates/repo/issue/view_content/sidebar/timetracking.tmpl
new file mode 100644
index 0000000000..610600b2fb
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/timetracking.tmpl
@@ -0,0 +1,73 @@
+{{if and .CanUseTimetracker (not .Repository.IsArchived)}}
+
+
+
{{ctx.Locale.Tr "repo.issues.tracker"}}
+
+
+
+ {{if $.IsStopwatchRunning}}
+
+
+ {{else}}
+ {{if .HasUserStopwatch}}
+
+ {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}}
+
+ {{end}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{end}}
+
+
+{{end}}
+{{if .WorkingUsers}}
+
+
+{{end}}
diff --git a/templates/repo/issue/view_content/sidebar/watch.tmpl b/templates/repo/issue/view_content/sidebar/watch.tmpl
new file mode 100644
index 0000000000..6c74b140c8
--- /dev/null
+++ b/templates/repo/issue/view_content/sidebar/watch.tmpl
@@ -0,0 +1,17 @@
+
+
{{ctx.Locale.Tr "notification.notifications"}}
+
+
+
+
diff --git a/templates/repo/issue/view_content/watching.tmpl b/templates/repo/issue/view_content/watching.tmpl
deleted file mode 100644
index 05936d090b..0000000000
--- a/templates/repo/issue/view_content/watching.tmpl
+++ /dev/null
@@ -1,12 +0,0 @@
-