From 0eec8b84a1d63be68d41518bfff0f7f9d9eadb0c Mon Sep 17 00:00:00 2001 From: Otto Richter Date: Thu, 25 Apr 2024 13:37:43 +0200 Subject: [PATCH] Split issue dependencies --- .../repo/issue/view_content/sidebar.tmpl | 146 +----------------- .../view_content/sidebar/dependencies.tmpl | 145 +++++++++++++++++ 2 files changed, 146 insertions(+), 145 deletions(-) create mode 100644 templates/repo/issue/view_content/sidebar/dependencies.tmpl diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 35e97085c5..4c14e08013 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -40,151 +40,7 @@ {{if .Repository.IsDependenciesEnabled $.Context}}
-
- {{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}} + {{template "repo/issue/view_content/sidebar/dependencies" .}} {{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 0000000000..791bd5c4a1 --- /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}}