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:
parent
1ff01d26e1
commit
24037e7e63
8 changed files with 87 additions and 81 deletions
|
@ -137,6 +137,12 @@
|
||||||
color: #666;
|
color: #666;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav-pills > .active > a > span > .badge {
|
||||||
|
background-color: #fff;
|
||||||
|
color: $gl-primary;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* fix to keep tooltips position in top navigation bar
|
* fix to keep tooltips position in top navigation bar
|
||||||
*
|
*
|
||||||
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -3,4 +3,4 @@
|
||||||
= render "layouts/head", title: "Search"
|
= render "layouts/head", title: "Search"
|
||||||
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
|
%body{class: "#{app_theme} application", :'data-page' => body_data_page}
|
||||||
= render "layouts/head_panel", title: link_to("Search", search_path)
|
= render "layouts/head_panel", title: link_to("Search", search_path)
|
||||||
= render 'layouts/page', sidebar: 'layouts/nav/search'
|
= render 'layouts/page'
|
||||||
|
|
77
app/views/search/_category.html.haml
Normal file
77
app/views/search/_category.html.haml
Normal 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
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
.search-holder.clearfix
|
.search-holder.clearfix
|
||||||
.form-group
|
.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
|
= 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'
|
- unless params[:snippets].eql? 'true'
|
||||||
.pull-right
|
.pull-right
|
||||||
= render 'filter'
|
= render 'filter'
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
= render 'search/form'
|
= render 'search/form'
|
||||||
%hr
|
%hr
|
||||||
- if @search_term
|
- if @search_term
|
||||||
|
= render 'search/category'
|
||||||
|
%hr
|
||||||
= render 'search/results'
|
= render 'search/results'
|
||||||
|
|
Loading…
Reference in a new issue