diff --git a/app/assets/images/Home-UI.PNG b/app/assets/images/Home-UI.PNG deleted file mode 100644 index f739af3c2acba143a008f5a007a29846d91afde9..0000000000000000000000000000000000000000 Binary files a/app/assets/images/Home-UI.PNG and /dev/null differ diff --git a/app/assets/images/home_icon.PNG b/app/assets/images/home_icon.PNG new file mode 100644 index 0000000000000000000000000000000000000000..b1d60d5935760d7f7c448a6ea3e7270fe405a664 Binary files /dev/null and b/app/assets/images/home_icon.PNG differ diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 981327f31c7082bec00be1d2737e29a8c8045d05..7a2ab6e0d8da53e1cbfb0dc5ac2804a53f9ff96a 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -98,6 +98,7 @@ a { } nav.main_menu { + overflow:hidden; border-radius: 4px; margin: auto; margin:30px $app_padding; @@ -116,7 +117,7 @@ nav.main_menu { .count { - color:#bbb; + color:#aaa; margin-left:3px; } @@ -149,7 +150,9 @@ nav.main_menu { &.home { - padding:7px 35px; + background: url(home_icon.PNG) no-repeat center center; + text-indent:-9999px; + min-width:40px; img { position:relative; @@ -157,7 +160,7 @@ nav.main_menu { } } &.current { - background:#DDD; + background-color:#DDD; } } } @@ -346,3 +349,24 @@ img.lil_av { .well.padded { padding:29px; } + +.download_repo_link { + background: url("images.png") no-repeat 0 -48px; + padding-left:20px; +} + +.number { + border-radius: 4px; + text-shadow: none; + background: rgba(0,0,0,.12); + text-align: center; + padding: 2px 4px; + line-height:20px; + margin-left:2px; +} + +table a code { + position: relative; + top: -2px; + margin-right: 3px; +} diff --git a/app/controllers/protected_branches_controller.rb b/app/controllers/protected_branches_controller.rb index 81bfbe6a5ebbe9f9e4c7d81c85e642aaf3665d74..0b86f5253ce28bea08ddd7df46fbdb249f930990 100644 --- a/app/controllers/protected_branches_controller.rb +++ b/app/controllers/protected_branches_controller.rb @@ -7,6 +7,7 @@ class ProtectedBranchesController < ApplicationController before_filter :require_non_empty_project before_filter :authorize_admin_project!, :only => [:destroy, :create] + before_filter :render_full_content layout "project" diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 5ede9b5f598bb0d9559ed7bc7c6e447c21569239..7bdcdf885d98a474eff0afc8cbfef294c6b2ae79 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -5,6 +5,7 @@ class RepositoriesController < ApplicationController before_filter :add_project_abilities before_filter :authorize_read_project! before_filter :require_non_empty_project + before_filter :render_full_content layout "project" diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d78a4af3294e1b6ab7c6fc46a2966b29659943c6..16e3d9d00560595de5dc0a269af7ec7460cd3ccc 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -22,6 +22,8 @@ module ProjectsHelper end if controller.controller_name == "snippets" || + controller.controller_name == "hooks" || + controller.controller_name == "deploy_keys" || controller.controller_name == "team_members" "current" end @@ -33,11 +35,26 @@ module ProjectsHelper end def repository_tab_class - if controller.controller_name == "repositories" || - controller.controller_name == "hooks" || + #if controller.controller_name == "repositories" || + #controller.controller_name == "hooks" || + #controller.controller_name == "deploy_keys" + #"current" + #end + end + + def commit_tab_class + if controller.controller_name == "commits" || + controller.controller_name == "repositories" || + controller.controller_name == "protected_branches" + "current" + end + end + + def branches_tab_class + if current_page?(branches_project_repository_path(@project)) || controller.controller_name == "protected_branches" || - controller.controller_name == "deploy_keys" - "current" + current_page?(project_repository_path(@project)) + 'active' end end end diff --git a/app/views/commits/_head.html.haml b/app/views/commits/_head.html.haml index f6facea8b5640ddb77f2266140ab0130a2b1066e..a8648ccf61c253a1364c037cc81e4d38a0d1ae52 100644 --- a/app/views/commits/_head.html.haml +++ b/app/views/commits/_head.html.haml @@ -6,12 +6,19 @@ %li{:class => "#{'active' if current_page?(project_commits_path(@project)) }"} = link_to project_commits_path(@project) do - %span Commits %li{:class => "#{'active' if current_page?(compare_project_commits_path(@project)) }"} = link_to compare_project_commits_path(@project) do - %span Compare + %li{:class => "#{branches_tab_class}"} + = link_to project_repository_path(@project) do + Branches + %span.number= @project.repo.branches.count + + %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} + = link_to tags_project_repository_path(@project) do + Tags + %span.number= @project.repo.tags.count diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 9ec8c556b282604d6d7a853861b4f734350960cb..69881752e4b3a725f40275909c43b441038146a2 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -1,4 +1,4 @@ -= render "repositories/head" += render "projects/project_head" - if can? current_user, :admin_project, @project .alert-message.block-message diff --git a/app/views/layouts/_app_menu.html.haml b/app/views/layouts/_app_menu.html.haml index 484ac6303e7c7855530c66764ea5dc198e4ea9d1..c42bb3ebe70987e33138a0a954d08d605900f361 100644 --- a/app/views/layouts/_app_menu.html.haml +++ b/app/views/layouts/_app_menu.html.haml @@ -1,5 +1,6 @@ %nav.main_menu - = link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path) || current_page?(root_path)}" + = render "layouts/const_menu_links" + -#= link_to "Projects", projects_path, :class => "#{"current" if current_page?(projects_path) || current_page?(root_path)}" = link_to "Issues", dashboard_issues_path, :class => "#{"current" if current_page?(dashboard_issues_path)}", :id => "issues_slide" = link_to "Requests", dashboard_merge_requests_path, :class => "#{"current" if current_page?(dashboard_merge_requests_path)}", :id => "merge_requests_slide" = link_to "Help", help_path, :class => "#{"current" if controller.controller_name == "help"}" diff --git a/app/views/layouts/_const_menu_links.html.haml b/app/views/layouts/_const_menu_links.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..c0b971c2836555ff2f5bb78c827d76697b9af0be --- /dev/null +++ b/app/views/layouts/_const_menu_links.html.haml @@ -0,0 +1 @@ += link_to "Home", root_path, :class => "home #{"current" if current_page?(projects_path) || current_page?(root_path)}", :title => "Home" diff --git a/app/views/layouts/_project_menu.html.haml b/app/views/layouts/_project_menu.html.haml index 54cfd2b079d0bf27e2381a55d370bda372e577a5..5260fcd13de28a512cbcd7b6e4f92b260bf2e594 100644 --- a/app/views/layouts/_project_menu.html.haml +++ b/app/views/layouts/_project_menu.html.haml @@ -1,11 +1,11 @@ %nav.main_menu + = render "layouts/const_menu_links" = link_to project_path(@project), :class => "#{project_tab_class}", :title => "Project" do Project - if @project.repo_exists? - = link_to "Repository", project_repository_path(@project), :class => repository_tab_class = link_to "Files", tree_project_ref_path(@project, @project.root_ref), :class => tree_tab_class - = link_to "Commits", project_commits_path(@project), :class => (controller.controller_name == "commits") ? "current" : nil + = link_to "Commits", project_commits_path(@project), :class => commit_tab_class = link_to "Network", graph_project_path(@project), :class => current_page?(:controller => "projects", :action => "graph", :id => @project) ? "current" : nil - if @project.issues_enabled diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 98d890c199f6ae9ca0bf6ab55e2f184a4f932cb7..87b9832e3ef5ee6365ba9d2dace21488f8acdcb2 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -6,6 +6,7 @@ = render "layouts/head_panel", :title => "Admin area" .container %nav.main_menu + = render "layouts/const_menu_links" = link_to "Users", admin_users_path, :class => controller.controller_name == "users" ? "current" : nil = link_to "Projects", admin_projects_path, :class => controller.controller_name == "projects" ? "current" : nil = link_to "Emails", admin_emails_path, :class => controller.controller_name == "mailer" ? "current" : nil diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index dd7030f4ff1c73c5d68164b0c090cda8fbdf548e..9d02a4ffa3a1ac5a10095690a51f90e6b644d92f 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -6,6 +6,7 @@ = render "layouts/head_panel", :title => "Profile" .container %nav.main_menu + = render "layouts/const_menu_links" = link_to "Profile", profile_path, :class => current_page?(:controller => "profile", :action => :show) ? "current" : nil = link_to "Password & token", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil = link_to "Design", profile_design_path, :class => current_page?(:controller => "profile", :action => :design) ? "current" : nil diff --git a/app/views/projects/_project_head.html.haml b/app/views/projects/_project_head.html.haml index d55cbe1e77c6d3bd59efb19fa1b8914197515996..f8a4f9c5c38f34fb8f998f49150c5c6432c9241d 100644 --- a/app/views/projects/_project_head.html.haml +++ b/app/views/projects/_project_head.html.haml @@ -16,3 +16,16 @@ %li{ :class => " #{'active' if (controller.controller_name == "snippets") }" } = link_to project_snippets_path(@project), :class => "snippets-tab tab" do Snippets + -#%li{:class => "#{'active' if current_page?(project_repository_path(@project)) }"} + -#= link_to project_repository_path(@project) do + -#%span + -#Activities + %li{:class => "#{'active' if controller.controller_name == "hooks" }"} + = link_to project_hooks_path(@project) do + %span + Hooks + %li{:class => "#{'active' if controller.controller_name == "deploy_keys"}"} + - if can? current_user, :admin_project, @project + = link_to project_deploy_keys_path(@project) do + %span + Deploy Keys diff --git a/app/views/repositories/_branch.html.haml b/app/views/repositories/_branch.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..7858b0fc59fe6c81ff6abab6c5e588a39b35807f --- /dev/null +++ b/app/views/repositories/_branch.html.haml @@ -0,0 +1,20 @@ +%tr + %td + = link_to project_commits_path(@project, :ref => branch.name) do + %strong= branch.name + - if branch.name == @project.root_ref + %span.label default + %td + = link_to project_commits_path(@project, branch.commit.id) do + %code= branch.commit.id.to_s[0..10] + + = image_tag gravatar_icon(Commit.new(branch.commit).author_email), :class => "", :width => 16 + = truncate(Commit.new(branch.commit).safe_message, :length => 40) + %td + %span.update-author.right + = time_ago_in_words(branch.commit.committed_date) + ago + %td + - if can? current_user, :download_code, @project + = link_to "Download", archive_project_repository_path(@project, :ref => branch.name), :class => "visible_link download_repo_link" + diff --git a/app/views/repositories/_branches_head.html.haml b/app/views/repositories/_branches_head.html.haml index dd4d6868bcc0b0c759ab08371fdc8a231c60769b..9a18949841323e9db2d111a366b0099f45b2aca1 100644 --- a/app/views/repositories/_branches_head.html.haml +++ b/app/views/repositories/_branches_head.html.haml @@ -1,9 +1,12 @@ -= render "repositories/head" += render "commits/head" %ul.pills - %li{:class => ("active" if current_page?(branches_project_repository_path(@project)))} - = link_to branches_project_repository_path(@project) do - All + %li{:class => ("active" if current_page?(project_repository_path(@project)))} + = link_to project_repository_path(@project) do + Recent %li{:class => ("active" if current_page?(project_protected_branches_path(@project)))} = link_to project_protected_branches_path(@project) do Protected + %li{:class => ("active" if current_page?(branches_project_repository_path(@project)))} + = link_to branches_project_repository_path(@project) do + All %hr diff --git a/app/views/repositories/_feed.html.haml b/app/views/repositories/_feed.html.haml index d66f51e4ba49c1a4eec8409a65214337686c6c98..9fdba10b9267b3d6f1ad9af4b07435af31e87f07 100644 --- a/app/views/repositories/_feed.html.haml +++ b/app/views/repositories/_feed.html.haml @@ -4,9 +4,13 @@ = link_to project_commits_path(@project, :ref => commit.head.name) do %strong = commit.head.name + - if commit.head.name == @project.root_ref + %span.label default + %td %div - %code= commit.id.to_s[0..10] + = link_to project_commits_path(@project, commit.id) do + %code= commit.id.to_s[0..10] = image_tag gravatar_icon(commit.author_email), :class => "", :width => 16 = truncate(commit.safe_message, :length => 40) %td diff --git a/app/views/repositories/_head.html.haml b/app/views/repositories/_head.html.haml index 2d43d008e2ab8e16c79cdb2353a334298cb4dd5c..bc96f306eee12845cc25902f58b494113842d150 100644 --- a/app/views/repositories/_head.html.haml +++ b/app/views/repositories/_head.html.haml @@ -1,23 +1 @@ -%ul.tabs - %li{:class => "#{'active' if current_page?(project_repository_path(@project)) }"} - = link_to project_repository_path(@project) do - %span - Activities - %li{:class => "#{'active' if current_page?(branches_project_repository_path(@project)) || current_page?(project_protected_branches_path(@project)) }"} - = link_to branches_project_repository_path(@project) do - %span - Branches - %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"} - = link_to tags_project_repository_path(@project) do - %span - Tags - %li{:class => "#{'active' if controller.controller_name == "hooks" }"} - = link_to project_hooks_path do - %span - Hooks - %li{:class => "#{'active' if controller.controller_name == "deploy_keys"}"} - - if can? current_user, :admin_project, @project - = link_to project_deploy_keys_path(@project) do - %span - Deploy Keys - += render "projects/project_head" diff --git a/app/views/repositories/branches.html.haml b/app/views/repositories/branches.html.haml index 23e3eac3b3517775fc885d32b5fc0b0a12bb7e96..c56b54d5349a30499bd42248ec39bcb2d25921c0 100644 --- a/app/views/repositories/branches.html.haml +++ b/app/views/repositories/branches.html.haml @@ -1,20 +1,6 @@ = render "repositories/branches_head" - unless @branches.empty? %table.zebra-striped.borders - %thead - %tr - %th Name - %th Last commit %tbody - @branches.each do |branch| - %tr - %td - = link_to project_commits_path(@project, :ref => branch.name) do - %strong= branch.name - - if branch.name == @project.root_ref - %span.label default - %td - = link_to project_commits_path(@project, branch.commit.id) do - = truncate branch.commit.id.to_s, :length => 10 - = time_ago_in_words(branch.commit.committed_date) - ago + = render "repositories/branch", :branch => branch diff --git a/app/views/repositories/show.html.haml b/app/views/repositories/show.html.haml index c72b866b950bbae0102bd20426393369881853fe..43514551420fafe78b4a981b1269ffbba2a34873 100644 --- a/app/views/repositories/show.html.haml +++ b/app/views/repositories/show.html.haml @@ -1,33 +1,6 @@ -= render "head" -%h3 - = @project.name - - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project), :class => "btn small right" - - -%hr -.entry - %p - Last commit was - %small - %code= @activities.first.commit.id.to_s[0..10] - - = time_ago_in_words(@activities.first.commit.committed_date) - ago to - = link_to project_commits_path(@project, :ref => @activities.first.head.name), :class => "visible_link" do - %span.label= @activities.first.head.name -.alert-message.block-message.warning - .input - .input-prepend - %span.add-on git clone - = text_field_tag :project_clone, @project.url_to_repo, :class => "xlarge one_click_select git_clone_url" - - - -%h5.cgray - Recently updated branches += render "branches_head" %table.zebra-striped.borders - @activities.each do |update| - = render "repositories/feed", :update => update, :project => @project + = render "repositories/branch", :branch => update.head diff --git a/app/views/repositories/tags.html.haml b/app/views/repositories/tags.html.haml index 229362bc1ca3b17dbac85e1775326f703c3f6152..1611385343889db8527c0944c2ea9670e3362068 100644 --- a/app/views/repositories/tags.html.haml +++ b/app/views/repositories/tags.html.haml @@ -1,19 +1,23 @@ -= render "head" += render "commits/head" - unless @tags.empty? %table.zebra-striped.borders - @tags.each do |tag| %tr %td - = tag.name - %code= tag.commit.id.to_s[0..10] + %strong= link_to tag.name, project_commits_path(@project, :ref => tag.name), :class => "" + %td + = link_to project_commits_path(@project, tag.commit.id) do + %code= tag.commit.id.to_s[0..10] + = image_tag gravatar_icon(Commit.new(tag.commit).author_email), :class => "", :width => 16 + = truncate(Commit.new(tag.commit).safe_message, :length => 40) + %td %span.update-author.right = time_ago_in_words(tag.commit.committed_date) ago   %td - if can? current_user, :download_code, @project - = link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "btn small" - = link_to "Commits", project_commits_path(@project, :ref => tag.name), :class => "btn small" + = link_to "Download", archive_project_repository_path(@project, :ref => tag.name), :class => "visible_link download_repo_link" - else %h3 No tags diff --git a/spec/requests/repositories_spec.rb b/spec/requests/repositories_spec.rb index 38c9edf568fb404c014a08eec0d40f1cffdd6559..3fb5371bbbf441420a547a11c64340fefccf0735 100644 --- a/spec/requests/repositories_spec.rb +++ b/spec/requests/repositories_spec.rb @@ -18,10 +18,6 @@ describe "Repository" do current_path.should == project_repository_path(@project) end - it "should have link to repo activities" do - page.should have_content("Activities") - end - it "should have link to last commit for activities tab" do page.should have_content(@project.commit.safe_message[0..20]) end