diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-09-09 19:44:48 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-09-09 19:44:48 +0400 |
commit | 9ad5d9a4c6a3e292ddde7e46949f739eb63c746e (patch) | |
tree | a7d7b5fe4132b63a8dd3e743235140b208dc9d9d | |
parent | 1f81c0085e6680b00ff9a20c0dc35fd08ac232f3 (diff) | |
parent | e0ca2adafda95dbb0476847499d662623ff0b6be (diff) |
Merge branch 'feature/mr_description' of /home/git/repositories/gitlab/gitlabhq
-rw-r--r-- | app/assets/javascripts/dispatcher.js.coffee | 2 | ||||
-rw-r--r-- | app/assets/stylesheets/sections/merge_requests.scss | 2 | ||||
-rw-r--r-- | app/models/concerns/issuable.rb | 2 | ||||
-rw-r--r-- | app/models/issue.rb | 1 | ||||
-rw-r--r-- | app/models/merge_request.rb | 3 | ||||
-rw-r--r-- | app/views/projects/merge_requests/_form.html.haml | 57 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_box.html.haml | 6 | ||||
-rw-r--r-- | db/migrate/20130909132950_add_description_to_merge_request.rb | 5 | ||||
-rw-r--r-- | db/schema.rb | 3 |
9 files changed, 46 insertions, 35 deletions
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index c8ddbed5097..e264e281309 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -18,6 +18,8 @@ class Dispatcher switch page when 'projects:issues:index' Issues.init() + when 'projects:issues:new', 'projects:merge_requests:new' + GitLab.GfmAutoComplete.setup() when 'dashboard:show' new Dashboard() new Activities() diff --git a/app/assets/stylesheets/sections/merge_requests.scss b/app/assets/stylesheets/sections/merge_requests.scss index bdab306a57d..e7b464fd4aa 100644 --- a/app/assets/stylesheets/sections/merge_requests.scss +++ b/app/assets/stylesheets/sections/merge_requests.scss @@ -117,7 +117,7 @@ .merge-request-angle { text-align: center; - margin-top: 45px; + margin: 0; } .merge-request-form-info { diff --git a/app/models/concerns/issuable.rb b/app/models/concerns/issuable.rb index a05dba7f6b6..7f820f950b0 100644 --- a/app/models/concerns/issuable.rb +++ b/app/models/concerns/issuable.rb @@ -37,6 +37,8 @@ module Issuable prefix: true attr_accessor :author_id_of_changes + + attr_mentionable :title, :description end module ClassMethods diff --git a/app/models/issue.rb b/app/models/issue.rb index ffe9681fc83..f3ec322126f 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -32,7 +32,6 @@ class Issue < ActiveRecord::Base attr_accessible :title, :assignee_id, :position, :description, :milestone_id, :label_list, :author_id_of_changes, :state_event - attr_mentionable :title, :description acts_as_taggable_on :labels diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 514fc79f7c5..7f367588b23 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -30,8 +30,7 @@ class MergeRequest < ActiveRecord::Base belongs_to :target_project, foreign_key: :target_project_id, class_name: "Project" belongs_to :source_project, foreign_key: :source_project_id, class_name: "Project" - attr_accessible :title, :assignee_id, :source_project_id, :source_branch, :target_project_id, :target_branch, :milestone_id, :author_id_of_changes, :state_event - attr_mentionable :title + attr_accessible :title, :assignee_id, :source_project_id, :source_branch, :target_project_id, :target_branch, :milestone_id, :author_id_of_changes, :state_event, :description attr_accessor :should_remove_source_branch diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 5e94f1fdf18..ce72756303e 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -5,41 +5,32 @@ - @merge_request.errors.full_messages.each do |msg| %li= msg - %h3.page-title - Branches .merge-request-branches - .row - .span5 - .ui-box - .title From - .ui-box-head - Project: - = f.select(:source_project_id,[[@merge_request.source_project.path_with_namespace,@merge_request.source_project.id]] , {}, {class: 'source_project chosen span4'}) - .prepend-top-10 + .row + .span5 + .clearfix + .pull-left + = f.select(:source_project_id,[[@merge_request.source_project.path_with_namespace,@merge_request.source_project.id]] , {}, {class: 'source_project chosen span3'}) + .pull-left + %i.icon-code-fork - Branch: - = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span3'}) - .mr_source_commit.prepend-top-10 - .span2 - %h1.merge-request-angle - %i.icon-angle-right - .span5 - .ui-box - .title To - .ui-box-head - - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] - Project: - = f.select(:target_project_id, projects.map { |proj| [proj.path_with_namespace,proj.id] }, {include_blank: "Select Target Project" }, {class: 'target_project chosen span4'}) - .prepend-top-10 + = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'}) + .mr_source_commit.prepend-top-10 + .span2 + %h2.merge-request-angle.light + %i.icon-long-arrow-right + .span5 + .clearfix + .pull-left + - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] + = f.select(:target_project_id, projects.map { |proj| [proj.path_with_namespace,proj.id] }, {include_blank: "Select Target Project" }, {class: 'target_project chosen span3'}) + .pull-left + %i.icon-code-fork - Branch: - = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span3'}) - .mr_target_commit.prepend-top-10 + = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span2'}) + .mr_target_commit.prepend-top-10 %hr - - %h3.page-title - Details .merge-request-form-info .control-group = f.label :title do @@ -56,6 +47,12 @@ %i.icon-time Milestone .controls= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) + .control-group + = f.label :description, "Description" + .controls + = f.text_area :description, class: "input-xxlarge js-gfm-input", rows: 14 + %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .form-actions - if @merge_request.new_record? diff --git a/app/views/projects/merge_requests/show/_mr_box.html.haml b/app/views/projects/merge_requests/show/_mr_box.html.haml index c4b614b51da..1f750e22c65 100644 --- a/app/views/projects/merge_requests/show/_mr_box.html.haml +++ b/app/views/projects/merge_requests/show/_mr_box.html.haml @@ -21,6 +21,12 @@ %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) + - if @merge_request.description.present? + .ui-box-bottom + .wiki + = preserve do + = markdown @merge_request.description + - if @merge_request.closed? .ui-box-bottom.alert-error %span diff --git a/db/migrate/20130909132950_add_description_to_merge_request.rb b/db/migrate/20130909132950_add_description_to_merge_request.rb new file mode 100644 index 00000000000..9bcd0c7ee06 --- /dev/null +++ b/db/migrate/20130909132950_add_description_to_merge_request.rb @@ -0,0 +1,5 @@ +class AddDescriptionToMergeRequest < ActiveRecord::Migration + def change + add_column :merge_requests, :description, :text, null: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 654f2b1e8f7..d5effe40ea1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130821090531) do +ActiveRecord::Schema.define(:version => 20130909132950) do create_table "deploy_keys_projects", :force => true do |t| t.integer "deploy_key_id", :null => false @@ -100,6 +100,7 @@ ActiveRecord::Schema.define(:version => 20130821090531) do t.string "merge_status" t.integer "target_project_id", :null => false t.integer "iid" + t.text "description" end add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" |