From 65aa53fc52ff15efe54df4147564828d535837f8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 11 Oct 2024 12:27:00 +0200 Subject: Adding upstream version 8.0.3. Signed-off-by: Daniel Baumann --- templates/repo/issue/card.tmpl | 78 +++ templates/repo/issue/choose.tmpl | 59 ++ templates/repo/issue/comment_tab.tmpl | 21 + templates/repo/issue/fields/checkboxes.tmpl | 14 + templates/repo/issue/fields/dropdown.tmpl | 17 + templates/repo/issue/fields/header.tmpl | 6 + templates/repo/issue/fields/input.tmpl | 4 + templates/repo/issue/fields/markdown.tmpl | 3 + templates/repo/issue/fields/textarea.tmpl | 24 + templates/repo/issue/filter_actions.tmpl | 128 ++++ templates/repo/issue/filter_list.tmpl | 158 +++++ templates/repo/issue/filters.tmpl | 26 + templates/repo/issue/label_precolors.tmpl | 22 + templates/repo/issue/labels.tmpl | 22 + templates/repo/issue/labels/edit_delete_label.tmpl | 72 +++ templates/repo/issue/labels/label.tmpl | 7 + templates/repo/issue/labels/label_archived.tmpl | 5 + templates/repo/issue/labels/label_list.tmpl | 88 +++ .../repo/issue/labels/label_load_template.tmpl | 24 + templates/repo/issue/labels/label_new.tmpl | 48 ++ .../repo/issue/labels/labels_selector_field.tmpl | 46 ++ templates/repo/issue/labels/labels_sidebar.tmpl | 11 + templates/repo/issue/list.tmpl | 55 ++ templates/repo/issue/milestone/filter_list.tmpl | 15 + templates/repo/issue/milestone/select_menu.tmpl | 38 ++ templates/repo/issue/milestone_issues.tmpl | 65 ++ templates/repo/issue/milestone_new.tmpl | 59 ++ templates/repo/issue/milestones.tmpl | 110 ++++ templates/repo/issue/navbar.tmpl | 4 + templates/repo/issue/new.tmpl | 8 + templates/repo/issue/new_form.tmpl | 190 ++++++ templates/repo/issue/openclose.tmpl | 16 + templates/repo/issue/search.tmpl | 20 + templates/repo/issue/view.tmpl | 12 + templates/repo/issue/view_content.tmpl | 187 ++++++ .../repo/issue/view_content/add_reaction.tmpl | 12 + templates/repo/issue/view_content/attachments.tmpl | 42 ++ templates/repo/issue/view_content/comments.tmpl | 683 +++++++++++++++++++++ .../issue/view_content/comments_authorlink.tmpl | 11 + .../issue/view_content/comments_delete_time.tmpl | 18 + .../repo/issue/view_content/context_menu.tmpl | 27 + .../repo/issue/view_content/conversation.tmpl | 137 +++++ templates/repo/issue/view_content/pull.tmpl | 396 ++++++++++++ .../issue/view_content/pull_merge_instruction.tmpl | 49 ++ templates/repo/issue/view_content/reactions.tmpl | 17 + .../issue/view_content/reference_issue_dialog.tmpl | 28 + templates/repo/issue/view_content/show_role.tmpl | 15 + templates/repo/issue/view_content/sidebar.tmpl | 66 ++ .../repo/issue/view_content/sidebar/actions.tmpl | 114 ++++ .../repo/issue/view_content/sidebar/assignees.tmpl | 45 ++ .../sidebar/branch_selector_field.tmpl | 59 ++ .../issue/view_content/sidebar/dependencies.tmpl | 145 +++++ .../issue/view_content/sidebar/due_deadline.tmpl | 41 ++ .../issue/view_content/sidebar/milestones.tmpl | 22 + .../issue/view_content/sidebar/participants.tmpl | 8 + .../repo/issue/view_content/sidebar/projects.tmpl | 54 ++ .../sidebar/pull_maintainer_edits.tmpl | 10 + .../issue/view_content/sidebar/pull_review.tmpl | 45 ++ .../issue/view_content/sidebar/pull_reviewers.tmpl | 67 ++ .../repo/issue/view_content/sidebar/pull_wip.tmpl | 11 + .../repo/issue/view_content/sidebar/reference.tmpl | 7 + .../issue/view_content/sidebar/timetracking.tmpl | 73 +++ .../repo/issue/view_content/sidebar/watch.tmpl | 6 + .../repo/issue/view_content/sidebar/watching.tmpl | 19 + .../issue/view_content/update_branch_by_merge.tmpl | 37 ++ templates/repo/issue/view_title.tmpl | 145 +++++ 66 files changed, 4071 insertions(+) create mode 100644 templates/repo/issue/card.tmpl create mode 100644 templates/repo/issue/choose.tmpl create mode 100644 templates/repo/issue/comment_tab.tmpl create mode 100644 templates/repo/issue/fields/checkboxes.tmpl create mode 100644 templates/repo/issue/fields/dropdown.tmpl create mode 100644 templates/repo/issue/fields/header.tmpl create mode 100644 templates/repo/issue/fields/input.tmpl create mode 100644 templates/repo/issue/fields/markdown.tmpl create mode 100644 templates/repo/issue/fields/textarea.tmpl create mode 100644 templates/repo/issue/filter_actions.tmpl create mode 100644 templates/repo/issue/filter_list.tmpl create mode 100644 templates/repo/issue/filters.tmpl create mode 100644 templates/repo/issue/label_precolors.tmpl create mode 100644 templates/repo/issue/labels.tmpl create mode 100644 templates/repo/issue/labels/edit_delete_label.tmpl create mode 100644 templates/repo/issue/labels/label.tmpl create mode 100644 templates/repo/issue/labels/label_archived.tmpl create mode 100644 templates/repo/issue/labels/label_list.tmpl create mode 100644 templates/repo/issue/labels/label_load_template.tmpl create mode 100644 templates/repo/issue/labels/label_new.tmpl create mode 100644 templates/repo/issue/labels/labels_selector_field.tmpl create mode 100644 templates/repo/issue/labels/labels_sidebar.tmpl create mode 100644 templates/repo/issue/list.tmpl create mode 100644 templates/repo/issue/milestone/filter_list.tmpl create mode 100644 templates/repo/issue/milestone/select_menu.tmpl create mode 100644 templates/repo/issue/milestone_issues.tmpl create mode 100644 templates/repo/issue/milestone_new.tmpl create mode 100644 templates/repo/issue/milestones.tmpl create mode 100644 templates/repo/issue/navbar.tmpl create mode 100644 templates/repo/issue/new.tmpl create mode 100644 templates/repo/issue/new_form.tmpl create mode 100644 templates/repo/issue/openclose.tmpl create mode 100644 templates/repo/issue/search.tmpl create mode 100644 templates/repo/issue/view.tmpl create mode 100644 templates/repo/issue/view_content.tmpl create mode 100644 templates/repo/issue/view_content/add_reaction.tmpl create mode 100644 templates/repo/issue/view_content/attachments.tmpl create mode 100644 templates/repo/issue/view_content/comments.tmpl create mode 100644 templates/repo/issue/view_content/comments_authorlink.tmpl create mode 100644 templates/repo/issue/view_content/comments_delete_time.tmpl create mode 100644 templates/repo/issue/view_content/context_menu.tmpl create mode 100644 templates/repo/issue/view_content/conversation.tmpl create mode 100644 templates/repo/issue/view_content/pull.tmpl create mode 100644 templates/repo/issue/view_content/pull_merge_instruction.tmpl create mode 100644 templates/repo/issue/view_content/reactions.tmpl create mode 100644 templates/repo/issue/view_content/reference_issue_dialog.tmpl create mode 100644 templates/repo/issue/view_content/show_role.tmpl create mode 100644 templates/repo/issue/view_content/sidebar.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/actions.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/assignees.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/dependencies.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/due_deadline.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/milestones.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/participants.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/projects.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_maintainer_edits.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_review.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_reviewers.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/pull_wip.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/reference.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/timetracking.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/watch.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/watching.tmpl create mode 100644 templates/repo/issue/view_content/update_branch_by_merge.tmpl create mode 100644 templates/repo/issue/view_title.tmpl (limited to 'templates/repo/issue') diff --git a/templates/repo/issue/card.tmpl b/templates/repo/issue/card.tmpl new file mode 100644 index 00000000..4c22c283 --- /dev/null +++ b/templates/repo/issue/card.tmpl @@ -0,0 +1,78 @@ +{{with .Issue}} + {{if eq $.Page.Project.CardType 1}}{{/* Images and Text*/}} + {{$attachments := index $.Page.issuesAttachmentMap .ID}} + {{if $attachments}} +
+ {{range $attachments}} + {{.Name}} + {{end}} +
+ {{end}} + {{end}} +
+
+
+ {{template "shared/issueicon" .}} +
+ {{.Title | RenderEmoji ctx | RenderCodeBlock}} + {{if and $.isPinnedIssueCard $.Page.IsRepoAdmin}} + + {{svg "octicon-x" 16}} + + {{end}} +
+
+ + {{if not $.Page.Repository}}{{.Repo.FullName}}{{end}}#{{.Index}} + {{$timeStr := TimeSinceUnix .GetLastEventTimestamp ctx.Locale}} + {{if .OriginalAuthor}} + {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor}} + {{else if gt .Poster.ID 0}} + {{ctx.Locale.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.GetDisplayName}} + {{else}} + {{ctx.Locale.Tr .GetLastEventLabelFake $timeStr .Poster.GetDisplayName}} + {{end}} + +
+ {{if .MilestoneID}} + + {{end}} + {{if $.Page.LinkedPRs}} + {{range index $.Page.LinkedPRs .ID}} + + {{end}} + {{end}} + {{$tasks := .GetTasks}} + {{if gt $tasks 0}} +
+ {{svg "octicon-checklist" 16 "tw-mr-1 tw-align-middle"}} + {{.GetTasksDone}} / {{$tasks}} +
+ {{end}} +
+ + {{if or .Labels .Assignees}} +
+
+ {{range .Labels}} + {{RenderLabel ctx ctx.Locale .}} + {{end}} +
+
+ {{range .Assignees}} + {{ctx.AvatarUtils.Avatar . 28}} + {{end}} +
+
+ {{end}} +{{end}} diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl new file mode 100644 index 00000000..38cf9e48 --- /dev/null +++ b/templates/repo/issue/choose.tmpl @@ -0,0 +1,59 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+ {{template "repo/issue/navbar" .}} +
+
+ {{range .IssueTemplates}} +
+
+
+ {{.Name}} +
{{.About}} +
+ +
+
+ {{end}} + {{range .IssueConfig.ContactLinks}} + + {{end}} + {{if .IssueConfig.BlankIssuesEnabled}} +
+
+
+ {{ctx.Locale.Tr "repo.issues.choose.blank"}} +
{{ctx.Locale.Tr "repo.issues.choose.blank_about"}} +
+ +
+
+ {{end}} + {{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}} +
+
+
{{ctx.Locale.Tr "repo.issues.choose.invalid_config"}}
+
{{.IssueConfigError}}
+
+
+ {{end}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/comment_tab.tmpl b/templates/repo/issue/comment_tab.tmpl new file mode 100644 index 00000000..4197ea4f --- /dev/null +++ b/templates/repo/issue/comment_tab.tmpl @@ -0,0 +1,21 @@ +{{$textareaContent := .BodyQuery}} +{{if not $textareaContent}}{{$textareaContent = .IssueTemplate}}{{end}} +{{if not $textareaContent}}{{$textareaContent = .PullRequestTemplate}}{{end}} +{{if not $textareaContent}}{{$textareaContent = .content}}{{end}} + +
+ {{template "shared/combomarkdowneditor" (dict + "MarkdownPreviewUrl" (print .Repository.Link "/markup") + "MarkdownPreviewContext" .RepoLink + "TextareaName" "content" + "TextareaContent" $textareaContent + "TextareaPlaceholder" (ctx.Locale.Tr "repo.diff.comment.placeholder") + "DropzoneParentContainer" "form, .ui.form" + )}} +
+ +{{if .IsAttachmentEnabled}} +
+ {{template "repo/upload" .}} +
+{{end}} diff --git a/templates/repo/issue/fields/checkboxes.tmpl b/templates/repo/issue/fields/checkboxes.tmpl new file mode 100644 index 00000000..531f401f --- /dev/null +++ b/templates/repo/issue/fields/checkboxes.tmpl @@ -0,0 +1,14 @@ +
+ {{template "repo/issue/fields/header" .}} + {{range $i, $opt := .item.Attributes.options}} +
+
+ + +
+ {{if $opt.required}} + + {{end}} +
+ {{end}} +
diff --git a/templates/repo/issue/fields/dropdown.tmpl b/templates/repo/issue/fields/dropdown.tmpl new file mode 100644 index 00000000..26505f58 --- /dev/null +++ b/templates/repo/issue/fields/dropdown.tmpl @@ -0,0 +1,17 @@ +
+ {{template "repo/issue/fields/header" .}} + {{/* FIXME: required validation */}} + +
diff --git a/templates/repo/issue/fields/header.tmpl b/templates/repo/issue/fields/header.tmpl new file mode 100644 index 00000000..6034fed5 --- /dev/null +++ b/templates/repo/issue/fields/header.tmpl @@ -0,0 +1,6 @@ +{{if .item.Attributes.label}} +

{{.item.Attributes.label}}{{if .item.Validations.required}}{{end}}

+{{end}} +{{if .item.Attributes.description}} + {{RenderMarkdownToHtml .Context .item.Attributes.description}} +{{end}} diff --git a/templates/repo/issue/fields/input.tmpl b/templates/repo/issue/fields/input.tmpl new file mode 100644 index 00000000..039f9a9f --- /dev/null +++ b/templates/repo/issue/fields/input.tmpl @@ -0,0 +1,4 @@ +
+ {{template "repo/issue/fields/header" .}} + +
diff --git a/templates/repo/issue/fields/markdown.tmpl b/templates/repo/issue/fields/markdown.tmpl new file mode 100644 index 00000000..934699ed --- /dev/null +++ b/templates/repo/issue/fields/markdown.tmpl @@ -0,0 +1,3 @@ +
+
{{RenderMarkdownToHtml .Context .item.Attributes.value}}
+
diff --git a/templates/repo/issue/fields/textarea.tmpl b/templates/repo/issue/fields/textarea.tmpl new file mode 100644 index 00000000..3ad69e12 --- /dev/null +++ b/templates/repo/issue/fields/textarea.tmpl @@ -0,0 +1,24 @@ +{{$useMarkdownEditor := not .item.Attributes.render}} +
+ {{template "repo/issue/fields/header" .}} + + {{/* the real form element to provide the value */}} + + + {{if $useMarkdownEditor}} + {{template "shared/combomarkdowneditor" (dict + "ContainerClasses" "tw-hidden" + "MarkdownPreviewUrl" (print .root.RepoLink "/markup") + "MarkdownPreviewContext" .root.RepoLink + "TextareaContent" .item.Attributes.value + "TextareaPlaceholder" .item.Attributes.placeholder + "DropzoneParentContainer" ".combo-editor-dropzone" + )}} + + {{if .root.IsAttachmentEnabled}} +
+ {{template "repo/upload" .root}} +
+ {{end}} + {{end}} +
diff --git a/templates/repo/issue/filter_actions.tmpl b/templates/repo/issue/filter_actions.tmpl new file mode 100644 index 00000000..a341448b --- /dev/null +++ b/templates/repo/issue/filter_actions.tmpl @@ -0,0 +1,128 @@ + + diff --git a/templates/repo/issue/filter_list.tmpl b/templates/repo/issue/filter_list.tmpl new file mode 100644 index 00000000..09f87b58 --- /dev/null +++ b/templates/repo/issue/filter_list.tmpl @@ -0,0 +1,158 @@ + +{{template "shared/label_filter" .}} + +{{if not .Milestone}} + + +{{end}} + + + + + + + + + + +{{if .IsSigned}} + + +{{end}} + + + diff --git a/templates/repo/issue/filters.tmpl b/templates/repo/issue/filters.tmpl new file mode 100644 index 00000000..06e7c1aa --- /dev/null +++ b/templates/repo/issue/filters.tmpl @@ -0,0 +1,26 @@ +
+
+ {{if and $.CanWriteIssuesOrPulls .Issues}} + + {{end}} + {{template "repo/issue/openclose" .}} + + {{if .TotalTrackedTime}} + + {{end}} +
+
+ +
+
diff --git a/templates/repo/issue/label_precolors.tmpl b/templates/repo/issue/label_precolors.tmpl new file mode 100644 index 00000000..80007662 --- /dev/null +++ b/templates/repo/issue/label_precolors.tmpl @@ -0,0 +1,22 @@ +
+
+ + + + + + + + +
+
+ + + + + + + + +
+
diff --git a/templates/repo/issue/labels.tmpl b/templates/repo/issue/labels.tmpl new file mode 100644 index 00000000..230777ef --- /dev/null +++ b/templates/repo/issue/labels.tmpl @@ -0,0 +1,22 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{template "repo/issue/navbar" .}} + {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + + {{end}} +
+ {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + {{template "repo/issue/labels/label_new" .}} + {{end}} + {{template "base/alert" .}} + {{template "repo/issue/labels/label_list" .}} +
+
+ +{{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + {{template "repo/issue/labels/edit_delete_label" .}} +{{end}} +{{template "base/footer" .}} diff --git a/templates/repo/issue/labels/edit_delete_label.tmpl b/templates/repo/issue/labels/edit_delete_label.tmpl new file mode 100644 index 00000000..fcf69217 --- /dev/null +++ b/templates/repo/issue/labels/edit_delete_label.tmpl @@ -0,0 +1,72 @@ + + + diff --git a/templates/repo/issue/labels/label.tmpl b/templates/repo/issue/labels/label.tmpl new file mode 100644 index 00000000..3651ba11 --- /dev/null +++ b/templates/repo/issue/labels/label.tmpl @@ -0,0 +1,7 @@ + + {{- RenderLabel $.Context ctx.Locale .label -}} + diff --git a/templates/repo/issue/labels/label_archived.tmpl b/templates/repo/issue/labels/label_archived.tmpl new file mode 100644 index 00000000..feaf77e4 --- /dev/null +++ b/templates/repo/issue/labels/label_archived.tmpl @@ -0,0 +1,5 @@ +{{if .IsArchived}} + + {{ctx.Locale.Tr "archived"}} + +{{end}} diff --git a/templates/repo/issue/labels/label_list.tmpl b/templates/repo/issue/labels/label_list.tmpl new file mode 100644 index 00000000..8d7fc2c3 --- /dev/null +++ b/templates/repo/issue/labels/label_list.tmpl @@ -0,0 +1,88 @@ +

+ {{ctx.Locale.Tr "repo.issues.label_count" .NumLabels}} + +

+ +
+ {{if and (not $.PageIsOrgSettingsLabels) (or $.CanWriteIssues $.CanWritePulls) (eq .NumLabels 0) (not $.Repository.IsArchived)}} + {{template "repo/issue/labels/label_load_template" .}} +
+ {{else if and ($.PageIsOrgSettingsLabels) (eq .NumLabels 0)}} + {{template "repo/issue/labels/label_load_template" .}} +
+ {{end}} + + +
diff --git a/templates/repo/issue/labels/label_load_template.tmpl b/templates/repo/issue/labels/label_load_template.tmpl new file mode 100644 index 00000000..02494300 --- /dev/null +++ b/templates/repo/issue/labels/label_load_template.tmpl @@ -0,0 +1,24 @@ +
+
+
+

{{ctx.Locale.Tr "repo.issues.label_templates.info"}}

+
+
+ {{.CsrfTokenHtml}} +
+ +
+ +
+
+
+
diff --git a/templates/repo/issue/labels/label_new.tmpl b/templates/repo/issue/labels/label_new.tmpl new file mode 100644 index 00000000..32fd8e76 --- /dev/null +++ b/templates/repo/issue/labels/label_new.tmpl @@ -0,0 +1,48 @@ + diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl new file mode 100644 index 00000000..9e54e7a6 --- /dev/null +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -0,0 +1,46 @@ + diff --git a/templates/repo/issue/labels/labels_sidebar.tmpl b/templates/repo/issue/labels/labels_sidebar.tmpl new file mode 100644 index 00000000..81fc9709 --- /dev/null +++ b/templates/repo/issue/labels/labels_sidebar.tmpl @@ -0,0 +1,11 @@ +
+ {{ctx.Locale.Tr "repo.issues.new.no_label"}} + + {{range .root.Labels}} + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} + {{end}} + {{range .root.OrgLabels}} + {{template "repo/issue/labels/label" dict "root" $.root "label" .}} + {{end}} + +
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl new file mode 100644 index 00000000..8c81bf02 --- /dev/null +++ b/templates/repo/issue/list.tmpl @@ -0,0 +1,55 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + + {{if .PinnedIssues}} +
+ {{range .PinnedIssues}} +
+ {{template "repo/issue/card" (dict "Issue" . "Page" $ "isPinnedIssueCard" true)}} +
+ {{end}} +
+ {{end}} + +
+ {{template "repo/issue/navbar" .}} + {{template "repo/issue/search" .}} + {{if not .Repository.IsArchived}} + {{if .PageIsIssueList}} + {{ctx.Locale.Tr "repo.issues.new"}} + {{else}} + {{ctx.Locale.Tr "repo.pulls.new"}} + {{end}} + {{else}} + {{if not .PageIsIssueList}} + {{ctx.Locale.Tr "action.compare_commits_general"}} + {{end}} + {{end}} +
+ + {{template "repo/issue/filters" .}} + +
+
+ {{template "repo/issue/openclose" .}} + + {{if .TotalTrackedTime}} + + {{end}} +
+
+ {{template "repo/issue/filter_actions" .}} +
+
+ {{template "shared/issuelist" dict "." . "listType" "repo"}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestone/filter_list.tmpl b/templates/repo/issue/milestone/filter_list.tmpl new file mode 100644 index 00000000..ecfb95bb --- /dev/null +++ b/templates/repo/issue/milestone/filter_list.tmpl @@ -0,0 +1,15 @@ + + diff --git a/templates/repo/issue/milestone/select_menu.tmpl b/templates/repo/issue/milestone/select_menu.tmpl new file mode 100644 index 00000000..9b0492ce --- /dev/null +++ b/templates/repo/issue/milestone/select_menu.tmpl @@ -0,0 +1,38 @@ +{{if or .OpenMilestones .ClosedMilestones}} + +
+{{end}} +
{{ctx.Locale.Tr "repo.issues.new.clear_milestone"}}
+{{if and (not .OpenMilestones) (not .ClosedMilestones)}} +
+ {{ctx.Locale.Tr "repo.issues.new.no_items"}} +
+{{else}} + {{if .OpenMilestones}} +
+
+ {{ctx.Locale.Tr "repo.issues.new.open_milestone"}} +
+ {{range .OpenMilestones}} + + {{svg "octicon-milestone" 16 "tw-mr-1"}} + {{.Name}} + + {{end}} + {{end}} + {{if .ClosedMilestones}} +
+
+ {{ctx.Locale.Tr "repo.issues.new.closed_milestone"}} +
+ {{range .ClosedMilestones}} + + {{svg "octicon-milestone" 16 "tw-mr-1"}} + {{.Name}} + + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl new file mode 100644 index 00000000..e5dc8cb6 --- /dev/null +++ b/templates/repo/issue/milestone_issues.tmpl @@ -0,0 +1,65 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} +
+

{{.Milestone.Name}}

+ {{if not .Repository.IsArchived}} +
+ {{if or .CanWriteIssues .CanWritePulls}} + {{if .Milestone.IsClosed}} + {{ctx.Locale.Tr "repo.milestones.open"}} + + {{else}} + {{ctx.Locale.Tr "repo.milestones.close"}} + + {{end}} + {{ctx.Locale.Tr "repo.milestones.edit"}} + {{end}} + {{ctx.Locale.Tr "repo.issues.new"}} +
+ {{end}} +
+ {{if .Milestone.RenderedContent}} +
+ {{.Milestone.RenderedContent}} +
+ {{end}} +
+ +
+
+ {{$closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix ctx.Locale}} + {{if .IsClosed}} + {{svg "octicon-clock"}} {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} + {{else}} + + {{if .Milestone.DeadlineString}} + + {{svg "octicon-calendar"}} + {{DateTime "short" .Milestone.DeadlineString}} + + {{else}} + {{svg "octicon-calendar"}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} +
+
{{ctx.Locale.Tr "repo.milestones.completeness" .Milestone.Completeness}}
+ {{if .TotalTrackedTime}} +
+ {{svg "octicon-clock"}} + {{.TotalTrackedTime | Sec2Time}} +
+ {{end}} +
+
+
+ + {{template "repo/issue/filters" .}} + + {{template "shared/issuelist" dict "." . "listType" "milestone"}} +
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestone_new.tmpl b/templates/repo/issue/milestone_new.tmpl new file mode 100644 index 00000000..9f32df00 --- /dev/null +++ b/templates/repo/issue/milestone_new.tmpl @@ -0,0 +1,59 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+
+ {{template "repo/issue/navbar" .}} + {{if and (or .CanWriteIssues .CanWritePulls) .PageIsEditMilestone}} + + {{end}} +
+
+

+ {{if .PageIsEditMilestone}} + {{ctx.Locale.Tr "repo.milestones.edit"}} +
{{ctx.Locale.Tr "repo.milestones.edit_subheader"}}
+ {{else}} + {{ctx.Locale.Tr "repo.milestones.new"}} +
{{ctx.Locale.Tr "repo.milestones.new_subheader"}}
+ {{end}} +

+ {{template "base/alert" .}} +
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+
+
+ {{if .PageIsEditMilestone}} + + {{ctx.Locale.Tr "repo.milestones.cancel"}} + + + {{else}} + + {{end}} +
+
+
+
+{{template "base/footer" .}} diff --git a/templates/repo/issue/milestones.tmpl b/templates/repo/issue/milestones.tmpl new file mode 100644 index 00000000..63a6f6b2 --- /dev/null +++ b/templates/repo/issue/milestones.tmpl @@ -0,0 +1,110 @@ +{{template "base/head" .}} +
+ {{template "repo/header" .}} +
+ {{template "base/alert" .}} + +
+ {{template "repo/issue/navbar" .}} + {{template "repo/issue/search" .}} + {{if and (or .CanWriteIssues .CanWritePulls) (not .Repository.IsArchived)}} + + {{end}} +
+ + {{template "repo/issue/filters" .}} + + +
+ {{range .Milestones}} +
  • +
    +

    + {{svg "octicon-milestone" 16}} + {{.Name}} +

    +
    + {{.Completeness}}% + +
    +
    +
    +
    +
    + {{svg "octicon-issue-opened" 14}} + {{ctx.Locale.PrettyNumber .NumOpenIssues}} {{ctx.Locale.Tr "repo.issues.open_title"}} +
    +
    + {{svg "octicon-check" 14}} + {{ctx.Locale.PrettyNumber .NumClosedIssues}} {{ctx.Locale.Tr "repo.issues.closed_title"}} +
    + {{if .TotalTrackedTime}} +
    + {{svg "octicon-clock"}} + {{.TotalTrackedTime|Sec2Time}} +
    + {{end}} + {{if .UpdatedUnix}} +
    + {{svg "octicon-clock"}} + {{ctx.Locale.Tr "repo.milestones.update_ago" (TimeSinceUnix .UpdatedUnix ctx.Locale)}} +
    + {{end}} +
    + {{if .IsClosed}} + {{$closedDate:= TimeSinceUnix .ClosedDateUnix ctx.Locale}} + {{svg "octicon-clock" 14}} + {{ctx.Locale.Tr "repo.milestones.closed" $closedDate}} + {{else}} + {{if .DeadlineString}} + + {{svg "octicon-calendar" 14}} + {{DateTime "short" .DeadlineString}} + + {{else}} + {{svg "octicon-calendar" 14}} + {{ctx.Locale.Tr "repo.milestones.no_due_date"}} + {{end}} + {{end}} +
    +
    + {{if and (or $.CanWriteIssues $.CanWritePulls) (not $.Repository.IsArchived)}} + + {{end}} +
    + {{if .Content}} +
    + {{.RenderedContent}} +
    + {{end}} +
  • + {{end}} + + {{template "base/paginate" .}} +
    +
    +
    + +{{if or .CanWriteIssues .CanWritePulls}} + +{{end}} +{{template "base/footer" .}} diff --git a/templates/repo/issue/navbar.tmpl b/templates/repo/issue/navbar.tmpl new file mode 100644 index 00000000..30e42c77 --- /dev/null +++ b/templates/repo/issue/navbar.tmpl @@ -0,0 +1,4 @@ + diff --git a/templates/repo/issue/new.tmpl b/templates/repo/issue/new.tmpl new file mode 100644 index 00000000..ccd45fde --- /dev/null +++ b/templates/repo/issue/new.tmpl @@ -0,0 +1,8 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/new_form" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl new file mode 100644 index 00000000..465cb44f --- /dev/null +++ b/templates/repo/issue/new_form.tmpl @@ -0,0 +1,190 @@ +{{if .Flash}} +{{template "base/alert" .}} +{{end}} +
    + {{.CsrfTokenHtml}} +
    +
    +
    + {{ctx.AvatarUtils.Avatar .SignedUser 40}} +
    +
    + + {{if .PageIsComparePull}} +
    {{ctx.Locale.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0)}}
    + {{end}} +
    + {{if .Fields}} + + {{range .Fields}} + {{if eq .Type "input"}} + {{template "repo/issue/fields/input" dict "Context" $.Context "item" .}} + {{else if eq .Type "markdown"}} + {{template "repo/issue/fields/markdown" dict "Context" $.Context "item" .}} + {{else if eq .Type "textarea"}} + {{template "repo/issue/fields/textarea" dict "Context" $.Context "item" . "root" $}} + {{else if eq .Type "dropdown"}} + {{template "repo/issue/fields/dropdown" dict "Context" $.Context "item" .}} + {{else if eq .Type "checkboxes"}} + {{template "repo/issue/fields/checkboxes" dict "Context" $.Context "item" .}} + {{end}} + {{end}} + {{else}} + {{template "repo/issue/comment_tab" .}} + {{end}} +
    + +
    +
    +
    +
    +
    + +
    + {{template "repo/issue/view_content/sidebar/branch_selector_field" .}} + + + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + +
    + + + +
    + {{ctx.Locale.Tr "repo.issues.new.no_milestone"}} + +
    + + {{if .IsProjectsEnabled}} +
    + + + +
    + {{ctx.Locale.Tr "repo.issues.new.no_projects"}} + +
    + {{end}} +
    + + +
    + + {{ctx.Locale.Tr "repo.issues.new.no_assignees"}} + + +
    + {{if and .PageIsComparePull (not (eq .HeadRepo.FullName .BaseCompareRepo.FullName)) .CanWriteToHeadRepo}} +
    +
    +
    + + +
    +
    + {{end}} +
    + +
    diff --git a/templates/repo/issue/openclose.tmpl b/templates/repo/issue/openclose.tmpl new file mode 100644 index 00000000..eb2d6e09 --- /dev/null +++ b/templates/repo/issue/openclose.tmpl @@ -0,0 +1,16 @@ + diff --git a/templates/repo/issue/search.tmpl b/templates/repo/issue/search.tmpl new file mode 100644 index 00000000..f1c0ea32 --- /dev/null +++ b/templates/repo/issue/search.tmpl @@ -0,0 +1,20 @@ + diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl new file mode 100644 index 00000000..1ef9e735 --- /dev/null +++ b/templates/repo/issue/view.tmpl @@ -0,0 +1,12 @@ +{{template "base/head" .}} +
    + {{template "repo/header" .}} +
    + {{template "repo/issue/view_title" .}} + {{if .Issue.IsPull}} + {{template "repo/pulls/tab_menu" .}} + {{end}} + {{template "repo/issue/view_content" .}} +
    +
    +{{template "base/footer" .}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl new file mode 100644 index 00000000..543191e0 --- /dev/null +++ b/templates/repo/issue/view_content.tmpl @@ -0,0 +1,187 @@ +
    + + + + + + + + {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} +
    +
    +
    + {{if .Issue.OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar nil 40}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Issue.Poster 40}} + + {{end}} +
    +
    +
    + {{if .Issue.OriginalAuthor}} + + {{svg (MigrationIcon .Repository.GetOriginalURLHostname)}} + {{.Issue.OriginalAuthor}} + + + {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}} + + + {{if .Repository.OriginalURL}} ({{ctx.Locale.Tr "repo.migrated_from" .Repository.OriginalURL .Repository.GetOriginalURLHostname}}){{end}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Issue.Poster 24}} + + + {{template "shared/user/authorlink" .Issue.Poster}} + {{ctx.Locale.Tr "repo.issues.commented_at" .Issue.HashTag $createdStr}} + + {{end}} +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .Issue.ShowRole "IgnorePoster" true "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index)}} + {{end}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" .Issue "delete" false "issue" true "diff" false "IsCommentPoster" $.IsIssuePoster}} +
    +
    +
    +
    + {{if .Issue.RenderedContent}} + {{.Issue.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Issue.Content}}
    +
    + {{if .Issue.Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Issue.Attachments "RenderedContent" .Issue.RenderedContent}} + {{end}} +
    + {{$reactions := .Issue.Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) "Reactions" $reactions}} + {{end}} +
    +
    + + {{template "repo/issue/view_content/comments" .}} + + {{if and .Issue.IsPull (not $.Repository.IsArchived)}} + {{template "repo/issue/view_content/pull".}} + {{end}} + + {{if .IsSigned}} + {{if and (or .IsRepoAdmin .HasIssuesOrPullsWritePermission (not .Issue.IsLocked)) (not .Repository.IsArchived)}} +
    + + {{ctx.AvatarUtils.Avatar .SignedUser 40}} + +
    +
    + {{template "repo/issue/comment_tab" .}} + {{.CsrfTokenHtml}} + +
    +
    +
    + {{else if .Repository.IsArchived}} +
    + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} + {{end}} +
    + {{end}} + {{else}} {{/* not .IsSigned */}} + {{if .Repository.IsArchived}} +
    + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.archive.pull.nocomment"}} + {{else}} + {{ctx.Locale.Tr "repo.archive.issue.nocomment"}} + {{end}} +
    + {{else}} +
    + {{ctx.Locale.Tr "repo.issues.sign_in_require_desc" .SignInLink}} +
    + {{end}} + {{end}}{{/* end if: .IsSigned */}} +
    +
    + + {{template "repo/issue/view_content/sidebar" .}} +
    + + + +{{template "repo/issue/view_content/reference_issue_dialog" .}} + +
    + {{ctx.Locale.Tr "repo.issues.no_content"}} +
    + + diff --git a/templates/repo/issue/view_content/add_reaction.tmpl b/templates/repo/issue/view_content/add_reaction.tmpl new file mode 100644 index 00000000..37931f28 --- /dev/null +++ b/templates/repo/issue/view_content/add_reaction.tmpl @@ -0,0 +1,12 @@ +{{if .ctxData.IsSigned}} + +{{end}} diff --git a/templates/repo/issue/view_content/attachments.tmpl b/templates/repo/issue/view_content/attachments.tmpl new file mode 100644 index 00000000..79085df3 --- /dev/null +++ b/templates/repo/issue/view_content/attachments.tmpl @@ -0,0 +1,42 @@ +
    + {{if .Attachments}} +
    + {{end}} + {{$hasThumbnails := false}} + {{- range .Attachments -}} + + {{end -}} + + {{if $hasThumbnails}} +
    +
    + {{- range .Attachments -}} + {{if FilenameIsImage .Name}} + {{if not (StringUtils.Contains (StringUtils.ToString $.RenderedContent) .UUID)}} + + {{.Name}} + + {{end}} + {{end}} + {{end -}} +
    + {{end}} + +
    diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl new file mode 100644 index 00000000..6d14d726 --- /dev/null +++ b/templates/repo/issue/view_content/comments.tmpl @@ -0,0 +1,683 @@ +{{template "base/alert"}} +{{range .Issue.Comments}} + {{if call $.ShouldShowCommentType .Type}} + {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} + + + {{if eq .Type 0}} +
    + {{if .OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar nil 40}} + + {{else}} + + {{ctx.AvatarUtils.Avatar .Poster 40}} + + {{end}} +
    +
    +
    + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} {{if $.Repository.OriginalURL}} + + + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}} + + {{else}} + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdStr}} + + {{end}} +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{end}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{else if eq .Type 1}} +
    + {{svg "octicon-dot-fill"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.reopened_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.reopened_at" .EventTag $createdStr}} + {{end}} + +
    + {{else if eq .Type 2}} +
    + {{svg "octicon-circle-slash"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.closed_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.closed_at" .EventTag $createdStr}} + {{end}} + +
    + {{else if eq .Type 28}} +
    + {{svg "octicon-git-merge"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{$link := printf "%s/commit/%s" $.Repository.Link ($.Issue.PullRequest.MergedCommitID|PathEscape)}} + {{if eq $.Issue.PullRequest.Status 3}} + {{ctx.Locale.Tr "repo.issues.comment_manually_pull_merged_at" (HTMLFormat `%[2]s` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "%[1]s" $.BaseTarget) $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.comment_pull_merged_at" (HTMLFormat `%[2]s` $link (ShortSha $.Issue.PullRequest.MergedCommitID)) (HTMLFormat "%[1]s" $.BaseTarget) $createdStr}} + {{end}} + +
    + {{else if eq .Type 3 5 6}} + {{$refFrom:= ""}} + {{if ne .RefRepoID .Issue.RepoID}} + {{$refFrom = ctx.Locale.Tr "repo.issues.ref_from" .RefRepo.FullName}} + {{end}} + {{$refTr := "repo.issues.ref_issue_from"}} + {{if .Issue.IsPull}} + {{$refTr = "repo.issues.ref_pull_from"}} + {{else if eq .RefAction 1}} + {{$refTr = "repo.issues.ref_closing_from"}} + {{else if eq .RefAction 2}} + {{$refTr = "repo.issues.ref_reopening_from"}} + {{end}} + {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +
    + {{svg "octicon-bookmark"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{if eq .RefAction 3}}{{end}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr $refTr .EventTag $createdStr (.RefCommentLink ctx) $refFrom}} + + {{if eq .RefAction 3}}{{end}} + + +
    + {{else if eq .Type 4}} +
    + {{svg "octicon-bookmark"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if .Issue.IsPull}} + {{ctx.Locale.Tr "repo.pulls.commit_ref_at" .EventTag $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.commit_ref_at" .EventTag $createdStr}} + {{end}} + +
    + {{svg "octicon-git-commit"}} + {{.Content | SanitizeHTML}} +
    +
    + {{else if eq .Type 7}} + {{if or .AddedLabels .RemovedLabels}} +
    + {{svg "octicon-tag"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if and .AddedLabels (not .RemovedLabels)}} + {{ctx.Locale.TrN (len .AddedLabels) "repo.issues.add_label" "repo.issues.add_labels" (RenderLabels $.Context ctx.Locale .AddedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{else if and (not .AddedLabels) .RemovedLabels}} + {{ctx.Locale.TrN (len .RemovedLabels) "repo.issues.remove_label" "repo.issues.remove_labels" (RenderLabels $.Context ctx.Locale .RemovedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_remove_labels" (RenderLabels $.Context ctx.Locale .AddedLabels $.RepoLink .Issue.IsPull) (RenderLabels $.Context ctx.Locale .RemovedLabels $.RepoLink .Issue.IsPull) $createdStr}} + {{end}} + +
    + {{end}} + {{else if eq .Type 8}} +
    + {{svg "octicon-milestone"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if gt .OldMilestoneID 0}}{{if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.change_milestone_at" .OldMilestone.Name .Milestone.Name $createdStr}}{{else}}{{ctx.Locale.Tr "repo.issues.remove_milestone_at" .OldMilestone.Name $createdStr}}{{end}}{{else if gt .MilestoneID 0}}{{ctx.Locale.Tr "repo.issues.add_milestone_at" .Milestone.Name $createdStr}}{{end}} + +
    + {{else if and (eq .Type 9) (gt .AssigneeID 0)}} +
    + {{svg "octicon-person"}} + {{if .RemovedAssignee}} + {{template "shared/user/avatarlink" dict "user" .Assignee}} + + {{template "shared/user/authorlink" .Assignee}} + {{if eq .Poster.ID .Assignee.ID}} + {{ctx.Locale.Tr "repo.issues.remove_self_assignment" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.remove_assignee_at" .Poster.GetDisplayName $createdStr}} + {{end}} + + {{else}} + {{template "shared/user/avatarlink" dict "user" .Assignee}} + + {{template "shared/user/authorlink" .Assignee}} + {{if eq .Poster.ID .AssigneeID}} + {{ctx.Locale.Tr "repo.issues.self_assign_at" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_assignee_at" .Poster.GetDisplayName $createdStr}} + {{end}} + + {{end}} +
    + {{else if eq .Type 10}} +
    + {{svg "octicon-pencil"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.change_title_at" (.OldTitle|RenderEmoji $.Context) (.NewTitle|RenderEmoji $.Context) $createdStr}} + +
    + {{else if eq .Type 11}} +
    + {{svg "octicon-git-branch"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.delete_branch_at" .OldRef $createdStr}} + +
    + {{else if eq .Type 12}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.start_tracking_history" $createdStr}} + +
    + {{else if eq .Type 13}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.stop_tracking_history" $createdStr}} + + {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 14}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.add_time_history" $createdStr}} + + {{template "repo/issue/view_content/comments_delete_time" dict "ctxData" $ "comment" .}} +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 15}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.cancel_tracking_history" $createdStr}} + +
    + {{else if eq .Type 16}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.due_date_added" (DateTime "long" .Content) $createdStr}} + +
    + {{else if eq .Type 17}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{$parsedDeadline := StringUtils.Split .Content "|"}} + {{if eq (len $parsedDeadline) 2}} + {{$from := DateTime "long" (index $parsedDeadline 1)}} + {{$to := DateTime "long" (index $parsedDeadline 0)}} + {{ctx.Locale.Tr "repo.issues.due_date_modified" $to $from $createdStr}} + {{end}} + +
    + {{else if eq .Type 18}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.due_date_remove" (DateTime "long" .Content) $createdStr}} + +
    + {{else if eq .Type 19}} +
    + {{svg "octicon-package-dependents"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.dependency.added_dependency" $createdStr}} + + {{if .DependentIssue}} + + {{end}} +
    + {{else if eq .Type 20}} +
    + {{svg "octicon-package-dependents"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.dependency.removed_dependency" $createdStr}} + + {{if .DependentIssue}} + + {{end}} +
    + {{else if eq .Type 22}} +
    +
    + {{if not .OriginalAuthor}} + {{/* Some timeline avatars need a offset to correctly align with their speech bubble. + The condition depends on whether the comment has contents/attachments or reviews */}} + + {{ctx.AvatarUtils.Avatar .Poster 40}} + + {{end}} + {{svg (printf "octicon-%s" .Review.Type.Icon)}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if eq .Review.Type 1}} + {{ctx.Locale.Tr "repo.issues.review.approve" $createdStr}} + {{else if eq .Review.Type 2}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}} + {{else if eq .Review.Type 3}} + {{ctx.Locale.Tr "repo.issues.review.reject" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.comment" $createdStr}} + {{end}} + {{if .Review.Dismissed}} +
    {{ctx.Locale.Tr "repo.issues.review.dismissed_label"}}
    + {{end}} +
    +
    + {{if or .Content .Attachments}} +
    +
    +
    +
    + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + {{if $.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}){{end}} + {{else}} + {{template "shared/user/authorlink" .Poster}} + {{end}} + + {{ctx.Locale.Tr "repo.issues.review.left_comment"}} + +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" .Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" false "issue" true "diff" false "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{end}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{end}} + + {{if .Review.CodeComments}} +
    + {{range $filename, $lines := .Review.CodeComments}} + {{range $line, $comms := $lines}} + {{template "repo/issue/view_content/conversation" dict "." $ "comments" $comms}} + {{end}} + {{end}} +
    + {{end}} +
    + {{else if eq .Type 23}} +
    + {{svg "octicon-lock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{if .Content}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.lock_with_reason" .Content $createdStr}} + + {{else}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.lock_no_reason" $createdStr}} + + {{end}} +
    + {{else if eq .Type 24}} +
    + {{svg "octicon-key"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{ctx.Locale.Tr "repo.issues.unlock_comment" $createdStr}} + +
    + {{else if eq .Type 25}} +
    + {{svg "octicon-git-branch"}} + {{if not .OriginalAuthor}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + {{end}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{ctx.Locale.Tr "repo.pulls.change_target_branch_at" .OldRef .NewRef $createdStr}} + +
    + {{else if eq .Type 26}} +
    + {{svg "octicon-clock"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + + {{ctx.Locale.Tr "repo.issues.del_time_history" $createdStr}} + +
    + {{svg "octicon-clock"}} + {{if .RenderedContent}} + {{/* compatibility with time comments made before v1.21 */}} + {{.RenderedContent}} + {{else}} + - {{.Content|Sec2Time}} + {{end}} +
    +
    + {{else if eq .Type 27}} +
    + {{svg "octicon-eye"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if (gt .AssigneeID 0)}} + {{if .RemovedAssignee}} + {{if eq .PosterID .AssigneeID}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request_self" $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" .Assignee.GetDisplayName $createdStr}} + {{end}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" .Assignee.GetDisplayName $createdStr}} + {{end}} + {{else}} + + {{$teamName := "Ghost Team"}} + {{if .AssigneeTeam}} + {{$teamName = .AssigneeTeam.Name}} + {{end}} + {{if .RemovedAssignee}} + {{ctx.Locale.Tr "repo.issues.review.remove_review_request" $teamName $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.review.add_review_request" $teamName $createdStr}} + {{end}} + {{end}} + +
    + {{else if and (eq .Type 29) (or (gt .CommitsNum 0) .IsForcePush)}} + + {{if and .Issue.IsClosed (gt .ID $.LatestCloseCommentID)}} + {{continue}} + {{end}} +
    + {{svg "octicon-repo-push"}} + + {{template "shared/user/authorlink" .Poster}} + {{if .IsForcePush}} + {{ctx.Locale.Tr "repo.issues.force_push_codes" $.Issue.PullRequest.HeadBranch (ShortSha .OldCommit) ($.Issue.Repo.CommitLink .OldCommit) (ShortSha .NewCommit) ($.Issue.Repo.CommitLink .NewCommit) $createdStr}} + {{else}} + {{ctx.Locale.TrN (len .Commits) "repo.issues.push_commit_1" "repo.issues.push_commits_n" (len .Commits) $createdStr}} + {{end}} + + {{if and .IsForcePush $.Issue.PullRequest.BaseRepo.Name}} + + {{ctx.Locale.Tr "repo.issues.force_push_compare"}} + + {{end}} +
    + {{if not .IsForcePush}} + {{template "repo/commits_list_small" dict "comment" . "root" $}} + {{end}} + {{else if eq .Type 30}} + {{if not $.UnitProjectsGlobalDisabled}} +
    + {{svg "octicon-project"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{$oldProjectDisplayHtml := "Unknown Project"}} + {{if .OldProject}} + {{$trKey := printf "projects.type-%d.display_name" .OldProject.Type}} + {{$oldProjectDisplayHtml = HTMLFormat `%s` (ctx.Locale.Tr $trKey) .OldProject.Title}} + {{end}} + {{$newProjectDisplayHtml := "Unknown Project"}} + {{if .Project}} + {{$trKey := printf "projects.type-%d.display_name" .Project.Type}} + {{$newProjectDisplayHtml = HTMLFormat `%s` (ctx.Locale.Tr $trKey) .Project.Title}} + {{end}} + {{if and (gt .OldProjectID 0) (gt .ProjectID 0)}} + {{ctx.Locale.Tr "repo.issues.change_project_at" $oldProjectDisplayHtml $newProjectDisplayHtml $createdStr}} + {{else if gt .OldProjectID 0}} + {{ctx.Locale.Tr "repo.issues.remove_project_at" $oldProjectDisplayHtml $createdStr}} + {{else if gt .ProjectID 0}} + {{ctx.Locale.Tr "repo.issues.add_project_at" $newProjectDisplayHtml $createdStr}} + {{end}} + +
    + {{end}} + {{else if eq .Type 32}} +
    +
    + + + + {{svg "octicon-x" 16}} + + {{template "shared/user/authorlink" .Poster}} + {{$reviewerName := ""}} + {{if eq .Review.OriginalAuthor ""}} + {{$reviewerName = .Review.Reviewer.Name}} + {{else}} + {{$reviewerName = .Review.OriginalAuthor}} + {{end}} + {{ctx.Locale.Tr "repo.issues.review.dismissed" $reviewerName $createdStr}} + +
    + {{if .Content}} +
    +
    +
    + {{if gt .Poster.ID 0}} + + {{ctx.AvatarUtils.Avatar .Poster 24}} + + {{end}} + + {{ctx.Locale.Tr "action.review_dismissed_reason"}} + +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    +
    +
    + {{end}} +
    + {{else if eq .Type 33}} +
    + {{svg "octicon-git-branch"}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if and .OldRef .NewRef}} + {{ctx.Locale.Tr "repo.issues.change_ref_at" .OldRef .NewRef $createdStr}} + {{else if .OldRef}} + {{ctx.Locale.Tr "repo.issues.remove_ref_at" .OldRef $createdStr}} + {{else}} + {{ctx.Locale.Tr "repo.issues.add_ref_at" .NewRef $createdStr}} + {{end}} + +
    + {{else if or (eq .Type 34) (eq .Type 35)}} +
    + {{svg "octicon-git-merge" 16}} + + {{template "repo/issue/view_content/comments_authorlink" dict "ctxData" $ "comment" .}} + {{if eq .Type 34}}{{ctx.Locale.Tr "repo.pulls.auto_merge_newly_scheduled_comment" $createdStr}} + {{else}}{{ctx.Locale.Tr "repo.pulls.auto_merge_canceled_schedule_comment" $createdStr}}{{end}} + +
    + {{else if or (eq .Type 36) (eq .Type 37)}} +
    + {{svg "octicon-pin" 16}} + {{template "shared/user/avatarlink" dict "user" .Poster}} + + {{template "shared/user/authorlink" .Poster}} + {{if eq .Type 36}}{{ctx.Locale.Tr "repo.issues.pin_comment" $createdStr}} + {{else}}{{ctx.Locale.Tr "repo.issues.unpin_comment" $createdStr}}{{end}} + +
    + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/view_content/comments_authorlink.tmpl b/templates/repo/issue/view_content/comments_authorlink.tmpl new file mode 100644 index 00000000..f652a0be --- /dev/null +++ b/templates/repo/issue/view_content/comments_authorlink.tmpl @@ -0,0 +1,11 @@ +{{if .comment.OriginalAuthor}} + + {{svg (MigrationIcon .ctxData.Repository.GetOriginalURLHostname)}} + {{.comment.OriginalAuthor}} + + {{if .ctxData.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" .ctxData.Repository.OriginalURL .ctxData.Repository.GetOriginalURLHostname}}) + {{end}} +{{else}} + {{template "shared/user/authorlink" .comment.Poster}} +{{end}} diff --git a/templates/repo/issue/view_content/comments_delete_time.tmpl b/templates/repo/issue/view_content/comments_delete_time.tmpl new file mode 100644 index 00000000..2377e7c4 --- /dev/null +++ b/templates/repo/issue/view_content/comments_delete_time.tmpl @@ -0,0 +1,18 @@ +{{if and .comment.Time (.ctxData.Repository.IsTimetrackerEnabled ctx)}} {{/* compatibility with time comments made before v1.14 */}} + {{if (not .comment.Time.Deleted)}} + {{if (or .ctxData.IsAdmin (and .ctxData.IsSigned (eq .ctxData.SignedUserID .comment.PosterID)))}} + + + + + {{end}} + {{end}} +{{end}} diff --git a/templates/repo/issue/view_content/context_menu.tmpl b/templates/repo/issue/view_content/context_menu.tmpl new file mode 100644 index 00000000..4afd73c3 --- /dev/null +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -0,0 +1,27 @@ + diff --git a/templates/repo/issue/view_content/conversation.tmpl b/templates/repo/issue/view_content/conversation.tmpl new file mode 100644 index 00000000..c788a611 --- /dev/null +++ b/templates/repo/issue/view_content/conversation.tmpl @@ -0,0 +1,137 @@ +{{$invalid := (index .comments 0).Invalidated}} +{{$resolved := (index .comments 0).IsResolved}} +{{$resolveDoer := (index .comments 0).ResolveDoer}} +{{$isNotPending := (not (eq (index .comments 0).Review.Type 0))}} +
    +
    +
    + {{(index .comments 0).TreePath}} + {{if $invalid}} + + {{ctx.Locale.Tr "repo.issues.review.outdated"}} + + {{end}} +
    +
    + {{if or $invalid $resolved}} + + + {{end}} +
    +
    + {{$diff := (CommentMustAsDiff ctx (index .comments 0))}} + {{if $diff}} + {{$file := (index $diff.Files 0)}} +
    +
    +
    + + + {{template "repo/diff/section_unified" dict "file" $file "root" $}} + +
    +
    +
    +
    + {{end}} +
    +
    + {{range .comments}} + {{$createdSubStr:= TimeSinceUnix .CreatedUnix ctx.Locale}} +
    +
    +
    +
    + {{if not .OriginalAuthor}} + + {{ctx.AvatarUtils.Avatar .Poster 20}} + + {{end}} + + {{if .OriginalAuthor}} + + {{svg (MigrationIcon $.Repository.GetOriginalURLHostname)}} + {{.OriginalAuthor}} + + {{if $.Repository.OriginalURL}} + ({{ctx.Locale.Tr "repo.migrated_from" $.Repository.OriginalURL $.Repository.GetOriginalURLHostname}}) + {{end}} + {{else}} + {{template "shared/user/authorlink" .Poster}} + {{end}} + {{ctx.Locale.Tr "repo.issues.commented_at" .HashTag $createdSubStr}} + +
    +
    + {{template "repo/issue/view_content/show_role" dict "ShowRole" .ShowRole "IsPull" $.Issue.IsPull}} + {{if not $.Repository.IsArchived}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID)}} + {{template "repo/issue/view_content/context_menu" dict "ctxData" $ "item" . "delete" true "issue" true "diff" true "IsCommentPoster" (and $.IsSigned (eq $.SignedUserID .PosterID))}} + {{end}} +
    +
    +
    +
    + {{if .RenderedContent}} + {{.RenderedContent}} + {{else}} + {{ctx.Locale.Tr "repo.issues.no_content"}} + {{end}} +
    +
    {{.Content}}
    +
    + {{if .Attachments}} + {{template "repo/issue/view_content/attachments" dict "Attachments" .Attachments "RenderedContent" .RenderedContent}} + {{end}} +
    + {{$reactions := .Reactions.GroupByType}} + {{if $reactions}} + {{template "repo/issue/view_content/reactions" dict "ctxData" $ "ActionURL" (printf "%s/comments/%d/reactions" $.RepoLink .ID) "Reactions" $reactions}} + {{end}} +
    +
    + {{end}} +
    +
    +
    + {{if $resolved}} +
    + {{svg "octicon-check" 16 "tw-mr-1"}} + {{$resolveDoer.Name}} {{ctx.Locale.Tr "repo.issues.review.resolved_by"}} +
    + {{end}} +
    +
    + {{if and $.CanMarkConversation $isNotPending}} + + {{end}} + {{if and $.SignedUserID (not $.Repository.IsArchived)}} + + {{end}} +
    +
    + {{template "repo/diff/comment_form_datahandler" dict "hidden" true "reply" (index .comments 0).ReviewID "root" $ "comment" (index .comments 0)}} +
    +
    diff --git a/templates/repo/issue/view_content/pull.tmpl b/templates/repo/issue/view_content/pull.tmpl new file mode 100644 index 00000000..2672bd33 --- /dev/null +++ b/templates/repo/issue/view_content/pull.tmpl @@ -0,0 +1,396 @@ +{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}} +{{/* Then the merge box will not be displayed because this page already contains enough information */}} +{{else}} +
    +
    {{svg "octicon-git-merge" 40}}
    +
    + {{if .LatestCommitStatus}} +
    + {{template "repo/pulls/status" (dict + "CommitStatus" .LatestCommitStatus + "CommitStatuses" .LatestCommitStatuses + "MissingRequiredChecks" .MissingRequiredChecks + "ShowHideChecks" true + "is_context_required" .is_context_required + )}} +
    + {{end}} + {{$showGeneralMergeForm := false}} +
    + {{if .Issue.PullRequest.HasMerged}} + {{if .IsPullBranchDeletable}} +
    +
    +

    + {{ctx.Locale.Tr "repo.pulls.merged_success"}} +

    + +
    +
    + +
    +
    + {{end}} + {{else if .Issue.IsClosed}} +
    +
    +

    {{ctx.Locale.Tr "repo.pulls.closed"}}

    + +
    + {{if and .IsPullBranchDeletable (not .IsPullRequestBroken)}} +
    + +
    + {{end}} +
    + {{else if .IsPullFilesConflicted}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.files_conflicted"}} +
    +
      + {{range .ConflictedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if .IsPullRequestBroken}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.data_broken"}} +
    + {{else if .IsPullWorkInProgress}} +
    +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.cannot_merge_work_in_progress"}} +
    + {{if or .HasIssuesOrPullsWritePermission .IsIssuePoster}} + + {{end}} +
    + {{template "repo/issue/view_content/update_branch_by_merge" $}} + {{else if .Issue.PullRequest.IsChecking}} +
    + {{svg "octicon-sync"}} + {{ctx.Locale.Tr "repo.pulls.is_checking"}} +
    + {{else if .Issue.PullRequest.IsAncestor}} +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.is_ancestor"}} +
    + {{else if or .Issue.PullRequest.CanAutoMerge .Issue.PullRequest.IsEmpty}} + {{if .IsBlockedByApprovals}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} +
    + {{else if .IsBlockedByRejection}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} +
    + {{else if .IsBlockedByOfficialReviewRequests}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} +
    + {{else if .IsBlockedByOutdatedBranch}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} +
    + {{else if .IsBlockedByChangedProtectedFiles}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}} +
    +
      + {{range .ChangedProtectedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if and .EnableStatusCheck (or .RequiredStatusCheckState.IsError .RequiredStatusCheckState.IsFailure)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} +
    + {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_missing"}} +
    + {{else if and .AllowMerge .RequireSigned (not .WillSign)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} +
    +
    + {{svg "octicon-unlock"}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} +
    + {{end}} + + {{$notAllOverridableChecksOk := or .IsBlockedByApprovals .IsBlockedByRejection .IsBlockedByOfficialReviewRequests .IsBlockedByOutdatedBranch .IsBlockedByChangedProtectedFiles (and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess))}} + + {{/* admin can merge without checks, writer can merge when checks succeed */}} + {{$canMergeNow := and (or (and $.IsRepoAdmin (not .ProtectedBranch.ApplyToAdmins)) (not $notAllOverridableChecksOk)) (or (not .AllowMerge) (not .RequireSigned) .WillSign)}} + {{/* admin and writer both can make an auto merge schedule */}} + + {{if $canMergeNow}} + {{if $notAllOverridableChecksOk}} +
    + {{svg "octicon-dot-fill"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_administrator"}} +
    + {{else}} +
    + {{svg "octicon-check"}} + {{ctx.Locale.Tr "repo.pulls.can_auto_merge_desc"}} +
    + {{end}} + {{if .WillSign}} +
    + {{svg "octicon-lock" 16 "text green"}} + {{ctx.Locale.Tr "repo.signing.will_sign" .SigningKey}} +
    + {{else if .IsSigned}} +
    + {{svg "octicon-unlock"}} + {{ctx.Locale.Tr (printf "repo.signing.wont_sign.%s" .WontSignReason)}} +
    + {{end}} + {{end}} + {{template "repo/issue/view_content/update_branch_by_merge" $}} + {{if .Issue.PullRequest.IsEmpty}} +
    + +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.is_empty"}} +
    + {{end}} + + {{if .AllowMerge}} {{/* user is allowed to merge */}} + {{$prUnit := .Repository.MustGetUnit $.Context $.UnitTypePullRequests}} + {{if or $prUnit.PullRequestsConfig.AllowMerge $prUnit.PullRequestsConfig.AllowRebase $prUnit.PullRequestsConfig.AllowRebaseMerge $prUnit.PullRequestsConfig.AllowSquash $prUnit.PullRequestsConfig.AllowFastForwardOnly}} + {{$hasPendingPullRequestMergeTip := ""}} + {{if .HasPendingPullRequestMerge}} + {{$createdPRMergeStr := TimeSinceUnix .PendingPullRequestMerge.CreatedUnix ctx.Locale}} + {{$hasPendingPullRequestMergeTip = ctx.Locale.Tr "repo.pulls.auto_merge_has_pending_schedule" .PendingPullRequestMerge.Doer.Name $createdPRMergeStr}} + {{end}} +
    + + + {{$showGeneralMergeForm = true}} +
    + {{else}} + {{/* no merge style was set in repo setting: not or ($prUnit.PullRequestsConfig.AllowMerge ...) */}} +
    +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_desc"}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_helper"}} +
    + {{end}} {{/* end if the repo was set to use any merge style */}} + {{else}} + {{/* user is not allowed to merge */}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.no_merge_access"}} +
    + {{end}} {{/* end if user is allowed to merge or not */}} + {{else}} + {{/* Merge conflict without specific file. Suggest manual merge, only if all reviews and status checks OK. */}} + {{if .IsBlockedByApprovals}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_approvals" .GrantedApprovals .ProtectedBranch.RequiredApprovals}} +
    + {{else if .IsBlockedByRejection}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_rejection"}} +
    + {{else if .IsBlockedByOfficialReviewRequests}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_official_review_requests"}} +
    + {{else if .IsBlockedByOutdatedBranch}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.blocked_by_outdated_branch"}} +
    + {{else if .IsBlockedByChangedProtectedFiles}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.TrN $.ChangedProtectedFilesNum "repo.pulls.blocked_by_changed_protected_files_1" "repo.pulls.blocked_by_changed_protected_files_n"}} +
    +
      + {{range .ChangedProtectedFiles}} +
    • {{.}}
    • + {{end}} +
    + {{else if and .EnableStatusCheck (not .RequiredStatusCheckState.IsSuccess)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.required_status_check_failed"}} +
    + {{else if and .RequireSigned (not .WillSign)}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.require_signed_wont_sign"}} +
    + {{else}} +
    + {{svg "octicon-x"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_desc"}} +
    +
    + {{svg "octicon-info"}} + {{ctx.Locale.Tr "repo.pulls.cannot_auto_merge_helper"}} +
    + {{end}} + {{end}}{{/* end if: pull request status */}} + + {{/* + Manually Merged is not a well-known feature, it is used to mark a non-mergeable PR (already merged, conflicted) as merged + To test it: + * Enable "Manually Merged" feature in the Repository Settings + * Create a pull request, either: + * - Merge the pull request branch locally and push the merged commit to Gitea + * - Make some conflicts between the base branch and the pull request branch + * Then the Manually Merged form will be shown in the merge form + */}} + {{if and $.StillCanManualMerge (not $showGeneralMergeForm)}} +
    +
    +
    + {{.CsrfTokenHtml}} +
    + +
    + +
    +
    + {{end}} + + {{if and .Issue.PullRequest.HeadRepo (not .Issue.PullRequest.HasMerged) (not .Issue.IsClosed)}} + {{template "repo/issue/view_content/pull_merge_instruction" dict "PullRequest" .Issue.PullRequest "ShowMergeInstructions" .ShowMergeInstructions}} + {{end}} +
    +
    +
    +{{end}} diff --git a/templates/repo/issue/view_content/pull_merge_instruction.tmpl b/templates/repo/issue/view_content/pull_merge_instruction.tmpl new file mode 100644 index 00000000..e8910280 --- /dev/null +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -0,0 +1,49 @@ +
    +
    + {{ctx.Locale.Tr "repo.pulls.cmd_instruction_hint"}} +

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_title"}}

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_checkout_desc"}}
    + {{$localBranch := .PullRequest.HeadBranch}} + {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}} + {{$localBranch = print .PullRequest.HeadRepo.OwnerName "-" .PullRequest.HeadBranch}} + {{end}} +
    + {{if eq .PullRequest.Flow 0}} +
    git fetch -u {{if ne .PullRequest.HeadRepo.ID .PullRequest.BaseRepo.ID}}{{else}}origin{{end}} {{.PullRequest.HeadBranch}}:{{$localBranch}}
    + {{else}} +
    git fetch -u origin +refs/pull/{{.PullRequest.Index}}/head:{{$localBranch}}
    + {{end}} +
    git checkout {{$localBranch}}
    +
    + {{if .ShowMergeInstructions}} +

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_title"}}

    {{ctx.Locale.Tr "repo.pulls.cmd_instruction_merge_desc"}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --no-ff {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --ff-only {{$localBranch}}
    +
    +
    +
    git checkout {{$localBranch}}
    +
    git rebase {{.PullRequest.BaseBranch}}
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --no-ff {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --squash {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge --ff-only {{$localBranch}}
    +
    +
    +
    git checkout {{.PullRequest.BaseBranch}}
    +
    git merge {{$localBranch}}
    +
    +
    git push origin {{.PullRequest.BaseBranch}}
    +
    + {{end}} +
    diff --git a/templates/repo/issue/view_content/reactions.tmpl b/templates/repo/issue/view_content/reactions.tmpl new file mode 100644 index 00000000..da631966 --- /dev/null +++ b/templates/repo/issue/view_content/reactions.tmpl @@ -0,0 +1,17 @@ +
    +{{range $key, $value := .Reactions}} + {{$hasReacted := $value.HasUser $.ctxData.SignedUserID}} + + {{ReactionToEmoji $key}} + {{len $value}} + +{{end}} +{{if AllowedReactions}} + {{template "repo/issue/view_content/add_reaction" dict "ctxData" $.ctxData "ActionURL" .ActionURL}} +{{end}} +
    diff --git a/templates/repo/issue/view_content/reference_issue_dialog.tmpl b/templates/repo/issue/view_content/reference_issue_dialog.tmpl new file mode 100644 index 00000000..c7a471f5 --- /dev/null +++ b/templates/repo/issue/view_content/reference_issue_dialog.tmpl @@ -0,0 +1,28 @@ + diff --git a/templates/repo/issue/view_content/show_role.tmpl b/templates/repo/issue/view_content/show_role.tmpl new file mode 100644 index 00000000..0f1b8955 --- /dev/null +++ b/templates/repo/issue/view_content/show_role.tmpl @@ -0,0 +1,15 @@ +{{if and .ShowRole.IsPoster (not .IgnorePoster)}} +
    + {{ctx.Locale.Tr "repo.issues.author"}} +
    +{{end}} +{{if .ShowRole.RoleInRepo}} +
    + {{.ShowRole.RoleInRepo.LocaleString ctx.Locale}} +
    +{{end}} diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl new file mode 100644 index 00000000..ba155398 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -0,0 +1,66 @@ +
    + {{template "repo/issue/view_content/sidebar/branch_selector_field" .}} + {{if .Issue.IsPull}} + {{template "repo/issue/view_content/sidebar/pull_review" .}} + {{template "repo/issue/view_content/sidebar/pull_wip" .}} +
    + {{end}} + + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + +
    + + {{template "repo/issue/view_content/sidebar/milestones" .}} +
    + + {{template "repo/issue/view_content/sidebar/projects" .}} +
    + + {{template "repo/issue/view_content/sidebar/assignees" .}} +
    + + {{if .Participants}} + {{template "repo/issue/view_content/sidebar/participants" .}} + {{end}} + + {{if and $.IssueWatch (not .Repository.IsArchived)}} +
    + + {{template "repo/issue/view_content/sidebar/watch" .}} + {{end}} + + {{if .Repository.IsTimetrackerEnabled $.Context}} + {{template "repo/issue/view_content/sidebar/timetracking" .}} + {{end}} + +
    + {{template "repo/issue/view_content/sidebar/due_deadline" .}} + + {{if .Repository.IsDependenciesEnabled $.Context}} +
    + + {{template "repo/issue/view_content/sidebar/dependencies" .}} + {{end}} + +
    + {{template "repo/issue/view_content/sidebar/reference" .}} + + {{if and .IsRepoAdmin (not .Repository.IsArchived)}} +
    + + {{template "repo/issue/view_content/sidebar/actions" .}} + {{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 00000000..36f21822 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/actions.tmpl @@ -0,0 +1,114 @@ +{{if or .PinEnabled .Issue.IsPinned}} +
    + {{$.CsrfTokenHtml}} + +
    +{{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 00000000..e51bda95 --- /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/view_content/sidebar/branch_selector_field.tmpl b/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl new file mode 100644 index 00000000..c23e13b2 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/branch_selector_field.tmpl @@ -0,0 +1,59 @@ +{{if and (not .Issue.IsPull) (not .PageIsComparePull)}} + + +
    + {{$.CsrfTokenHtml}} +
    +{{/* TODO: share this branch selector dropdown with the same in repo page */}} + + +
    +{{end}} 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 00000000..791bd5c4 --- /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}} +
    +
    + + #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} + +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{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}} +
    +
    + + #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} + +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{end}} + {{if $.CanCreateIssueDependencies}} + {{range .BlockedByDependenciesNotPermitted}} +
    +
    +
    + {{svg "octicon-lock" 16}} + + #{{.Issue.Index}} {{.Issue.Title | RenderEmoji $.Context}} + +
    +
    + {{.Repository.OwnerName}}/{{.Repository.Name}} +
    +
    +
    + {{if and $.CanCreateIssueDependencies (not $.Repository.IsArchived)}} + + {{svg "octicon-trash" 16}} + + {{end}} +
    +
    + {{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)}} +
    +
    + {{$.CsrfTokenHtml}} +
    + + +
    +
    +
    + {{end}} +
    + +{{if and .CanCreateIssueDependencies (not .Repository.IsArchived)}} + + + +{{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 00000000..2de836b4 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/due_deadline.tmpl @@ -0,0 +1,41 @@ +{{ctx.Locale.Tr "repo.issues.due_date"}} +
    +
    + {{svg "octicon-x" 16 "close icon"}} + {{ctx.Locale.Tr "repo.issues.due_date_invalid"}} +
    + {{if ne .Issue.DeadlineUnix 0}} +

    +

    +
    + {{svg "octicon-calendar" 16 "tw-mr-2"}} + {{DateTime "long" .Issue.DeadlineUnix.FormatDate}} +
    +
    + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} + {{svg "octicon-pencil" 16 "tw-mr-1"}} + {{svg "octicon-trash"}} + {{end}} +
    +
    +

    + {{else}} +

    {{ctx.Locale.Tr "repo.issues.due_date_not_set"}}

    + {{end}} + + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} +
    +
    + {{$.CsrfTokenHtml}} + + +
    +
    + {{end}} +
    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 00000000..661ca807 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/milestones.tmpl @@ -0,0 +1,22 @@ + +
    + {{ctx.Locale.Tr "repo.issues.new.no_milestone"}} + +
    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 00000000..93e2579d --- /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}} +
    + {{range .Participants}} + + {{ctx.AvatarUtils.Avatar . 28 "tw-my-0.5 tw-mr-1"}} + + {{end}} +
    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 00000000..91d75f3b --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/projects.tmpl @@ -0,0 +1,54 @@ + +
    + {{ctx.Locale.Tr "repo.issues.new.no_projects"}} + +
    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 00000000..6ec5c05f --- /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 00000000..930c2a63 --- /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 00000000..102508fd --- /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}} + {{ctx.AvatarUtils.Avatar .User 20 "tw-mr-2"}}{{.User.GetDisplayName}} + {{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}} + + + {{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 00000000..f1588b3f --- /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 00000000..bbbc0995 --- /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 00000000..610600b2 --- /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"}} +
    +
    + {{$.CsrfTokenHtml}} +
    +
    + {{$.CsrfTokenHtml}} +
    + {{if $.IsStopwatchRunning}} + + + {{else}} + {{if .HasUserStopwatch}} +
    + {{ctx.Locale.Tr "repo.issues.tracking_already_started" .OtherStopwatchURL}} +
    + {{end}} + + + + {{end}} +
    +
    +{{end}} +{{if .WorkingUsers}} +
    +
    + {{ctx.Locale.Tr "repo.issues.time_spent_from_all_authors" ($.Issue.TotalTrackedTime | Sec2Time)}} +
    + {{range $user, $trackedtime := .WorkingUsers}} +
    + + {{ctx.AvatarUtils.Avatar $user}} + +
    + {{template "shared/user/authorlink" $user}} +
    + {{$trackedtime|Sec2Time}} +
    +
    +
    + {{end}} +
    +
    +{{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 00000000..ee141680 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/watch.tmpl @@ -0,0 +1,6 @@ +
    + {{ctx.Locale.Tr "notification.notifications"}} +
    + {{template "repo/issue/view_content/sidebar/watching" .}} +
    +
    diff --git a/templates/repo/issue/view_content/sidebar/watching.tmpl b/templates/repo/issue/view_content/sidebar/watching.tmpl new file mode 100644 index 00000000..d3d75946 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/watching.tmpl @@ -0,0 +1,19 @@ +
    + + +
    diff --git a/templates/repo/issue/view_content/update_branch_by_merge.tmpl b/templates/repo/issue/view_content/update_branch_by_merge.tmpl new file mode 100644 index 00000000..adce052d --- /dev/null +++ b/templates/repo/issue/view_content/update_branch_by_merge.tmpl @@ -0,0 +1,37 @@ +{{if and (gt $.Issue.PullRequest.CommitsBehind 0) (not $.Issue.IsClosed) (not $.Issue.PullRequest.IsChecking) (not $.IsPullFilesConflicted) (not $.IsPullRequestBroken)}} +
    +
    +
    + {{svg "octicon-alert"}} + {{ctx.Locale.Tr "repo.pulls.outdated_with_base_branch"}} +
    +
    + {{if and $.UpdateAllowed $.UpdateByRebaseAllowed}} +
    +
    + + +
    +
    + {{end}} + {{if and $.UpdateAllowed (not $.UpdateByRebaseAllowed)}} +
    + {{$.CsrfTokenHtml}} + +
    + {{end}} +
    +
    +{{end}} diff --git a/templates/repo/issue/view_title.tmpl b/templates/repo/issue/view_title.tmpl new file mode 100644 index 00000000..c6276279 --- /dev/null +++ b/templates/repo/issue/view_title.tmpl @@ -0,0 +1,145 @@ +{{if .Flash}} +
    + {{template "base/alert" .}} +
    +{{end}} +
    + {{$canEditIssueTitle := and (or .HasIssuesOrPullsWritePermission .IsIssuePoster) (not .Repository.IsArchived)}} +
    +

    + {{RenderIssueTitle $.Context .Issue.Title ($.Repository.ComposeMetas ctx) | RenderCodeBlock}} + #{{.Issue.Index}} +

    +
    + {{if $canEditIssueTitle}} + + {{end}} + {{if not .Issue.IsPull}} + {{ctx.Locale.Tr "repo.issues.new"}} + {{end}} +
    +
    + {{if $canEditIssueTitle}} +
    +
    + +
    +
    + + +
    +
    + {{end}} +
    + {{if .HasMerged}} +
    {{svg "octicon-git-merge" 16 "tw-mr-1"}} {{if eq .Issue.PullRequest.Status 3}}{{ctx.Locale.Tr "repo.pulls.manually_merged"}}{{else}}{{ctx.Locale.Tr "repo.pulls.merged"}}{{end}}
    + {{else if .Issue.IsClosed}} +
    {{if .Issue.IsPull}}{{svg "octicon-git-pull-request"}}{{else}}{{svg "octicon-issue-closed"}}{{end}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
    + {{else if .Issue.IsPull}} + {{if .IsPullWorkInProgress}} +
    {{svg "octicon-git-pull-request-draft"}} {{ctx.Locale.Tr "repo.issues.draft_title"}}
    + {{else}} +
    {{svg "octicon-git-pull-request"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
    + {{end}} + {{else}} +
    {{svg "octicon-issue-opened"}} {{ctx.Locale.Tr "repo.issues.open_title"}}
    + {{end}} +
    + {{if .Issue.IsPull}} + {{$headHref := .HeadTarget}} + {{if .HeadBranchLink}} + {{$headHref = HTMLFormat `%s` .HeadBranchLink $headHref}} + {{end}} + {{if not .MadeUsingAGit}} + {{$headHref = HTMLFormat `%s ` $headHref (ctx.Locale.Tr "copy_branch") .HeadTarget (svg "octicon-copy" 14)}} + {{end}} + {{$baseHref := .BaseTarget}} + {{if .BaseBranchLink}} + {{$baseHref = HTMLFormat `%s` .BaseBranchLink $baseHref}} + {{end}} + {{if .Issue.PullRequest.HasMerged}} + {{$mergedStr:= TimeSinceUnix .Issue.PullRequest.MergedUnix ctx.Locale}} + {{if .Issue.OriginalAuthor}} + {{.Issue.OriginalAuthor}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.merged_title_desc_one" "repo.pulls.merged_title_desc_few" .NumCommits $headHref $baseHref $mergedStr}} + {{else}} + {{.Issue.PullRequest.Merger.GetDisplayName}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.merged_title_desc_one" "repo.pulls.merged_title_desc_few" .NumCommits $headHref $baseHref $mergedStr}} + {{end}} + {{if .MadeUsingAGit}} + {{/* TODO: Move documentation link to the instructions at the bottom of the PR, show instructions when clicking label */}} + {{/* Note: #agit-label is necessary for testing whether the label appears when it should in tests/integration/git_test.go */}} + + + {{ctx.Locale.Tr "repo.pulls.made_using_agit"}} + + + {{end}} + {{else}} + {{if .Issue.OriginalAuthor}} + {{.Issue.OriginalAuthor}} {{ctx.Locale.TrN .NumCommits "repo.pulls.title_desc_one" "repo.pulls.title_desc_few" .NumCommits $headHref $baseHref}} + {{else}} + + {{.Issue.Poster.GetDisplayName}} + {{ctx.Locale.TrN .NumCommits "repo.pulls.title_desc_one" "repo.pulls.title_desc_few" .NumCommits $headHref $baseHref}} + + {{end}} + {{if .MadeUsingAGit}} + {{/* TODO: Move documentation link to the instructions at the bottom of the PR, show instructions when clicking label */}} + {{/* Note: #agit-label is necessary for testing whether the label appears when it should in tests/integration/git_test.go */}} + + + {{ctx.Locale.Tr "repo.pulls.made_using_agit"}} + + + {{end}} + + + {{svg "octicon-arrow-right"}} + + + {{end}} + {{else}} + {{$createdStr:= TimeSinceUnix .Issue.CreatedUnix ctx.Locale}} + + {{if .Issue.OriginalAuthor}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.OriginalAuthor}} + {{else if gt .Issue.Poster.ID 0}} + {{ctx.Locale.Tr "repo.issues.opened_by" $createdStr .Issue.Poster.HomeLink .Issue.Poster.GetDisplayName}} + {{else}} + {{ctx.Locale.Tr "repo.issues.opened_by_fake" $createdStr .Issue.Poster.GetDisplayName}} + {{end}} + ยท + {{ctx.Locale.TrN .Issue.NumComments "repo.issues.num_comments_1" "repo.issues.num_comments" .Issue.NumComments}} + + {{end}} +
    +
    +
    -- cgit v1.2.3