Skip to content

Commit a50e376

Browse files
committed
Offer blank topic template if maintainer does not disallow it
Maintainers can set `blank_issues_enabled' to `false' in "config.yml" to force users to use a template when going through the web-interface. Respect that here too, but when the value is `true' or unspecified, then start offering creating a topic from scratch. Closes ^768.
1 parent 1414ede commit a50e376

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lisp/forge-topic.el

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,10 +1900,13 @@ When point is on the answer, then unmark it and mark no other."
19001900
(buffer-substring-no-properties (point-min) (point-max))
19011901
:object-type 'alist
19021902
:sequence-type 'list))
1903-
(mapcar (lambda (link)
1904-
`(,@link
1905-
(prompt ,(let-alist link (concat .name " -- " .about)))))
1906-
.contact_links)))
1903+
(nconc
1904+
(and (not (eq .blank_issues_enabled :false)) ;unset means true
1905+
'(((prompt . "Blank issue -- Create a new issue from scratch"))))
1906+
(mapcar (lambda (link)
1907+
`(,@link
1908+
(prompt ,(let-alist link (concat .name " -- " .about)))))
1909+
.contact_links))))
19071910

19081911
(cl-defgeneric forge--topic-template-files (repo class)
19091912
"Return a list of topic template files for REPO and a topic of CLASS.")

0 commit comments

Comments
 (0)