From cc83b9349df9aa49a9736fe747ecbd668c3448fc Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Thu, 25 Apr 2024 13:34:48 +0200 Subject: [PATCH] Split deadline / due date --- .../repo/issue/view_content/sidebar.tmpl | 42 +------------------ .../view_content/sidebar/due_deadline.tmpl | 41 ++++++++++++++++++ 2 files changed, 42 insertions(+), 41 deletions(-) create mode 100644 templates/repo/issue/view_content/sidebar/due_deadline.tmpl diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 866c9e4c1..35e97085c 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -35,47 +35,7 @@ {{end}}
- {{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}} -
+ {{template "repo/issue/view_content/sidebar/due_deadline" .}} {{if .Repository.IsDependenciesEnabled $.Context}}
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 000000000..2de836b4e --- /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}} +