Commit b32088414941fefd85172614ba6d615db2f07961
1 parent
07f156f5
Exists in
master
and in
4 other branches
List groups on Dashboard#projects page
Showing
5 changed files
with
48 additions
and
25 deletions
Show diff stats
app/assets/stylesheets/gitlab_bootstrap/common.scss
| @@ -56,23 +56,6 @@ | @@ -56,23 +56,6 @@ | ||
| 56 | line-height: 24px; | 56 | line-height: 24px; |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | -/** FORMS **/ | ||
| 60 | -input[type='search'].search-text-input { | ||
| 61 | - background-image: url("icon-search.png"); | ||
| 62 | - background-repeat: no-repeat; | ||
| 63 | - background-position: 10px; | ||
| 64 | - padding-left: 25px; | ||
| 65 | - @include border-radius(4px); | ||
| 66 | - border: 1px solid #ccc; | ||
| 67 | -} | ||
| 68 | - | ||
| 69 | -input[type='text'].danger { | ||
| 70 | - background: #F2DEDE!important; | ||
| 71 | - border-color: #D66; | ||
| 72 | - text-shadow: 0 1px 1px #fff | ||
| 73 | -} | ||
| 74 | - | ||
| 75 | -fieldset legend { font-size: 15px; } | ||
| 76 | 59 | ||
| 77 | .tab-content { | 60 | .tab-content { |
| 78 | overflow: visible; | 61 | overflow: visible; |
app/assets/stylesheets/gitlab_bootstrap/forms.scss
| @@ -31,3 +31,22 @@ input { | @@ -31,3 +31,22 @@ input { | ||
| 31 | } | 31 | } |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | +input[type='search'].search-text-input { | ||
| 35 | + background-image: url("icon-search.png"); | ||
| 36 | + background-repeat: no-repeat; | ||
| 37 | + background-position: 10px; | ||
| 38 | + padding-left: 25px; | ||
| 39 | + @include border-radius(4px); | ||
| 40 | + border: 1px solid #ccc; | ||
| 41 | +} | ||
| 42 | + | ||
| 43 | +input[type='text'].danger { | ||
| 44 | + background: #F2DEDE!important; | ||
| 45 | + border-color: #D66; | ||
| 46 | + text-shadow: 0 1px 1px #fff | ||
| 47 | +} | ||
| 48 | + | ||
| 49 | +fieldset legend { | ||
| 50 | + font-size: 16px; | ||
| 51 | + margin-bottom: 10px; | ||
| 52 | +} |
app/assets/stylesheets/gitlab_bootstrap/nav.scss
app/controllers/dashboard_controller.rb
| @@ -33,9 +33,13 @@ class DashboardController < ApplicationController | @@ -33,9 +33,13 @@ class DashboardController < ApplicationController | ||
| 33 | current_user.owned_projects | 33 | current_user.owned_projects |
| 34 | else | 34 | else |
| 35 | current_user.authorized_projects | 35 | current_user.authorized_projects |
| 36 | - end.sorted_by_activity | 36 | + end |
| 37 | + | ||
| 38 | + @projects = @projects.where(namespace_id: Group.find_by_name(params[:group])) if params[:group].present? | ||
| 39 | + @projects = @projects.includes(:namespace).sorted_by_activity | ||
| 37 | 40 | ||
| 38 | @labels = current_user.authorized_projects.tags_on(:labels) | 41 | @labels = current_user.authorized_projects.tags_on(:labels) |
| 42 | + @groups = current_user.authorized_groups | ||
| 39 | 43 | ||
| 40 | @projects = @projects.tagged_with(params[:label]) if params[:label].present? | 44 | @projects = @projects.tagged_with(params[:label]) if params[:label].present? |
| 41 | @projects = @projects.page(params[:page]).per(30) | 45 | @projects = @projects.page(params[:page]).per(30) |
app/views/dashboard/projects.html.haml
| @@ -26,14 +26,30 @@ | @@ -26,14 +26,30 @@ | ||
| 26 | %span.pull-right | 26 | %span.pull-right |
| 27 | = current_user.owned_projects.count | 27 | = current_user.owned_projects.count |
| 28 | 28 | ||
| 29 | + | ||
| 30 | + - if @groups.present? | ||
| 31 | + %fieldset | ||
| 32 | + %legend Groups | ||
| 33 | + %ul.bordered-list | ||
| 34 | + - @groups.each do |group| | ||
| 35 | + %li{ class: (group.name == params[:group]) ? 'active' : 'light' } | ||
| 36 | + = link_to projects_dashboard_path(group: group.name) do | ||
| 37 | + %i.icon-folder-close-alt | ||
| 38 | + = group.name | ||
| 39 | + %small.pull-right | ||
| 40 | + = group.projects.count | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 29 | - if @labels.present? | 44 | - if @labels.present? |
| 30 | - %p.light Filter by label: | ||
| 31 | - %ul.bordered-list | ||
| 32 | - - @labels.each do |label| | ||
| 33 | - %li{ class: (label.name == params[:label]) ? 'active' : 'light' } | ||
| 34 | - = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do | ||
| 35 | - %i.icon-tag | ||
| 36 | - = label.name | 45 | + %fieldset |
| 46 | + %legend Labels | ||
| 47 | + %ul.bordered-list | ||
| 48 | + - @labels.each do |label| | ||
| 49 | + %li{ class: (label.name == params[:label]) ? 'active' : 'light' } | ||
| 50 | + = link_to projects_dashboard_path(scope: params[:scope], label: label.name) do | ||
| 51 | + %i.icon-tag | ||
| 52 | + = label.name | ||
| 37 | 53 | ||
| 38 | .span9 | 54 | .span9 |
| 39 | %ul.bordered-list.my-projects.top-list | 55 | %ul.bordered-list.my-projects.top-list |