Commit a2efc277 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'feature/project_visibility_filter' of /home/git/repositories/gitlab/gitlabhq

parents a767c133 3b20c890
...@@ -100,3 +100,21 @@ ...@@ -100,3 +100,21 @@
padding: 2px 5px; padding: 2px 5px;
} }
} }
.project-access-icon {
margin-left: 10px;
float: left;
margin-right: 15px;
font-size: 20px;
margin-bottom: 15px;
border: 1px solid #EEE;
padding: 8px 12px;
border-radius: 50px;
background: #f5f5f5;
width: 16px;
text-align: center;
i {
color: #BBB;
}
}
...@@ -40,6 +40,7 @@ class DashboardController < ApplicationController ...@@ -40,6 +40,7 @@ class DashboardController < ApplicationController
end end
@projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present? @projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present?
@projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present?
@projects = @projects.includes(:namespace).sorted_by_activity @projects = @projects.includes(:namespace).sorted_by_activity
@labels = current_user.authorized_projects.tags_on(:labels) @labels = current_user.authorized_projects.tags_on(:labels)
......
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
%span.pull-right %span.pull-right
= current_user.owned_projects.count = current_user.owned_projects.count
%fieldset
%legend Visibility
%ul.bordered-list.visibility-filter
- Gitlab::VisibilityLevel.values.each do |level|
%li{ class: (level.to_s == params[:visibility_level]) ? 'active' : 'light' }
= link_to projects_dashboard_path(visibility_level: level) do
= visibility_level_icon(level)
= visibility_level_label(level)
- if @groups.present? - if @groups.present?
%fieldset %fieldset
...@@ -56,12 +64,10 @@ ...@@ -56,12 +64,10 @@
- @projects.each do |project| - @projects.each do |project|
%li.my-project-row %li.my-project-row
%h4.project-title %h4.project-title
.project-access-icon
= visibility_level_icon(project.visibility_level)
= link_to project_path(project), class: dom_class(project) do = link_to project_path(project), class: dom_class(project) do
= project.name_with_namespace = project.name_with_namespace
- unless project.private?
%small.access-icon
= visibility_level_icon(project.visibility_level)
= visibility_level_label(project.visibility_level)
- if current_user.can_leave_project?(project) - if current_user.can_leave_project?(project)
.pull-right .pull-right
......
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