diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 09:14:05 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-21 09:14:05 +0300 |
commit | ab42370af01a52c0ba3cfd97d365c735ecb4c468 (patch) | |
tree | 4a2ca619f46e5019db85421b8a9c1f8fec83e605 | |
parent | 23734a715e622f3f028bd565df3be130d3aba737 (diff) | |
download | gitlab-ce-ab42370af01a52c0ba3cfd97d365c735ecb4c468.tar.gz |
Fix sattellites
-rw-r--r-- | app/helpers/dashboard_helper.rb | 4 | ||||
-rw-r--r-- | app/views/dashboard/_filter.html.haml | 9 | ||||
-rw-r--r-- | lib/gitlab/satellite/satellite.rb | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index b73c1c1e1c2..540a73effe8 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -7,4 +7,8 @@ module DashboardHelper dashboard_merge_requests_path(options) end end + + def entities_per_project project, entity + project.items_for(entity).where(assignee_id: current_user.id).count + end end diff --git a/app/views/dashboard/_filter.html.haml b/app/views/dashboard/_filter.html.haml index 98961b3f373..fc00ca72d63 100644 --- a/app/views/dashboard/_filter.html.haml +++ b/app/views/dashboard/_filter.html.haml @@ -21,10 +21,11 @@ %legend Projects: %ul.nav.nav-pills.nav-stacked - @projects.each do |project| - %li{class: ("active" if params[:project_id] == project.id.to_s)} - = link_to dashboard_filter_path(entity, project_id: project.id) do - = project.name_with_namespace - %small.right= project.items_for(entity).where(assignee_id: current_user.id).count + - unless entities_per_project(project, entity).zero? + %li{class: ("active" if params[:project_id] == project.id.to_s)} + = link_to dashboard_filter_path(entity, project_id: project.id) do + = project.name_with_namespace + %small.right= entities_per_project(project, entity) %fieldset %hr diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index 28b6f538d00..91c83d81029 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -41,11 +41,11 @@ module Gitlab end def lock_file - Rails.root.join("tmp", "#{project.path}.lock") + Rails.root.join("tmp", "satellite_#{project.id}.lock") end def path - Rails.root.join("tmp", "repo_satellites", project.path) + Rails.root.join("tmp", "repo_satellites", project.path_with_namespace) end def repo |