diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-05 22:26:21 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-05 22:26:21 +0400 |
commit | 3b20c89005686c04966d749239ce312b65bd8f59 (patch) | |
tree | 2c1c7d1771ee5b9b6579bc8952b5422a6428446b /app | |
parent | a767c13367c25d2684c94a90ee9f91f02da286a9 (diff) |
Add visibility filter to Dashboard#projects
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/stylesheets/sections/dashboard.scss | 18 | ||||
-rw-r--r-- | app/controllers/dashboard_controller.rb | 1 | ||||
-rw-r--r-- | app/views/dashboard/projects.html.haml | 14 |
3 files changed, 29 insertions, 4 deletions
diff --git a/app/assets/stylesheets/sections/dashboard.scss b/app/assets/stylesheets/sections/dashboard.scss index f70822c0397..99bbcbd2108 100644 --- a/app/assets/stylesheets/sections/dashboard.scss +++ b/app/assets/stylesheets/sections/dashboard.scss @@ -100,3 +100,21 @@ 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; + } +} diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb index 17715020f87..045e5805bd0 100644 --- a/app/controllers/dashboard_controller.rb +++ b/app/controllers/dashboard_controller.rb @@ -40,6 +40,7 @@ class DashboardController < ApplicationController end @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 @labels = current_user.authorized_projects.tags_on(:labels) diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 5ac90593c3a..a0ef76c8f2c 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -26,6 +26,14 @@ %span.pull-right = 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? %fieldset @@ -56,12 +64,10 @@ - @projects.each do |project| %li.my-project-row %h4.project-title + .project-access-icon + = visibility_level_icon(project.visibility_level) = link_to project_path(project), class: dom_class(project) do = 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) .pull-right |