aboutsummaryrefslogtreecommitdiffstats
path: root/modules/issue/template
diff options
context:
space:
mode:
Diffstat (limited to 'modules/issue/template')
-rw-r--r--modules/issue/template/template.go11
-rw-r--r--modules/issue/template/template_test.go3
2 files changed, 11 insertions, 3 deletions
diff --git a/modules/issue/template/template.go b/modules/issue/template/template.go
index f8bce3f465..0f19d87e8d 100644
--- a/modules/issue/template/template.go
+++ b/modules/issue/template/template.go
@@ -259,7 +259,9 @@ func (f *valuedField) WriteTo(builder *strings.Builder) {
}
// write label
- _, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
+ if !f.HideLabel() {
+ _, _ = fmt.Fprintf(builder, "### %s\n\n", f.Label())
+ }
blankPlaceholder := "_No response_\n"
@@ -311,6 +313,13 @@ func (f *valuedField) Label() string {
return ""
}
+func (f *valuedField) HideLabel() bool {
+ if label, ok := f.Attributes["hide_label"].(bool); ok {
+ return label
+ }
+ return false
+}
+
func (f *valuedField) Render() string {
if render, ok := f.Attributes["render"].(string); ok {
return render
diff --git a/modules/issue/template/template_test.go b/modules/issue/template/template_test.go
index 0845642cd3..0cdddd0c85 100644
--- a/modules/issue/template/template_test.go
+++ b/modules/issue/template/template_test.go
@@ -640,6 +640,7 @@ body:
description: Description of input
placeholder: Placeholder of input
value: Value of input
+ hide_label: true
validations:
required: true
is_number: true
@@ -681,8 +682,6 @@ body:
` + "```bash\nValue of id2\n```" + `
-### Label of input
-
Value of id3
### Label of dropdown