From f8db1d4da8fe4d6768c4daa6dbb70a790003855c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 12 Mar 2023 21:39:56 +0100 Subject: [PATCH 1/2] Deduplicate template code for label selection menu --- .../issue/labels/labels_selector_field.tmpl | 43 +++++++++++++++++ templates/repo/issue/new_form.tmpl | 47 +------------------ .../repo/issue/view_content/sidebar.tmpl | 46 +----------------- 3 files changed, 47 insertions(+), 89 deletions(-) create mode 100644 templates/repo/issue/labels/labels_selector_field.tmpl diff --git a/templates/repo/issue/labels/labels_selector_field.tmpl b/templates/repo/issue/labels/labels_selector_field.tmpl new file mode 100644 index 000000000000..00d852bba98b --- /dev/null +++ b/templates/repo/issue/labels/labels_selector_field.tmpl @@ -0,0 +1,43 @@ + diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index 4ce4ffb8e3a4..a99ceb045148 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -36,51 +36,8 @@ {{template "repo/issue/branch_selector_field" .}} - - {{template "repo/issue/labels/labels_sidebar" dict "root" $ "ctx" .}} + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index 0728f5390a18..e58f94aff389 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -106,50 +106,8 @@
{{end}} - - {{template "repo/issue/labels/labels_sidebar" dict "root" $ "ctx" .}} + {{template "repo/issue/labels/labels_selector_field" .}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $}}
From 1dcf2543d43f1cb334fea60e8748301ff9462734 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Mon, 13 Mar 2023 09:51:58 +0800 Subject: [PATCH 2/2] Fix missing ctx variable in template --- templates/repo/issue/new_form.tmpl | 2 +- templates/repo/issue/view_content/sidebar.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl index a99ceb045148..26fb418d72cb 100644 --- a/templates/repo/issue/new_form.tmpl +++ b/templates/repo/issue/new_form.tmpl @@ -37,7 +37,7 @@ {{template "repo/issue/labels/labels_selector_field" .}} - {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $ "ctx" .}}
diff --git a/templates/repo/issue/view_content/sidebar.tmpl b/templates/repo/issue/view_content/sidebar.tmpl index e58f94aff389..5f2143af74c8 100644 --- a/templates/repo/issue/view_content/sidebar.tmpl +++ b/templates/repo/issue/view_content/sidebar.tmpl @@ -107,7 +107,7 @@ {{end}} {{template "repo/issue/labels/labels_selector_field" .}} - {{template "repo/issue/labels/labels_sidebar" dict "root" $}} + {{template "repo/issue/labels/labels_sidebar" dict "root" $ "ctx" .}}