Commit 7478ece8 authored by Marin Jankovski's avatar Marin Jankovski

Add template for merge request descriptions to projects.

parent ccff1051
...@@ -24,6 +24,14 @@ class Project ...@@ -24,6 +24,14 @@ class Project
else else
$('#project_issues_tracker_id').removeAttr('disabled') $('#project_issues_tracker_id').removeAttr('disabled')
$('#project_merge_requests_enabled').change ->
if ($(this).is(':checked') == true)
$('#project_merge_requests_template').removeAttr('disabled')
else
$('#project_merge_requests_template').attr('disabled', 'disabled')
$('#project_merge_requests_template').change()
@Project = Project @Project = Project
......
...@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base ...@@ -40,7 +40,8 @@ class Project < ActiveRecord::Base
attr_accessible :name, :path, :description, :issues_tracker, :label_list, attr_accessible :name, :path, :description, :issues_tracker, :label_list,
:issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id, :issues_enabled, :wall_enabled, :merge_requests_enabled, :snippets_enabled, :issues_tracker_id,
:wiki_enabled, :visibility_level, :import_url, :last_activity_at, as: [:default, :admin] :wiki_enabled, :visibility_level, :import_url, :last_activity_at,
:merge_requests_template, as: [:default, :admin]
attr_accessible :namespace_id, :creator_id, as: :admin attr_accessible :namespace_id, :creator_id, as: :admin
......
...@@ -66,6 +66,13 @@ ...@@ -66,6 +66,13 @@
= f.check_box :merge_requests_enabled = f.check_box :merge_requests_enabled
%span.descr Submit changes to be merged upstream. %span.descr Submit changes to be merged upstream.
.form-group
= f.label :merge_requests_template, class: 'control-label' do
Merge request template
%span.light (optional)
.col-sm-10
= f.text_area :merge_requests_template, placeholder: "This MR should have: *", disabled: !@project.merge_requests_enabled, class: "form-control", rows: 3
.form-group .form-group
= f.label :wiki_enabled, "Wiki", class: 'control-label' = f.label :wiki_enabled, "Wiki", class: 'control-label'
.col-sm-10 .col-sm-10
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
.form-group .form-group
= f.label :description, "Description", class: 'control-label' = f.label :description, "Description", class: 'control-label'
.col-sm-10 .col-sm-10
= f.text_area :description, class: "form-control js-gfm-input", rows: 14 - template = @project.merge_requests_template
= f.text_area :description, value: template, class: "form-control js-gfm-input", rows: 14
%p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}.
%hr %hr
.form-group .form-group
......
class AddMrTemplateToProject < ActiveRecord::Migration
def change
add_column :projects, :merge_requests_template, :text
end
end
...@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do ...@@ -252,6 +252,7 @@ ActiveRecord::Schema.define(version: 20140513095908) do
t.boolean "archived", default: false, null: false t.boolean "archived", default: false, null: false
t.string "import_status" t.string "import_status"
t.float "repository_size", default: 0.0 t.float "repository_size", default: 0.0
t.text "merge_requests_template"
end end
add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree add_index "projects", ["creator_id"], name: "index_projects_on_creator_id", using: :btree
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment