Commit ab42370af01a52c0ba3cfd97d365c735ecb4c468

Authored by Dmitriy Zaporozhets
1 parent 23734a71

Fix sattellites

app/helpers/dashboard_helper.rb
... ... @@ -7,4 +7,8 @@ module DashboardHelper
7 7 dashboard_merge_requests_path(options)
8 8 end
9 9 end
  10 +
  11 + def entities_per_project project, entity
  12 + project.items_for(entity).where(assignee_id: current_user.id).count
  13 + end
10 14 end
... ...
app/views/dashboard/_filter.html.haml
... ... @@ -21,10 +21,11 @@
21 21 %legend Projects:
22 22 %ul.nav.nav-pills.nav-stacked
23 23 - @projects.each do |project|
24   - %li{class: ("active" if params[:project_id] == project.id.to_s)}
25   - = link_to dashboard_filter_path(entity, project_id: project.id) do
26   - = project.name_with_namespace
27   - %small.right= project.items_for(entity).where(assignee_id: current_user.id).count
  24 + - unless entities_per_project(project, entity).zero?
  25 + %li{class: ("active" if params[:project_id] == project.id.to_s)}
  26 + = link_to dashboard_filter_path(entity, project_id: project.id) do
  27 + = project.name_with_namespace
  28 + %small.right= entities_per_project(project, entity)
28 29  
29 30 %fieldset
30 31 %hr
... ...
lib/gitlab/satellite/satellite.rb
... ... @@ -41,11 +41,11 @@ module Gitlab
41 41 end
42 42  
43 43 def lock_file
44   - Rails.root.join("tmp", "#{project.path}.lock")
  44 + Rails.root.join("tmp", "satellite_#{project.id}.lock")
45 45 end
46 46  
47 47 def path
48   - Rails.root.join("tmp", "repo_satellites", project.path)
  48 + Rails.root.join("tmp", "repo_satellites", project.path_with_namespace)
49 49 end
50 50  
51 51 def repo
... ...