diff --git a/app/assets/javascripts/merge_requests.js b/app/assets/javascripts/merge_requests.js index 481f1e014ef703be3b164d49dc6ea6cf938bfa19..e87071b5404a595bbfb302cc265298867b50decd 100644 --- a/app/assets/javascripts/merge_requests.js +++ b/app/assets/javascripts/merge_requests.js @@ -38,5 +38,11 @@ var MergeRequest = { $('.status').removeClass("loading"); }, dataType: "script"}); + }, + + showAllCommits: + function() { + $(".first_mr_commits").remove(); + $(".all_mr_commits").removeClass("hide"); } } diff --git a/app/views/merge_requests/_commits.html.haml b/app/views/merge_requests/_commits.html.haml index 60cb21ba16edd2a7c889f07f5762ddaf701d6956..b6f66fb424e40a77da6fab848a972cd9af5ca735 100644 --- a/app/views/merge_requests/_commits.html.haml +++ b/app/views/merge_requests/_commits.html.haml @@ -1,10 +1,23 @@ - unless @commits.empty? .ui-box - %h5 Commits + %h5 Commits (#{@commits.count}) .merge-request-commits - %ul.unstyled - - @commits.each do |commit| - = render "commits/commit", :commit => commit + - if @commits.count > 8 + %ul.first_mr_commits.unstyled + - @commits.first(8).each do |commit| + = render "commits/commit", :commit => commit + %li.bottom + 8 of #{@commits.count} commits displayed. + %strong + = link_to_function "Click here to show all", "MergeRequest.showAllCommits()" + %ul.all_mr_commits.hide.unstyled + - @commits.each do |commit| + = render "commits/commit", :commit => commit + + - else + %ul.unstyled + - @commits.each do |commit| + = render "commits/commit", :commit => commit - else %h5 diff --git a/app/views/projects/_project_head.html.haml b/app/views/projects/_project_head.html.haml index 074a0f52ff1c21eef4403f620c9709a1cd7f3497..3d46a676a6dfaaaa92b80d4a331ff46f8fb4ed06 100644 --- a/app/views/projects/_project_head.html.haml +++ b/app/views/projects/_project_head.html.haml @@ -1,9 +1,11 @@ %ul.nav.nav-tabs %li{ :class => "#{'active' if current_page?(project_path(@project)) }" } = link_to project_path(@project), :class => "activities-tab tab" do + %i.icon-home Show %li{ :class => " #{'active' if (controller.controller_name == "team_members") || current_page?(team_project_path(@project)) }" } = link_to team_project_path(@project), :class => "team-tab tab" do + %i.icon-user Team %li{ :class => "#{'active' if current_page?(files_project_path(@project)) }" } = link_to files_project_path(@project), :class => "files-tab tab " do @@ -23,5 +25,6 @@ Hooks %li.right{ :class => "#{'active' if current_page?(edit_project_path(@project)) }" } = link_to edit_project_path(@project), :class => "stat-tab tab " do + %i.icon-edit Edit diff --git a/app/views/projects/show.html.haml b/app/views/projects/show.html.haml index b764f2225d20ddd10516a7f09cba98cf19238615..88dce0d5d2331400bc93b2f9a8f653b6e889e27c 100644 --- a/app/views/projects/show.html.haml +++ b/app/views/projects/show.html.haml @@ -14,7 +14,9 @@ .span4.right .right - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project), :class => "btn small padded" + = link_to archive_project_repository_path(@project), :class => "btn small padded" do + %i.icon-download-alt + Download - if @project.merge_requests_enabled && can?(current_user, :write_merge_request, @project) = link_to new_project_merge_request_path(@project), :title => "New Merge Request", :class => "btn small padded" do Merge Request