Move search categories (projects, issues etc) below search field. Instead use sidebar for dashbaord nav

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2015-04-29 12:19:54 +03:00
parent 1ff01d26e1
commit 24037e7e63
No known key found for this signature in database
GPG Key ID: 161B5D6A44D3D88A
8 changed files with 87 additions and 81 deletions

View File

@ -137,6 +137,12 @@
color: #666;
}
.nav-pills > .active > a > span > .badge {
background-color: #fff;
color: $gl-primary;
}
/**
* fix to keep tooltips position in top navigation bar
*

View File

@ -1,30 +0,0 @@
- if @search_term
%ul.nav.nav-sidebar.search-filter
- if @project
= render 'layouts/nav/search/project'
- elsif @show_snippets
= render 'layouts/nav/search/snippet'
- else
%li{class: ("active" if @scope == 'projects')}
= link_to search_filter_path(scope: 'projects') do
= icon('bookmark fw')
%span
Projects
%span.count
= @search_results.projects_count
%li{class: ("active" if @scope == 'issues')}
= link_to search_filter_path(scope: 'issues') do
= icon('exclamation-circle fw')
%span
Issues
%span.count
= @search_results.issues_count
%li{class: ("active" if @scope == 'merge_requests')}
= link_to search_filter_path(scope: 'merge_requests') do
= icon('tasks fw')
%span
Merge requests
%span.count
= @search_results.merge_requests_count

View File

@ -1,35 +0,0 @@
%li{class: ("active" if @scope == 'blobs')}
= link_to search_filter_path(scope: 'blobs') do
= icon('code fw')
%span
Code
%span.count
= @search_results.blobs_count
%li{class: ("active" if @scope == 'issues')}
= link_to search_filter_path(scope: 'issues') do
= icon('exclamation-circle fw')
%span
Issues
%span.count
= @search_results.issues_count
%li{class: ("active" if @scope == 'merge_requests')}
= link_to search_filter_path(scope: 'merge_requests') do
= icon('tasks fw')
%span
Merge requests
%span.count
= @search_results.merge_requests_count
%li{class: ("active" if @scope == 'notes')}
= link_to search_filter_path(scope: 'notes') do
= icon('comments fw')
%span
Comments
%span.count
= @search_results.notes_count
%li{class: ("active" if @scope == 'wiki_blobs')}
= link_to search_filter_path(scope: 'wiki_blobs') do
= icon('book fw')
%span
Wiki
%span.count
= @search_results.wiki_blobs_count

View File

@ -1,14 +0,0 @@
%li{class: ("active" if @scope == 'snippet_blobs')}
= link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
= icon('code fw')
%span
Snippet Contents
%span.count
= @search_results.snippet_blobs_count
%li{class: ("active" if @scope == 'snippet_titles')}
= link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
= icon('book fw')
%span
Titles and Filenames
%span.count
= @search_results.snippet_titles_count

View File

@ -3,4 +3,4 @@
= render "layouts/head", title: "Search"
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
= render "layouts/head_panel", title: link_to("Search", search_path)
= render 'layouts/page', sidebar: 'layouts/nav/search'
= render 'layouts/page'

View File

@ -0,0 +1,77 @@
%ul.nav.nav-pills.search-filter
- if @project
%li{class: ("active" if @scope == 'blobs')}
= link_to search_filter_path(scope: 'blobs') do
= icon('code fw')
%span
Code
%span.badge
= @search_results.blobs_count
%li{class: ("active" if @scope == 'issues')}
= link_to search_filter_path(scope: 'issues') do
= icon('exclamation-circle fw')
%span
Issues
%span.badge
= @search_results.issues_count
%li{class: ("active" if @scope == 'merge_requests')}
= link_to search_filter_path(scope: 'merge_requests') do
= icon('tasks fw')
%span
Merge requests
%span.badge
= @search_results.merge_requests_count
%li{class: ("active" if @scope == 'notes')}
= link_to search_filter_path(scope: 'notes') do
= icon('comments fw')
%span
Comments
%span.badge
= @search_results.notes_count
%li{class: ("active" if @scope == 'wiki_blobs')}
= link_to search_filter_path(scope: 'wiki_blobs') do
= icon('book fw')
%span
Wiki
%span.badge
= @search_results.wiki_blobs_count
- elsif @show_snippets
%li{class: ("active" if @scope == 'snippet_blobs')}
= link_to search_filter_path(scope: 'snippet_blobs', snippets: true, group_id: nil, project_id: nil) do
= icon('code fw')
%span
Snippet Contents
%span.badge
= @search_results.snippet_blobs_count
%li{class: ("active" if @scope == 'snippet_titles')}
= link_to search_filter_path(scope: 'snippet_titles', snippets: true, group_id: nil, project_id: nil) do
= icon('book fw')
%span
Titles and Filenames
%span.badge
= @search_results.snippet_titles_count
- else
%li{class: ("active" if @scope == 'projects')}
= link_to search_filter_path(scope: 'projects') do
= icon('bookmark fw')
%span
Projects
%span.badge
= @search_results.projects_count
%li{class: ("active" if @scope == 'issues')}
= link_to search_filter_path(scope: 'issues') do
= icon('exclamation-circle fw')
%span
Issues
%span.badge
= @search_results.issues_count
%li{class: ("active" if @scope == 'merge_requests')}
= link_to search_filter_path(scope: 'merge_requests') do
= icon('tasks fw')
%span
Merge requests
%span.badge
= @search_results.merge_requests_count

View File

@ -6,7 +6,7 @@
.search-holder.clearfix
.form-group
= search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input input-mn-300", id: "dashboard_search", autofocus: true
= button_tag 'Search', class: "btn btn-info"
= button_tag 'Search', class: "btn btn-primary"
- unless params[:snippets].eql? 'true'
.pull-right
= render 'filter'

View File

@ -1,4 +1,6 @@
= render 'search/form'
%hr
- if @search_term
= render 'search/category'
%hr
= render 'search/results'