diff options
author | JakobDev <jakobdev@gmx.de> | 2023-03-28 20:22:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-28 14:22:07 -0400 |
commit | f384b13f1cd44be3a87df5553a0099390dacd010 (patch) | |
tree | 08b2744df3a8792ef2f50e4d559d55e4a349c198 /templates/repo | |
parent | 5cd1d6c93ba9b8399f826e671b8940eb5294b872 (diff) | |
download | gitea-f384b13f1cd44be3a87df5553a0099390dacd010.tar.gz gitea-f384b13f1cd44be3a87df5553a0099390dacd010.zip |
Implement Issue Config (#20956)
Closes #20955
This PR adds the possibility to disable blank Issues, when the Repo has
templates. This can be done by creating the file
`.gitea/issue_config.yaml` with the content `blank_issues_enabled` in
the Repo.
Diffstat (limited to 'templates/repo')
-rw-r--r-- | templates/repo/issue/choose.tmpl | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl index 688e98bfc6..b5316454ba 100644 --- a/templates/repo/issue/choose.tmpl +++ b/templates/repo/issue/choose.tmpl @@ -20,17 +20,40 @@ </div> </div> {{end}} - <div class="ui attached segment"> - <div class="ui two column grid"> - <div class="column left aligned"> - <strong>{{.locale.Tr "repo.issues.choose.blank"}}</strong> - <br>{{.locale.Tr "repo.issues.choose.blank_about"}} + {{range .IssueConfig.ContactLinks}} + <div class="ui attached segment"> + <div class="ui two column grid"> + <div class="column left aligned"> + <strong>{{.Name | RenderEmojiPlain}}</strong> + <br>{{.About | RenderEmojiPlain}} + </div> + <div class="column right aligned"> + <a href="{{.URL}}" class="ui green button">{{svg "octicon-link-external"}} {{$.locale.Tr "repo.issues.choose.open_external_link"}}</a> + </div> </div> - <div class="column right aligned"> - <a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui green button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a> + </div> + {{end}} + {{if .IssueConfig.BlankIssuesEnabled}} + <div class="ui attached segment"> + <div class="ui two column grid"> + <div class="column left aligned"> + <strong>{{.locale.Tr "repo.issues.choose.blank"}}</strong> + <br/>{{.locale.Tr "repo.issues.choose.blank_about"}} + </div> + <div class="column right aligned"> + <a href="{{.RepoLink}}/issues/new?{{if .milestone}}&milestone={{.milestone}}{{end}}{{if $.project}}&project={{$.project}}{{end}}" class="ui green button">{{$.locale.Tr "repo.issues.choose.get_started"}}</a> + </div> </div> </div> - </div> + {{end}} + {{- if .IssueConfigError}}{{/* normal warning flash makes problems here*/}} + <div class="ui warning message"> + <div class="text left"> + <div>{{.locale.Tr "repo.issues.choose.invalid_config"}}</div> + <diy>{{.IssueConfigError}}</div> + </div> + </div> + {{end}} </div> </div> {{template "base/footer" .}} |