Skip to content
Snippets Groups Projects
Commit 3c508eaa authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

Read {ISSUE,MERGE_REQUESTS}_TEMPLATE from repository head

parent 66c03e0e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -50,6 +50,9 @@ class Projects::IssuesController < Projects::ApplicationController
)
 
@issue = @noteable = @project.issues.new(issue_params)
@issue.description = @project.repository_issues_template
respond_with(@issue)
end
 
Loading
Loading
Loading
Loading
@@ -929,4 +929,16 @@ class Project < ActiveRecord::Base
def wiki
@wiki ||= ProjectWiki.new(self, self.owner)
end
def repository_issues_template
repository.blob_at_branch('HEAD', 'ISSUE_TEMPLATE').data
rescue
nil
end
def repository_merge_requests_template
repository.blob_at_branch('HEAD', 'MERGE_REQUESTS_TEMPLATE').data
rescue
nil
end
end
Loading
Loading
@@ -61,6 +61,8 @@ module MergeRequests
merge_request.title = merge_request.source_branch.titleize.humanize
end
 
merge_request.description = merge_request.target_project.repository_merge_requests_template
merge_request
end
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment