From a8f8667a039171bd37a95a1789771c447b8ef287 Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Thu, 25 Apr 2024 14:43:51 +0200 Subject: [PATCH] Split references and actions --- .../repo/issue/view_content/sidebar.tmpl | 123 +----------------- .../issue/view_content/sidebar/actions.tmpl | 114 ++++++++++++++++ .../issue/view_content/sidebar/reference.tmpl | 7 + 3 files changed, 123 insertions(+), 121 deletions(-) create mode 100644 templates/repo/issue/view_content/sidebar/actions.tmpl create mode 100644 templates/repo/issue/view_content/sidebar/reference.tmpl diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 4c14e08013..b6fe04be63 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -44,131 +44,12 @@ {{end}}
-
- {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}} -
- {{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}} - -
-
+ {{template "repo/issue/view_content/sidebar/reference" .}} {{if and .IsRepoAdmin (not .Repository.IsArchived)}}
- {{if or .PinEnabled .Issue.IsPinned}} -
- {{$.CsrfTokenHtml}} - -
- {{end}} - - - - - + {{template "repo/issue/view_content/sidebar/actions" .}} {{end}} {{if and .Issue.IsPull .IsIssuePoster (not .Issue.IsClosed) .Issue.PullRequest.HeadRepo}} diff --git a/templates/repo/issue/view_content/sidebar/actions.tmpl b/templates/repo/issue/view_content/sidebar/actions.tmpl new file mode 100644 index 0000000000..36f21822aa --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/actions.tmpl @@ -0,0 +1,114 @@ +{{if or .PinEnabled .Issue.IsPinned}} +
+ {{$.CsrfTokenHtml}} + +
+{{end}} + + + + + diff --git a/templates/repo/issue/view_content/sidebar/reference.tmpl b/templates/repo/issue/view_content/sidebar/reference.tmpl new file mode 100644 index 0000000000..bbbc099558 --- /dev/null +++ b/templates/repo/issue/view_content/sidebar/reference.tmpl @@ -0,0 +1,7 @@ +
+ {{$issueReferenceLink := printf "%s#%d" .Issue.Repo.FullName .Issue.Index}} +
+ {{ctx.Locale.Tr "repo.issues.reference_link" $issueReferenceLink}} + +
+