Skip to content
Snippets Groups Projects
Commit abff0399 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix project labels scope

parent de12eba2
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -37,6 +37,8 @@ class DashboardController < ApplicationController
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
@projects = @projects.search(params[:search]) if params[:search].present?
@projects = @projects.page(params[:page]).per(30)
@labels = Project.where(id: @projects.map(&:id)).tags_on(:labels)
end
 
# Get authored or assigned open merge requests
Loading
Loading
Loading
Loading
@@ -3,10 +3,6 @@ module ProjectsHelper
"You are going to remove #{user.name} from #{project.name} project team. Are you sure?"
end
 
def projects_labels
Project.tag_counts_on(:labels).map(&:name)
end
def link_to_project project
link_to project do
title = content_tag(:strong, project.name)
Loading
Loading
Loading
Loading
@@ -22,11 +22,11 @@
 
%p.light Filter by label:
%ul.bordered-list
- projects_labels.each do |label|
%li{ class: (label == params[:label]) ? 'active' : 'light' }
= link_to projects_dashboard_path(scope: params[:scope], label: label) do
- @labels.each do |label|
%li{ class: (label.name == params[:label]) ? 'active' : 'light' }
= link_to projects_dashboard_path(scope: params[:scope], label: label.name) do
%i.icon-tag
= label
= label.name
 
 
.span9
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment