diff options
author | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-01-11 11:35:21 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@sphereconsultinginc.com> | 2012-01-11 18:37:34 +0400 |
commit | c8b955a44b1897394d6dda349af2f183a820cc28 (patch) | |
tree | 25d5abec97ad186b8f2847443de493b02de19cf9 /app | |
parent | c66bc99fb7d22d005cf0de687b9535f8bef52e23 (diff) |
lil restyle
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/images/add_new.png | bin | 0 -> 288 bytes | |||
-rw-r--r-- | app/assets/javascripts/tree.js | 6 | ||||
-rw-r--r-- | app/assets/stylesheets/projects.css.scss | 33 | ||||
-rw-r--r-- | app/controllers/dashboard_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 6 | ||||
-rw-r--r-- | app/views/hooks/index.html.haml | 7 | ||||
-rw-r--r-- | app/views/projects/_project_head.html.haml | 9 | ||||
-rw-r--r-- | app/views/projects/_team.html.haml | 5 | ||||
-rw-r--r-- | app/views/projects/_top_menu.html.haml | 29 | ||||
-rw-r--r-- | app/views/refs/_tree.html.haml | 17 | ||||
-rw-r--r-- | app/views/repositories/_head.html.haml | 4 | ||||
-rw-r--r-- | app/views/snippets/index.html.haml | 2 |
12 files changed, 61 insertions, 59 deletions
diff --git a/app/assets/images/add_new.png b/app/assets/images/add_new.png Binary files differnew file mode 100644 index 00000000000..12fa22c88c9 --- /dev/null +++ b/app/assets/images/add_new.png diff --git a/app/assets/javascripts/tree.js b/app/assets/javascripts/tree.js index bde543f0b86..2e9bcc82a2b 100644 --- a/app/assets/javascripts/tree.js +++ b/app/assets/javascripts/tree.js @@ -5,7 +5,7 @@ var Tree = { init: function() { - (new Image).src = "/assets/ajax-loader-tree.gif"; + (new Image).src = "ajax-loader-facebook.gif"; $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() { history.pushState({ path: this.path }, '', this.href) @@ -20,8 +20,8 @@ var Tree = { }); $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live({ - "ajax:beforeSend": function() { $('h2.icon').addClass("loading") }, - "ajax:complete": function() { $('h2.icon').removeClass("loading")} + "ajax:beforeSend": function() { $('.tree_progress').addClass("loading"); }, + "ajax:complete": function() { $('.tree_progress').removeClass("loading"); } }); } } diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index 0b43f55789d..22e8f994265 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -693,3 +693,36 @@ a.project-update.titled { top: 0; } } + +.add_new { + float:right; + padding: 5px 12px; + border: 1px solid #CCC; + + &:hover { + background:#eee; + } + + &:active { + background:#ddd; + } +} + +.tree_progress { + float:left; + width:16px; + height:16px; + margin:6px; + &.loading { + background-position: 0px 0px; + background: url("ajax-loader-facebook.gif") no-repeat; + } +} + +#tree-breadcrumbs { + h2 { + margin:0; + margin-bottom:20px; + float:left; + } +} diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 39c706488e5..c256b42cc54 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -3,7 +3,7 @@ class DashboardController < ApplicationController def index @projects = current_user.projects.all - @active_projects = @projects.select(&:last_activity_date_cached).sort_by(&:last_activity_date_cached).reverse + @active_projects = @projects.select(&:repo_exists?).select(&:last_activity_date_cached).sort_by(&:last_activity_date_cached).reverse respond_to do |format| format.html diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 57786338ceb..817ab475490 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -28,10 +28,8 @@ module ProjectsHelper end def tree_tab_class - current_page?(:controller => "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 e149f4fc767..3bff76f47c0 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 0a9e30944b2..dd15559bc8e 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 6cda3b9b103..36629f51809 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 46586e6ca5d..00000000000 --- 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 b7b3fd2ca80..4c60e03c009 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 7ada9ff7798..53af050df44 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 9af12f74c2b..cdc3356299b 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" } |