Commit e0ca2adafda95dbb0476847499d662623ff0b6be
1 parent
76a07394
Exists in
master
and in
4 other branches
Improve Merge Request form
* added description * simplified form * enabled gfm autocomplete
Showing
4 changed files
with
36 additions
and
31 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/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 |