From 8b513fbc50e2e35be0c5fda35a980b064a3c7523 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 14 Jan 2014 13:51:59 +0200 Subject: [PATCH] Improve side filters and make them look similar --- app/assets/stylesheets/generic/common.scss | 10 +++++----- app/assets/stylesheets/gl_bootstrap.scss | 10 +++++++++- app/views/dashboard/_projects_filter.html.haml | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ app/views/dashboard/projects.html.haml | 57 +-------------------------------------------------------- app/views/projects/_settings_nav.html.haml | 2 -- app/views/shared/_filter.html.haml | 7 ++++--- app/views/shared/_project_filter.html.haml | 3 ++- features/steps/dashboard/dashboard_issues.rb | 2 +- features/steps/dashboard/dashboard_merge_requests.rb | 2 +- 9 files changed, 78 insertions(+), 70 deletions(-) create mode 100644 app/views/dashboard/_projects_filter.html.haml diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss index 4c1a1e9..79a2171 100644 --- a/app/assets/stylesheets/generic/common.scss +++ b/app/assets/stylesheets/generic/common.scss @@ -475,13 +475,13 @@ table { } } +.btn-sign-in { + margin-top: 7px; + text-shadow: none; +} + .side-filters { fieldset { margin-bottom: 15px; } } - -.btn-sign-in { - margin-top: 7px; - text-shadow: none; -} diff --git a/app/assets/stylesheets/gl_bootstrap.scss b/app/assets/stylesheets/gl_bootstrap.scss index a67a37b..7f45d64 100644 --- a/app/assets/stylesheets/gl_bootstrap.scss +++ b/app/assets/stylesheets/gl_bootstrap.scss @@ -140,7 +140,15 @@ $pagination-active-bg: $bg_style_color; } } -.nav-tabs > li > a, .nav-pills > li > a { color: #666; } +.nav-tabs > li > a, +.nav-pills > li > a { + color: #666; +} + +.nav-small > li > a { + padding: 3px 5px; + font-size: 12px; +} /* diff --git a/app/views/dashboard/_projects_filter.html.haml b/app/views/dashboard/_projects_filter.html.haml new file mode 100644 index 0000000..8c9893b --- /dev/null +++ b/app/views/dashboard/_projects_filter.html.haml @@ -0,0 +1,55 @@ +%fieldset + %ul.nav.nav-pills.nav-stacked + = nav_tab :scope, nil do + = link_to projects_dashboard_filter_path(scope: nil) do + All + %span.pull-right + = current_user.authorized_projects.count + = nav_tab :scope, 'personal' do + = link_to projects_dashboard_filter_path(scope: 'personal') do + Personal + %span.pull-right + = current_user.personal_projects.count + = nav_tab :scope, 'joined' do + = link_to projects_dashboard_filter_path(scope: 'joined') do + Joined + %span.pull-right + = current_user.authorized_projects.joined(current_user).count + = nav_tab :scope, 'owned' do + = link_to projects_dashboard_filter_path(scope: 'owned') do + Owned + %span.pull-right + = current_user.owned_projects.count + +%fieldset + %legend Visibility + %ul.nav.nav-pills.nav-stacked.nav-small.visibility-filter + - Gitlab::VisibilityLevel.values.each do |level| + %li{ class: (level.to_s == params[:visibility_level]) ? 'active' : 'light' } + = link_to projects_dashboard_filter_path(visibility_level: level) do + = visibility_level_icon(level) + = visibility_level_label(level) + +- if @groups.present? + %fieldset + %legend Groups + %ul.nav.nav-pills.nav-stacked.nav-small + - @groups.each do |group| + %li{ class: (group.name == params[:group]) ? 'active' : 'light' } + = link_to projects_dashboard_filter_path(group: group.name) do + %i.icon-folder-close-alt + = group.name + %small.pull-right + = group.projects.count + + + +- if @labels.present? + %fieldset + %legend Labels + %ul.nav.nav-pills.nav-stacked.nav-small + - @labels.each do |label| + %li{ class: (label.name == params[:label]) ? 'active' : 'light' } + = link_to projects_dashboard_filter_path(scope: params[:scope], label: label.name) do + %i.icon-tag + = label.name diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index e6a6919..8feef97 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -26,62 +26,7 @@ %hr .row .col-md-3.hidden-sm.hidden-xs.side-filters - %fieldset - %ul.nav.nav-pills.nav-stacked - = nav_tab :scope, nil do - = link_to projects_dashboard_filter_path(scope: nil) do - All - %span.pull-right - = current_user.authorized_projects.count - = nav_tab :scope, 'personal' do - = link_to projects_dashboard_filter_path(scope: 'personal') do - Personal - %span.pull-right - = current_user.personal_projects.count - = nav_tab :scope, 'joined' do - = link_to projects_dashboard_filter_path(scope: 'joined') do - Joined - %span.pull-right - = current_user.authorized_projects.joined(current_user).count - = nav_tab :scope, 'owned' do - = link_to projects_dashboard_filter_path(scope: 'owned') do - Owned - %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_filter_path(visibility_level: level) do - = visibility_level_icon(level) - = visibility_level_label(level) - - - if @groups.present? - %fieldset - %legend Groups - %ul.bordered-list - - @groups.each do |group| - %li{ class: (group.name == params[:group]) ? 'active' : 'light' } - = link_to projects_dashboard_filter_path(group: group.name) do - %i.icon-folder-close-alt - = group.name - %small.pull-right - = group.projects.count - - - - - if @labels.present? - %fieldset - %legend Labels - %ul.bordered-list - - @labels.each do |label| - %li{ class: (label.name == params[:label]) ? 'active' : 'light' } - = link_to projects_dashboard_filter_path(scope: params[:scope], label: label.name) do - %i.icon-tag - = label.name - + = render "projects_filter" .col-md-9 %ul.bordered-list.my-projects.top-list - @projects.each do |project| diff --git a/app/views/projects/_settings_nav.html.haml b/app/views/projects/_settings_nav.html.haml index 48e7181..e4cfabc 100644 --- a/app/views/projects/_settings_nav.html.haml +++ b/app/views/projects/_settings_nav.html.haml @@ -1,11 +1,9 @@ %ul.nav.nav-pills.nav-stacked.nav-stacked-menu.append-bottom-20 = nav_link(path: 'projects#edit') do = link_to edit_project_path(@project), class: "stat-tab tab " do - %i.icon-edit Edit Project = nav_link(controller: [:team_members, :teams]) do = link_to project_team_index_path(@project), class: "team-tab tab" do - %i.icon-group Members = nav_link(controller: :deploy_keys) do = link_to project_deploy_keys_path(@project) do diff --git a/app/views/shared/_filter.html.haml b/app/views/shared/_filter.html.haml index 00496b0..96299f8 100644 --- a/app/views/shared/_filter.html.haml +++ b/app/views/shared/_filter.html.haml @@ -10,10 +10,11 @@ Created by me %li{class: ("active" if params[:scope] == 'all')} = link_to filter_path(entity, scope: 'all') do - All + Everyone's %fieldset.status-filter - %ul.nav.nav-pills.nav-stacked + %legend State + %ul.nav.nav-pills %li{class: ("active" if params[:status].blank?)} = link_to filter_path(entity, status: nil) do Open @@ -26,7 +27,7 @@ %fieldset %legend Projects - %ul.nav.nav-pills.nav-pills-small.nav-stacked + %ul.nav.nav-pills.nav-stacked.nav-small - @projects.each do |project| - unless entities_per_project(project, entity).zero? %li{class: ("active" if params[:project_id] == project.id.to_s)} diff --git a/app/views/shared/_project_filter.html.haml b/app/views/shared/_project_filter.html.haml index 0509cd4..a4f406a 100644 --- a/app/views/shared/_project_filter.html.haml +++ b/app/views/shared/_project_filter.html.haml @@ -14,7 +14,8 @@ Created by me %fieldset - %ul.nav.nav-pills.nav-stacked + %legend State + %ul.nav.nav-pills %li{class: ("active" if params[:state].blank?)} = link_to project_filter_path(state: nil) do Open diff --git a/features/steps/dashboard/dashboard_issues.rb b/features/steps/dashboard/dashboard_issues.rb index 9d486bd..a458acd 100644 --- a/features/steps/dashboard/dashboard_issues.rb +++ b/features/steps/dashboard/dashboard_issues.rb @@ -40,7 +40,7 @@ class DashboardIssues < Spinach::FeatureSteps step 'I click "All" link' do within ".scope-filter" do - click_link 'All' + click_link "Everyone's" end end diff --git a/features/steps/dashboard/dashboard_merge_requests.rb b/features/steps/dashboard/dashboard_merge_requests.rb index f6fe474..7328653 100644 --- a/features/steps/dashboard/dashboard_merge_requests.rb +++ b/features/steps/dashboard/dashboard_merge_requests.rb @@ -40,7 +40,7 @@ class DashboardMergeRequests < Spinach::FeatureSteps step 'I click "All" link' do within ".scope-filter" do - click_link 'All' + click_link "Everyone's" end end -- libgit2 0.21.2