From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- .../repo/issue/view_content/add_reaction.tmpl | 12 + templates/repo/issue/view_content/attachments.tmpl | 42 ++ templates/repo/issue/view_content/comments.tmpl | 691 +++++++++++++++++++++ .../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 | 57 ++ 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 | 62 ++ .../sidebar/branch_selector_field.tmpl | 59 ++ .../issue/view_content/sidebar/dependencies.tmpl | 146 +++++ .../issue/view_content/sidebar/due_deadline.tmpl | 41 ++ .../issue/view_content/sidebar/milestones.tmpl | 24 + .../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 ++ 30 files changed, 2300 insertions(+) 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 (limited to 'templates/repo/issue/view_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 0000000..37931f2 --- /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 0000000..79085df --- /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 0000000..08c83c0 --- /dev/null +++ b/templates/repo/issue/view_content/comments.tmpl @@ -0,0 +1,691 @@ +{{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" (RenderRefIssueTitle $.Context .OldTitle) (RenderRefIssueTitle $.Context .NewTitle) $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}} + {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}} + {{if not .OldProject.IsGhost}} + {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .OldProject.Type)}} + {{end}} + {{$oldProjectDisplayHtml = HTMLFormat `%s` $tooltip .OldProject.Title}} + {{end}} + {{$newProjectDisplayHtml := "Unknown Project"}} + {{if .Project}} + {{$tooltip := ctx.Locale.Tr "projects.deleted.display_name"}} + {{if not .Project.IsGhost}} + {{$tooltip = ctx.Locale.Tr (printf "projects.type-%d.display_name" .Project.Type)}} + {{end}} + {{$newProjectDisplayHtml = HTMLFormat `%s` $tooltip .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 0000000..f652a0b --- /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 0000000..2377e7c --- /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 0000000..4afd73c --- /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 0000000..c788a61 --- /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 0000000..bbbb8bf --- /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 "AutodetectManualMerge" .AutodetectManualMerge}} + {{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 0000000..b7aae53 --- /dev/null +++ b/templates/repo/issue/view_content/pull_merge_instruction.tmpl @@ -0,0 +1,57 @@ +
+
+ {{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"}} + {{if not .AutodetectManualMerge}} +

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

+ {{end}} +
+
+
+
git checkout {{.PullRequest.BaseBranch}}
+
git merge --no-ff {{$localBranch}}
+
+
+
git checkout {{$localBranch}}
+
git rebase {{.PullRequest.BaseBranch}}
+
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 0000000..da63196 --- /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 0000000..c7a471f --- /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 0000000..0f1b895 --- /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 0000000..623023b --- /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" dict "isExistingIssue" true "." .}} +
+ + {{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 0000000..36f2182 --- /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 0000000..7a928fa --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/assignees.tmpl @@ -0,0 +1,62 @@ + + +
+ + {{ctx.Locale.Tr "repo.issues.new.no_assignees"}} + {{if and .HasIssuesOrPullsWritePermission (not .Repository.IsArchived)}} + {{with index .Assignees 0}} + – + + {{ctx.Locale.Tr "repo.issues.new.assign_to_me"}} + + {{end}} + {{end}} + +
+ {{if .isExistingIssue}} + {{range .Issue.Assignees}} + + {{end}} + {{else}} + {{range .Assignees}} + + {{ctx.AvatarUtils.Avatar . 28 "tw-mr-2"}}{{.GetDisplayName}} + + {{end}} + {{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 0000000..c23e13b --- /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 0000000..6a9b651 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/dependencies.tmpl @@ -0,0 +1,146 @@ +
+ {{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}} {{RenderRefIssueTitle $.Context .Issue.Title}}} + +
+ {{.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}} +
+
+ {{$title := RenderRefIssueTitle $.Context .Issue.Title}} + + #{{.Issue.Index}} {{RenderRefIssueTitle $.Context .Issue.Title}} + +
+ {{.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}} {{RenderRefIssueTitle $.Context .DependentIssue.Title}} + +
+
+ {{.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 0000000..2de836b --- /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 0000000..44d9419 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/milestones.tmpl @@ -0,0 +1,24 @@ + 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 0000000..93e2579 --- /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 0000000..91d75f3 --- /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 0000000..6ec5c05 --- /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 0000000..930c2a6 --- /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 0000000..102508f --- /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 0000000..f1588b3 --- /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 0000000..bbbc099 --- /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 0000000..610600b --- /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 0000000..ee14168 --- /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 0000000..d3d7594 --- /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 0000000..adce052 --- /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}} -- cgit v1.2.3