Commit 5ef3b384291252e4d2394186ec27685b9376eabe

Authored by Dmitriy Zaporozhets
1 parent 3b7998e1

MR commits suppressed if too many. few icons

app/assets/javascripts/merge_requests.js
@@ -38,5 +38,11 @@ var MergeRequest = { @@ -38,5 +38,11 @@ var MergeRequest = {
38 $('.status').removeClass("loading"); 38 $('.status').removeClass("loading");
39 }, 39 },
40 dataType: "script"}); 40 dataType: "script"});
  41 + },
  42 +
  43 + showAllCommits:
  44 + function() {
  45 + $(".first_mr_commits").remove();
  46 + $(".all_mr_commits").removeClass("hide");
41 } 47 }
42 } 48 }
app/views/merge_requests/_commits.html.haml
1 - unless @commits.empty? 1 - unless @commits.empty?
2 .ui-box 2 .ui-box
3 - %h5 Commits 3 + %h5 Commits (#{@commits.count})
4 .merge-request-commits 4 .merge-request-commits
5 - %ul.unstyled  
6 - - @commits.each do |commit|  
7 - = render "commits/commit", :commit => commit 5 + - if @commits.count > 8
  6 + %ul.first_mr_commits.unstyled
  7 + - @commits.first(8).each do |commit|
  8 + = render "commits/commit", :commit => commit
  9 + %li.bottom
  10 + 8 of #{@commits.count} commits displayed.
  11 + %strong
  12 + = link_to_function "Click here to show all", "MergeRequest.showAllCommits()"
  13 + %ul.all_mr_commits.hide.unstyled
  14 + - @commits.each do |commit|
  15 + = render "commits/commit", :commit => commit
  16 +
  17 + - else
  18 + %ul.unstyled
  19 + - @commits.each do |commit|
  20 + = render "commits/commit", :commit => commit
8 21
9 - else 22 - else
10 %h5 23 %h5
app/views/projects/_project_head.html.haml
1 %ul.nav.nav-tabs 1 %ul.nav.nav-tabs
2 %li{ :class => "#{'active' if current_page?(project_path(@project)) }" } 2 %li{ :class => "#{'active' if current_page?(project_path(@project)) }" }
3 = link_to project_path(@project), :class => "activities-tab tab" do 3 = link_to project_path(@project), :class => "activities-tab tab" do
  4 + %i.icon-home
4 Show 5 Show
5 %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } 6 %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" }
6 = link_to team_project_path(@project), :class => "team-tab tab" do 7 = link_to team_project_path(@project), :class => "team-tab tab" do
  8 + %i.icon-user
7 Team 9 Team
8 %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } 10 %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" }
9 = link_to files_project_path(@project), :class => "files-tab tab " do 11 = link_to files_project_path(@project), :class => "files-tab tab " do
@@ -23,5 +25,6 @@ @@ -23,5 +25,6 @@
23 Hooks 25 Hooks
24 %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" } 26 %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" }
25 = link_to edit_project_path(@project), :class => "stat-tab tab " do 27 = link_to edit_project_path(@project), :class => "stat-tab tab " do
  28 + %i.icon-edit
26 Edit 29 Edit
27 30
app/views/projects/show.html.haml
@@ -14,7 +14,9 @@ @@ -14,7 +14,9 @@
14 .span4.right 14 .span4.right
15 .right 15 .right
16 - if can? current_user, :download_code, @project 16 - if can? current_user, :download_code, @project
17 - = link_to "Download", archive_project_repository_path(@project), :class => "btn small padded" 17 + = link_to archive_project_repository_path(@project), :class => "btn small padded" do
  18 + %i.icon-download-alt
  19 + Download
18 - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) 20 - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project)
19 = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small padded" do 21 = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small padded" do
20 Merge Request 22 Merge Request