Commit a2efc277cf7ba0f461f73b93ce4f1e80a8c45a97
Exists in
master
and in
4 other branches
Merge branch 'feature/project_visibility_filter' of /home/git/repositories/gitlab/gitlabhq
Showing
3 changed files
with
29 additions
and
4 deletions
Show diff stats
app/assets/stylesheets/sections/dashboard.scss
@@ -100,3 +100,21 @@ | @@ -100,3 +100,21 @@ | ||
100 | padding: 2px 5px; | 100 | padding: 2px 5px; |
101 | } | 101 | } |
102 | } | 102 | } |
103 | + | ||
104 | +.project-access-icon { | ||
105 | + margin-left: 10px; | ||
106 | + float: left; | ||
107 | + margin-right: 15px; | ||
108 | + font-size: 20px; | ||
109 | + margin-bottom: 15px; | ||
110 | + border: 1px solid #EEE; | ||
111 | + padding: 8px 12px; | ||
112 | + border-radius: 50px; | ||
113 | + background: #f5f5f5; | ||
114 | + width: 16px; | ||
115 | + text-align: center; | ||
116 | + | ||
117 | + i { | ||
118 | + color: #BBB; | ||
119 | + } | ||
120 | +} |
app/controllers/dashboard_controller.rb
@@ -40,6 +40,7 @@ class DashboardController < ApplicationController | @@ -40,6 +40,7 @@ class DashboardController < ApplicationController | ||
40 | end | 40 | end |
41 | 41 | ||
42 | @projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present? | 42 | @projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present? |
43 | + @projects = @projects.where(visibility_level: params[:visibility_level]) if params[:visibility_level].present? | ||
43 | @projects = @projects.includes(:namespace).sorted_by_activity | 44 | @projects = @projects.includes(:namespace).sorted_by_activity |
44 | 45 | ||
45 | @labels = current_user.authorized_projects.tags_on(:labels) | 46 | @labels = current_user.authorized_projects.tags_on(:labels) |
app/views/dashboard/projects.html.haml
@@ -26,6 +26,14 @@ | @@ -26,6 +26,14 @@ | ||
26 | %span.pull-right | 26 | %span.pull-right |
27 | = current_user.owned_projects.count | 27 | = current_user.owned_projects.count |
28 | 28 | ||
29 | + %fieldset | ||
30 | + %legend Visibility | ||
31 | + %ul.bordered-list.visibility-filter | ||
32 | + - Gitlab::VisibilityLevel.values.each do |level| | ||
33 | + %li{ class: (level.to_s == params[:visibility_level]) ? 'active' : 'light' } | ||
34 | + = link_to projects_dashboard_path(visibility_level: level) do | ||
35 | + = visibility_level_icon(level) | ||
36 | + = visibility_level_label(level) | ||
29 | 37 | ||
30 | - if @groups.present? | 38 | - if @groups.present? |
31 | %fieldset | 39 | %fieldset |
@@ -56,12 +64,10 @@ | @@ -56,12 +64,10 @@ | ||
56 | - @projects.each do |project| | 64 | - @projects.each do |project| |
57 | %li.my-project-row | 65 | %li.my-project-row |
58 | %h4.project-title | 66 | %h4.project-title |
67 | + .project-access-icon | ||
68 | + = visibility_level_icon(project.visibility_level) | ||
59 | = link_to project_path(project), class: dom_class(project) do | 69 | = link_to project_path(project), class: dom_class(project) do |
60 | = project.name_with_namespace | 70 | = project.name_with_namespace |
61 | - - unless project.private? | ||
62 | - %small.access-icon | ||
63 | - = visibility_level_icon(project.visibility_level) | ||
64 | - = visibility_level_label(project.visibility_level) | ||
65 | 71 | ||
66 | - if current_user.can_leave_project?(project) | 72 | - if current_user.can_leave_project?(project) |
67 | .pull-right | 73 | .pull-right |