mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-06-19 11:18:16 +08: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:
@ -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)
|
||||
|
Reference in New Issue
Block a user