From eb0359cad4b725553c8bca3e95ada9c789c5da0b Mon Sep 17 00:00:00 2001 From: John Olheiser <42128690+jolheiser@users.noreply.github.com> Date: Tue, 19 Nov 2019 12:33:42 -0600 Subject: Context menus for comments (#9043) * Add quote replies Signed-off-by: jolheiser --- templates/repo/diff/comments.tmpl | 9 +-- templates/repo/issue/view_content.tmpl | 8 +-- templates/repo/issue/view_content/comments.tmpl | 81 ++++++++++------------ .../repo/issue/view_content/context_menu.tmpl | 22 ++++++ 4 files changed, 64 insertions(+), 56 deletions(-) create mode 100644 templates/repo/issue/view_content/context_menu.tmpl (limited to 'templates/repo') diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 85c84c6bac..cc62f19a32 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -21,12 +21,7 @@ {{end}} {{end}} {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.root.RepoLink .ID) }} - {{if or $.root.Permission.IsAdmin (eq .Poster.ID $.root.SignedUserID)}} -
- - -
- {{end}} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $.root "item" . "delete" true "diff" true }}
@@ -37,7 +32,7 @@ {{$.root.i18n.Tr "repo.issues.no_content"}} {{end}}
-
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content.tmpl b/templates/repo/issue/view_content.tmpl index 2379d21e9c..5b5d7c45d7 100644 --- a/templates/repo/issue/view_content.tmpl +++ b/templates/repo/issue/view_content.tmpl @@ -29,11 +29,7 @@ {{if not $.Repository.IsArchived}}
{{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/issues/%d/reactions" $.RepoLink .Issue.Index) }} - {{if or .IsIssueWriter .IsIssuePoster}} -
- -
- {{end}} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" .Issue "delete" false "diff" false }}
{{end}} @@ -45,7 +41,7 @@ {{.i18n.Tr "repo.issues.no_content"}} {{end}} -
{{.Issue.Content}}
+
{{.Issue.Content}}
{{$reactions := .Issue.Reactions.GroupByType}} diff --git a/templates/repo/issue/view_content/comments.tmpl b/templates/repo/issue/view_content/comments.tmpl index 86860fe8f4..1ea626ab84 100644 --- a/templates/repo/issue/view_content/comments.tmpl +++ b/templates/repo/issue/view_content/comments.tmpl @@ -23,28 +23,23 @@ {{else}} {{.Poster.GetDisplayName}} {{$.i18n.Tr "repo.issues.commented_at" .HashTag $createdStr | Safe}} {{end}} - {{if not $.Repository.IsArchived}} -
- {{if gt .ShowTag 0}} -
- {{if eq .ShowTag 1}} - {{$.i18n.Tr "repo.issues.poster"}} - {{else if eq .ShowTag 2}} - {{$.i18n.Tr "repo.issues.collaborator"}} - {{else if eq .ShowTag 3}} - {{$.i18n.Tr "repo.issues.owner"}} - {{end}} -
- {{end}} - {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) }} - {{if or $.Permission.IsAdmin (eq .Poster.ID $.SignedUserID)}} -
- - -
- {{end}} -
- {{end}} + {{if not $.Repository.IsArchived}} +
+ {{if gt .ShowTag 0}} +
+ {{if eq .ShowTag 1}} + {{$.i18n.Tr "repo.issues.poster"}} + {{else if eq .ShowTag 2}} + {{$.i18n.Tr "repo.issues.collaborator"}} + {{else if eq .ShowTag 3}} + {{$.i18n.Tr "repo.issues.owner"}} + {{end}} +
+ {{end}} + {{template "repo/issue/view_content/add_reaction" Dict "ctx" $ "ActionURL" (Printf "%s/comments/%d/reactions" $.RepoLink .ID) }} + {{template "repo/issue/view_content/context_menu" Dict "ctx" $ "item" . "delete" true "diff" false }} +
+ {{end}}
@@ -54,7 +49,7 @@ {{$.i18n.Tr "repo.issues.no_content"}} {{end}}
-
{{.Content}}
+
{{.Content}}
{{$reactions := .Reactions.GroupByType}} @@ -277,29 +272,29 @@ - - - {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - -
+ + + {{$.i18n.Tr "repo.issues.dependency.added_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} + + -
+ #{{.DependentIssue.Index}} {{.DependentIssue.Title}} + + {{else if eq .Type 20}}
- - - - - - {{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} - - -
+ + + + + + {{$.i18n.Tr "repo.issues.dependency.removed_dependency" .Poster.HomeLink (.Poster.GetDisplayName|Escape) $createdStr | Safe}} + +
+ + #{{.DependentIssue.Index}} {{.DependentIssue.Title}} +
+ {{else if eq .Type 22}}
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 0000000000..468e004c91 --- /dev/null +++ b/templates/repo/issue/view_content/context_menu.tmpl @@ -0,0 +1,22 @@ +{{if .ctx.IsSigned}} + +{{end}} -- cgit v1.2.3