BigW Consortium Gitlab

Commit 133d7822 by Dmitriy Zaporozhets

Dashboard -> projects -> filtering by project label

parent edf41005
...@@ -69,5 +69,14 @@ ul.bordered-list { ...@@ -69,5 +69,14 @@ ul.bordered-list {
display: block; display: block;
margin: 0px; margin: 0px;
&:last-child { border:none } &:last-child { border:none }
&.active {
background: #f9f9f9;
a { font-weight: bold; }
}
&.light {
a { color: #777; }
}
} }
} }
...@@ -34,6 +34,7 @@ class DashboardController < ApplicationController ...@@ -34,6 +34,7 @@ class DashboardController < ApplicationController
@projects @projects
end end
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
@projects = @projects.search(params[:search]) if params[:search].present? @projects = @projects.search(params[:search]) if params[:search].present?
@projects = @projects.page(params[:page]).per(30) @projects = @projects.page(params[:page]).per(30)
end end
......
...@@ -3,6 +3,10 @@ module ProjectsHelper ...@@ -3,6 +3,10 @@ module ProjectsHelper
"You are going to remove #{user.name} from #{project.name} project team. Are you sure?" "You are going to remove #{user.name} from #{project.name} project team. Are you sure?"
end end
def projects_labels
Project.tag_counts_on(:labels).map(&:name)
end
def link_to_project project def link_to_project project
link_to project do link_to project do
title = content_tag(:strong, project.name) title = content_tag(:strong, project.name)
......
...@@ -20,6 +20,15 @@ ...@@ -20,6 +20,15 @@
= nav_tab :scope, 'joined' do = nav_tab :scope, 'joined' do
= link_to "Joined", projects_dashboard_path(scope: 'joined') = link_to "Joined", projects_dashboard_path(scope: 'joined')
%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
%i.icon-tag
= label
.span9 .span9
= form_tag projects_dashboard_path, method: 'get' do = form_tag projects_dashboard_path, method: 'get' do
%fieldset.dashboard-search-filter %fieldset.dashboard-search-filter
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment