1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-19 08:48:37 +00:00

Implement issue and pull request templates.

Similar to GitHub:
https://github.com/blog/2111-issue-and-pull-request-templates

Priority:
- root
- .gogs
- .github
This commit is contained in:
Andrey Nering
2016-02-17 20:21:31 -02:00
parent ccc94dd11c
commit 658bfc2704
3 changed files with 60 additions and 1 deletions

View File

@@ -26,6 +26,16 @@ const (
COMPARE_PULL base.TplName = "repo/pulls/compare"
PULL_COMMITS base.TplName = "repo/pulls/commits"
PULL_FILES base.TplName = "repo/pulls/files"
PULL_REQUEST_TEMPLATE_KEY = "PullRequestTemplate"
)
var (
PullRequestTemplateCandidates = []string{
"PULL_REQUEST.md",
".gogs/PULL_REQUEST.md",
".github/PULL_REQUEST.md",
}
)
func getForkRepository(ctx *middleware.Context) *models.Repository {
@@ -540,6 +550,7 @@ func CompareAndPullRequest(ctx *middleware.Context) {
ctx.Data["PageIsComparePull"] = true
ctx.Data["IsDiffCompare"] = true
ctx.Data["RequireHighlightJS"] = true
setTemplateIfExists(ctx, PULL_REQUEST_TEMPLATE_KEY, PullRequestTemplateCandidates)
renderAttachmentSettings(ctx)
headUser, headRepo, headGitRepo, prInfo, baseBranch, headBranch := ParseCompareInfo(ctx)