Change "Get Patch" buttons to dropdowns orffering patches and diffs

This commit is contained in:
Riyad Preukschas 2012-11-25 00:36:19 +01:00
parent 267b18dead
commit 79a4ed15ce
2 changed files with 16 additions and 6 deletions

View file

@ -5,9 +5,14 @@
%span.btn.disabled.grouped %span.btn.disabled.grouped
%i.icon-comment %i.icon-comment
= @notes_count = @notes_count
= link_to project_commit_path(@project, @commit, format: :patch), class: "btn small grouped" do .left.btn-group
%i.icon-download-alt %a.btn.small.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
Get Patch %i.icon-download-alt
Download as
%span.caret
%ul.dropdown-menu
%li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch)
%li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff)
= link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do = link_to project_tree_path(@project, @commit), class: "browse-button primary grouped" do
%strong Browse Code » %strong Browse Code »
%h3.commit-title.page_title %h3.commit-title.page_title

View file

@ -13,9 +13,14 @@
= "MERGED" = "MERGED"
- if can?(current_user, :modify_merge_request, @merge_request) - if can?(current_user, :modify_merge_request, @merge_request)
- if @merge_request.open? - if @merge_request.open?
= link_to project_merge_request_path(@project, @merge_request, format: :patch), class: "btn grouped" do .left.btn-group
%i.icon-download-alt %a.btn.grouped.dropdown-toggle{ data: {toggle: :dropdown} }
Get Patch %i.icon-download-alt
Download as
%span.caret
%ul.dropdown-menu
%li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch)
%li= link_to "Plain Diff", project_merge_request_path(@project, @merge_request, format: :diff)
= link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request" = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request"