From c8b955a44b1897394d6dda349af2f183a820cc28 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 11 Jan 2012 09:35:21 +0200 Subject: [PATCH] lil restyle --- Gemfile | 2 ++ Gemfile.lock | 8 ++++- app/assets/images/add_new.png | Bin 0 -> 288 bytes app/assets/javascripts/tree.js | 6 ++-- app/assets/stylesheets/projects.css.scss | 33 +++++++++++++++++++++ app/controllers/dashboard_controller.rb | 2 +- app/helpers/projects_helper.rb | 6 ++-- app/views/hooks/index.html.haml | 7 +---- app/views/projects/_project_head.html.haml | 9 ++++++ app/views/projects/_team.html.haml | 5 ---- app/views/projects/_top_menu.html.haml | 29 ------------------ app/views/refs/_tree.html.haml | 17 +++++------ app/views/repositories/_head.html.haml | 4 +++ app/views/snippets/index.html.haml | 2 -- spec/requests/team_members_spec.rb | 2 +- 15 files changed, 71 insertions(+), 61 deletions(-) create mode 100644 app/assets/images/add_new.png delete mode 100644 app/views/projects/_top_menu.html.haml diff --git a/Gemfile b/Gemfile index e240fa65..3b8a4b61 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,7 @@ gem "sqlite3" gem "devise", "1.5.0" gem "stamp" gem "kaminari" +gem "haml", "3.1.4" gem "haml-rails" gem "jquery-rails" gem "grit", :git => "https://github.com/gitlabhq/grit.git" @@ -25,6 +26,7 @@ gem "drapper" gem "resque" gem "httparty" gem "charlock_holmes" +gem "foreman" group :assets do gem "sass-rails", "~> 3.1.0" diff --git a/Gemfile.lock b/Gemfile.lock index 86a69981..1bae6414 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -104,8 +104,11 @@ GEM faker (1.0.1) i18n (~> 0.4) ffi (1.0.11) + foreman (0.27.0) + term-ansicolor (~> 1.0.5) + thor (>= 0.13.6) git (1.2.5) - haml (3.1.3) + haml (3.1.4) haml-rails (0.3.4) actionpack (~> 3.0) activesupport (~> 3.0) @@ -246,6 +249,7 @@ GEM tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.4) stamp (0.1.6) + term-ansicolor (1.0.7) therubyracer (0.9.9) libv8 (~> 3.3.10) thin (1.3.1) @@ -291,9 +295,11 @@ DEPENDENCIES devise (= 1.5.0) drapper faker + foreman git gitolite! grit! + haml (= 3.1.4) haml-rails httparty jquery-rails diff --git a/app/assets/images/add_new.png b/app/assets/images/add_new.png new file mode 100644 index 0000000000000000000000000000000000000000..12fa22c88c99e47fd38091667bac6277ad13a6cd GIT binary patch literal 288 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=k|nMYCBgY=CFO}lsSJ)O`AMk? zp1FzXsX?iUDV2pMQ*D5X4tcsbhE&{obNe9IVFezB3u!;%@BPWhuba8Jy(#CoufV4w zt-V)l7G1e=Y|iIXGV8S~r#xTuecxxx{Zk^}NQGqkvI5P3feEq+JqwvYJOyu??tNS* zW>u^WWvyYn^I7ROcVMK~qbvF<*2hJc!PG "refs", - :action => "tree", - :project_id => @project, - :id => @ref || @project.root_ref ) ? "current" : nil + controller.controller_name == "refs" ? + "current" : nil end def repository_tab_class diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index e149f4fc..3bff76f4 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -1,9 +1,4 @@ = render "repositories/head" - - - - -.right= link_to "Add new", new_project_hook_path(@project), :class => "grey-button append-bottom-10" - unless @hooks.empty? %div.update-data.ui-box.ui-box-small .data @@ -19,7 +14,7 @@ %h3 No hooks .clear -%h3 Help +%hr %p Post receive hooks. For now only POST request allowed. We send some data with request. Example below diff --git a/app/views/projects/_project_head.html.haml b/app/views/projects/_project_head.html.haml index 0a9e3094..dd15559b 100644 --- a/app/views/projects/_project_head.html.haml +++ b/app/views/projects/_project_head.html.haml @@ -15,4 +15,13 @@ %span Snippets + - if current_page?(project_snippets_path(@project)) + - if can? current_user, :write_snippet, @project + = link_to new_project_snippet_path(@project), :class => "add_new", :title => "New Snippet" do + = image_tag "add_new.png", :width => 14 + + - if current_page?(team_project_path(@project)) + - if can? current_user, :admin_team_member, @project + = link_to new_project_team_member_path(@project), :class => "add_new", :title => "New Team Member", :remote => true do + = image_tag "add_new.png", :width => 14 diff --git a/app/views/projects/_team.html.haml b/app/views/projects/_team.html.haml index 6cda3b9b..36629f51 100644 --- a/app/views/projects/_team.html.haml +++ b/app/views/projects/_team.html.haml @@ -1,8 +1,3 @@ -- if can? current_user, :admin_team_member, @project - %div#new-member-holder - .right= link_to "Add new", new_project_team_member_path(@project), :remote => true, :class => "grey-button" - .clear - %br %table.round-borders#team-table %thead %th Name diff --git a/app/views/projects/_top_menu.html.haml b/app/views/projects/_top_menu.html.haml deleted file mode 100644 index 46586e6c..00000000 --- a/app/views/projects/_top_menu.html.haml +++ /dev/null @@ -1,29 +0,0 @@ -%div.top_project_menu - - if @project.repo_exists? - %span= link_to image_tag("home.png", :width => 20), project_path(@project), :class => current_page?(:controller => "projects", :action => "show", :id => @project) ? "current" : nil - %span= link_to "Tree", tree_project_path(@project), :class => current_page?(:controller => "projects", :action => "tree", :id => @project) ? "current" : nil - %span= link_to "Commits", project_commits_path(@project), :class => current_page?(:controller => "commits", :action => "index", :project_id => @project) ? "current" : nil - %span - = link_to team_project_path(@project), :class => (current_page?(:controller => "projects", :action => "team", :id => @project) || controller.controller_name == "team_members") ? "current" : nil do - Team - - if @project.users_projects.count > 0 - %span{ :class => "top_menu_count" }= @project.users_projects.count - %span - = link_to project_issues_path(@project), :class => (controller.controller_name == "issues") ? "current" : nil do - Issues - - if @project.issues.opened.count > 0 - %span{ :class => "top_menu_count" }= @project.issues.opened.count - %span - = link_to wall_project_path(@project), :class => current_page?(:controller => "projects", :action => "wall", :id => @project) ? "current" : nil do - Wall - - if @project.common_notes.count > 0 - %span{ :class => "top_menu_count" }= @project.common_notes.count - %span - = link_to project_snippets_path(@project), :class => (controller.controller_name == "snippets") ? "current" : nil do - Snippets - - if @project.snippets.count > 0 - %span{ :class => "top_menu_count" }= @project.snippets.non_expired.count - - - if @commit - %span= link_to truncate(commit_name(@project,@commit), :length => 15), project_commit_path(@project, :id => @commit.id), :class => current_page?(:controller => "commits", :action => "show", :project_id => @project, :id => @commit.id) ? "current" : nil - diff --git a/app/views/refs/_tree.html.haml b/app/views/refs/_tree.html.haml index b7b3fd2c..4c60e03c 100644 --- a/app/views/refs/_tree.html.haml +++ b/app/views/refs/_tree.html.haml @@ -1,13 +1,12 @@ #tree-breadcrumbs - %h2.icon - %span - %d - = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do - = @project.code - - tree.breadcrumbs(3) do |link| - \/ - = link -   + %h2 + = link_to tree_project_ref_path(@project, @ref, :path => nil), :remote => true do + = @project.code + - tree.breadcrumbs(4) do |link| + \/ + = link +   + %span.tree_progress .clear #tree-content-holder - if tree.is_blob? diff --git a/app/views/repositories/_head.html.haml b/app/views/repositories/_head.html.haml index 7ada9ff7..53af050d 100644 --- a/app/views/repositories/_head.html.haml +++ b/app/views/repositories/_head.html.haml @@ -15,5 +15,9 @@ %span Deploy Keys + - if current_page?(project_hooks_path(@project)) + - if can? current_user, :admin_project, @project + = link_to new_project_hook_path(@project), :class => "add_new", :title => "New Web Hook" do + = image_tag "add_new.png", :width => 14 diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 9af12f74..cdc33562 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,6 +1,4 @@ = render "projects/project_head" -- if can? current_user, :write_snippet, @project - .right= link_to 'New Snippet', new_project_snippet_path(@project), :class => "grey-button append-bottom-10" - unless @snippets.fresh.empty? %div{ :class => "update-data ui-box ui-box-small ui-box-big" } diff --git a/spec/requests/team_members_spec.rb b/spec/requests/team_members_spec.rb index c15ef19c..369b14a6 100644 --- a/spec/requests/team_members_spec.rb +++ b/spec/requests/team_members_spec.rb @@ -22,7 +22,7 @@ describe "TeamMembers" do before do @user_1 = Factory :user visit team_project_path(@project) - click_link "Add new" + click_link "New Team Member" end it "should open new team member popup" do