Commit 9ad5d9a4c6a3e292ddde7e46949f739eb63c746e
Exists in
master
and in
4 other branches
Merge branch 'feature/mr_description' of /home/git/repositories/gitlab/gitlabhq
Showing
9 changed files
with
46 additions
and
35 deletions
Show diff stats
app/assets/javascripts/dispatcher.js.coffee
| @@ -18,6 +18,8 @@ class Dispatcher | @@ -18,6 +18,8 @@ class Dispatcher | ||
| 18 | switch page | 18 | switch page |
| 19 | when 'projects:issues:index' | 19 | when 'projects:issues:index' |
| 20 | Issues.init() | 20 | Issues.init() |
| 21 | + when 'projects:issues:new', 'projects:merge_requests:new' | ||
| 22 | + GitLab.GfmAutoComplete.setup() | ||
| 21 | when 'dashboard:show' | 23 | when 'dashboard:show' |
| 22 | new Dashboard() | 24 | new Dashboard() |
| 23 | new Activities() | 25 | new Activities() |
app/assets/stylesheets/sections/merge_requests.scss
app/models/concerns/issuable.rb
app/models/issue.rb
| @@ -32,7 +32,6 @@ class Issue < ActiveRecord::Base | @@ -32,7 +32,6 @@ class Issue < ActiveRecord::Base | ||
| 32 | attr_accessible :title, :assignee_id, :position, :description, | 32 | attr_accessible :title, :assignee_id, :position, :description, |
| 33 | :milestone_id, :label_list, :author_id_of_changes, | 33 | :milestone_id, :label_list, :author_id_of_changes, |
| 34 | :state_event | 34 | :state_event |
| 35 | - attr_mentionable :title, :description | ||
| 36 | 35 | ||
| 37 | acts_as_taggable_on :labels | 36 | acts_as_taggable_on :labels |
| 38 | 37 |
app/models/merge_request.rb
| @@ -30,8 +30,7 @@ class MergeRequest < ActiveRecord::Base | @@ -30,8 +30,7 @@ class MergeRequest < ActiveRecord::Base | ||
| 30 | belongs_to :target_project, foreign_key: :target_project_id, class_name: "Project" | 30 | belongs_to :target_project, foreign_key: :target_project_id, class_name: "Project" |
| 31 | belongs_to :source_project, foreign_key: :source_project_id, class_name: "Project" | 31 | belongs_to :source_project, foreign_key: :source_project_id, class_name: "Project" |
| 32 | 32 | ||
| 33 | - attr_accessible :title, :assignee_id, :source_project_id, :source_branch, :target_project_id, :target_branch, :milestone_id, :author_id_of_changes, :state_event | ||
| 34 | - attr_mentionable :title | 33 | + attr_accessible :title, :assignee_id, :source_project_id, :source_branch, :target_project_id, :target_branch, :milestone_id, :author_id_of_changes, :state_event, :description |
| 35 | 34 | ||
| 36 | attr_accessor :should_remove_source_branch | 35 | attr_accessor :should_remove_source_branch |
| 37 | 36 |
app/views/projects/merge_requests/_form.html.haml
| @@ -5,41 +5,32 @@ | @@ -5,41 +5,32 @@ | ||
| 5 | - @merge_request.errors.full_messages.each do |msg| | 5 | - @merge_request.errors.full_messages.each do |msg| |
| 6 | %li= msg | 6 | %li= msg |
| 7 | 7 | ||
| 8 | - %h3.page-title | ||
| 9 | - Branches | ||
| 10 | .merge-request-branches | 8 | .merge-request-branches |
| 11 | - .row | ||
| 12 | - .span5 | ||
| 13 | - .ui-box | ||
| 14 | - .title From | ||
| 15 | - .ui-box-head | ||
| 16 | - Project: | ||
| 17 | - = f.select(:source_project_id,[[@merge_request.source_project.path_with_namespace,@merge_request.source_project.id]] , {}, {class: 'source_project chosen span4'}) | ||
| 18 | - .prepend-top-10 | 9 | + .row |
| 10 | + .span5 | ||
| 11 | + .clearfix | ||
| 12 | + .pull-left | ||
| 13 | + = f.select(:source_project_id,[[@merge_request.source_project.path_with_namespace,@merge_request.source_project.id]] , {}, {class: 'source_project chosen span3'}) | ||
| 14 | + .pull-left | ||
| 15 | + | ||
| 19 | %i.icon-code-fork | 16 | %i.icon-code-fork |
| 20 | - Branch: | ||
| 21 | - = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span3'}) | ||
| 22 | - .mr_source_commit.prepend-top-10 | ||
| 23 | - .span2 | ||
| 24 | - %h1.merge-request-angle | ||
| 25 | - %i.icon-angle-right | ||
| 26 | - .span5 | ||
| 27 | - .ui-box | ||
| 28 | - .title To | ||
| 29 | - .ui-box-head | ||
| 30 | - - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] | ||
| 31 | - Project: | ||
| 32 | - = f.select(:target_project_id, projects.map { |proj| [proj.path_with_namespace,proj.id] }, {include_blank: "Select Target Project" }, {class: 'target_project chosen span4'}) | ||
| 33 | - .prepend-top-10 | 17 | + = f.select(:source_branch, @merge_request.source_project.repository.branch_names, { include_blank: "Select branch" }, {class: 'source_branch chosen span2'}) |
| 18 | + .mr_source_commit.prepend-top-10 | ||
| 19 | + .span2 | ||
| 20 | + %h2.merge-request-angle.light | ||
| 21 | + %i.icon-long-arrow-right | ||
| 22 | + .span5 | ||
| 23 | + .clearfix | ||
| 24 | + .pull-left | ||
| 25 | + - projects = @project.forked_from_project.nil? ? [@project] : [ @project,@project.forked_from_project] | ||
| 26 | + = f.select(:target_project_id, projects.map { |proj| [proj.path_with_namespace,proj.id] }, {include_blank: "Select Target Project" }, {class: 'target_project chosen span3'}) | ||
| 27 | + .pull-left | ||
| 28 | + | ||
| 34 | %i.icon-code-fork | 29 | %i.icon-code-fork |
| 35 | - Branch: | ||
| 36 | - = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span3'}) | ||
| 37 | - .mr_target_commit.prepend-top-10 | 30 | + = f.select(:target_branch, @target_branches, { include_blank: "Select branch" }, {class: 'target_branch chosen span2'}) |
| 31 | + .mr_target_commit.prepend-top-10 | ||
| 38 | 32 | ||
| 39 | %hr | 33 | %hr |
| 40 | - | ||
| 41 | - %h3.page-title | ||
| 42 | - Details | ||
| 43 | .merge-request-form-info | 34 | .merge-request-form-info |
| 44 | .control-group | 35 | .control-group |
| 45 | = f.label :title do | 36 | = f.label :title do |
| @@ -56,6 +47,12 @@ | @@ -56,6 +47,12 @@ | ||
| 56 | %i.icon-time | 47 | %i.icon-time |
| 57 | Milestone | 48 | Milestone |
| 58 | .controls= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) | 49 | .controls= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) |
| 50 | + .control-group | ||
| 51 | + = f.label :description, "Description" | ||
| 52 | + .controls | ||
| 53 | + = f.text_area :description, class: "input-xxlarge js-gfm-input", rows: 14 | ||
| 54 | + %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. | ||
| 55 | + | ||
| 59 | 56 | ||
| 60 | .form-actions | 57 | .form-actions |
| 61 | - if @merge_request.new_record? | 58 | - if @merge_request.new_record? |
app/views/projects/merge_requests/show/_mr_box.html.haml
| @@ -21,6 +21,12 @@ | @@ -21,6 +21,12 @@ | ||
| 21 | %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) | 21 | %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | + - if @merge_request.description.present? | ||
| 25 | + .ui-box-bottom | ||
| 26 | + .wiki | ||
| 27 | + = preserve do | ||
| 28 | + = markdown @merge_request.description | ||
| 29 | + | ||
| 24 | - if @merge_request.closed? | 30 | - if @merge_request.closed? |
| 25 | .ui-box-bottom.alert-error | 31 | .ui-box-bottom.alert-error |
| 26 | %span | 32 | %span |
db/migrate/20130909132950_add_description_to_merge_request.rb
0 → 100644
db/schema.rb
| @@ -11,7 +11,7 @@ | @@ -11,7 +11,7 @@ | ||
| 11 | # | 11 | # |
| 12 | # It's strongly recommended to check this file into your version control system. | 12 | # It's strongly recommended to check this file into your version control system. |
| 13 | 13 | ||
| 14 | -ActiveRecord::Schema.define(:version => 20130821090531) do | 14 | +ActiveRecord::Schema.define(:version => 20130909132950) do |
| 15 | 15 | ||
| 16 | create_table "deploy_keys_projects", :force => true do |t| | 16 | create_table "deploy_keys_projects", :force => true do |t| |
| 17 | t.integer "deploy_key_id", :null => false | 17 | t.integer "deploy_key_id", :null => false |
| @@ -100,6 +100,7 @@ ActiveRecord::Schema.define(:version => 20130821090531) do | @@ -100,6 +100,7 @@ ActiveRecord::Schema.define(:version => 20130821090531) do | ||
| 100 | t.string "merge_status" | 100 | t.string "merge_status" |
| 101 | t.integer "target_project_id", :null => false | 101 | t.integer "target_project_id", :null => false |
| 102 | t.integer "iid" | 102 | t.integer "iid" |
| 103 | + t.text "description" | ||
| 103 | end | 104 | end |
| 104 | 105 | ||
| 105 | add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" | 106 | add_index "merge_requests", ["assignee_id"], :name => "index_merge_requests_on_assignee_id" |