summaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorJohn Olheiser <john.olheiser@gmail.com>2020-09-11 09:48:39 -0500
committerGitHub <noreply@github.com>2020-09-11 10:48:39 -0400
commit26c4a049da178993e5ccddcb50e7edc70a6bde5d (patch)
tree494106117720ff3ad5f9e77a380c9397c3cfe10b /templates/repo
parentdd1a651b5895cfdb8a141a56aa824ed4d082c41a (diff)
downloadgitea-26c4a049da178993e5ccddcb50e7edc70a6bde5d.tar.gz
gitea-26c4a049da178993e5ccddcb50e7edc70a6bde5d.zip
Issue templates directory (#11450)
* Issue templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add some comments, appease the linter Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add docs and re-use dir candidates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Add default labels to issue templates Signed-off-by: jolheiser <john.olheiser@gmail.com> * Generate swagger Signed-off-by: jolheiser <john.olheiser@gmail.com> * Suggested changes Signed-off-by: jolheiser <john.olheiser@gmail.com> * Update issue.go * Suggestions Signed-off-by: jolheiser <john.olheiser@gmail.com> * Extract metadata from legacy if possible Signed-off-by: jolheiser <john.olheiser@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/issue/choose.tmpl25
-rw-r--r--templates/repo/issue/list.tmpl2
-rw-r--r--templates/repo/issue/milestone_issues.tmpl2
-rw-r--r--templates/repo/issue/new_form.tmpl2
-rw-r--r--templates/repo/issue/view.tmpl2
5 files changed, 29 insertions, 4 deletions
diff --git a/templates/repo/issue/choose.tmpl b/templates/repo/issue/choose.tmpl
new file mode 100644
index 0000000000..57f69f8c14
--- /dev/null
+++ b/templates/repo/issue/choose.tmpl
@@ -0,0 +1,25 @@
+{{template "base/head" .}}
+<div class="repository new issue">
+ {{template "repo/header" .}}
+ <div class="ui container">
+ <div class="navbar">
+ {{template "repo/issue/navbar" .}}
+ </div>
+ <div class="ui divider"></div>
+ {{range .IssueTemplates}}
+ <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="{{$.RepoLink}}/issues/new?template={{.FileName}}{{if $.milestone}}&milestone={{$.milestone}}{{end}}" class="ui green button">{{$.i18n.Tr "repo.issues.choose.get_started"}}</a>
+ </div>
+ </div>
+ </div>
+ {{end}}
+ <a href="{{.RepoLink}}/issues/new{{if .milestone}}?milestone={{.milestone}}{{end}}">{{.i18n.Tr "repo.issues.choose.blank"}}</a>
+ </div>
+</div>
+{{template "base/footer" .}}
diff --git a/templates/repo/issue/list.tmpl b/templates/repo/issue/list.tmpl
index 99b298be4d..36eb092202 100644
--- a/templates/repo/issue/list.tmpl
+++ b/templates/repo/issue/list.tmpl
@@ -12,7 +12,7 @@
{{if not .Repository.IsArchived}}
<div class="column right aligned">
{{if .PageIsIssueList}}
- <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
+ <a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.i18n.Tr "repo.issues.new"}}</a>
{{else}}
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | EscapePound}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{.Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | EscapePound}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
{{end}}
diff --git a/templates/repo/issue/milestone_issues.tmpl b/templates/repo/issue/milestone_issues.tmpl
index 8aecf8d773..7a55eaa01d 100644
--- a/templates/repo/issue/milestone_issues.tmpl
+++ b/templates/repo/issue/milestone_issues.tmpl
@@ -16,7 +16,7 @@
{{if or .CanWriteIssues .CanWritePulls}}
<a class="ui grey button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
{{end}}
- <a class="ui green button" href="{{.RepoLink}}/issues/new?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
+ <a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
</div>
{{end}}
</div>
diff --git a/templates/repo/issue/new_form.tmpl b/templates/repo/issue/new_form.tmpl
index 8d7b3902e4..058ade5bce 100644
--- a/templates/repo/issue/new_form.tmpl
+++ b/templates/repo/issue/new_form.tmpl
@@ -13,7 +13,7 @@
</a>
<div class="ui segment content">
<div class="field">
- <input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{.title}}" tabindex="3" autofocus required maxlength="255">
+ <input name="title" id="issue_title" placeholder="{{.i18n.Tr "repo.milestones.title"}}" value="{{if .TitleQuery}}{{.TitleQuery}}{{else if .IssueTemplateTitle}}{{.IssueTemplateTitle}}{{else}}{{.title}}{{end}}" tabindex="3" autofocus required maxlength="255">
{{if .PageIsComparePull}}
<div class="title_wip_desc" data-wip-prefixes="{{Json .PullRequestWorkInProgressPrefixes}}">{{.i18n.Tr "repo.pulls.title_wip_desc" (index .PullRequestWorkInProgressPrefixes 0| Escape) | Safe}}</div>
{{end}}
diff --git a/templates/repo/issue/view.tmpl b/templates/repo/issue/view.tmpl
index 6abf84cab9..c23bac3c6a 100644
--- a/templates/repo/issue/view.tmpl
+++ b/templates/repo/issue/view.tmpl
@@ -9,7 +9,7 @@
{{if not .Repository.IsArchived}}
<div class="column right aligned">
{{if .PageIsIssueList}}
- <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
+ <a class="ui green button" href="{{.RepoLink}}/issues/new{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.i18n.Tr "repo.issues.new"}}</a>
{{else}}
<a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{.RepoLink}}/compare/{{.BranchName | EscapePound}}...{{.PullRequestCtx.HeadInfo | EscapePound}}">{{.i18n.Tr "repo.pulls.new"}}</a>
{{end}}