diff options
Diffstat (limited to 'app/views/search')
-rw-r--r-- | app/views/search/_category.html.haml | 1 | ||||
-rw-r--r-- | app/views/search/_results.html.haml | 10 | ||||
-rw-r--r-- | app/views/search/results/_blob.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_filters.html.haml | 7 |
4 files changed, 13 insertions, 7 deletions
diff --git a/app/views/search/_category.html.haml b/app/views/search/_category.html.haml index d6e38ddd5c6..f094a6f5e3b 100644 --- a/app/views/search/_category.html.haml +++ b/app/views/search/_category.html.haml @@ -30,5 +30,6 @@ = search_filter_link 'issues', _("Issues") = search_filter_link 'merge_requests', _("Merge requests") = search_filter_link 'milestones', _("Milestones") + = render_if_exists 'search/epics_filter_link' = render_if_exists 'search/category_elasticsearch' = users diff --git a/app/views/search/_results.html.haml b/app/views/search/_results.html.haml index e0dbb5135e9..95c378bff7c 100644 --- a/app/views/search/_results.html.haml +++ b/app/views/search/_results.html.haml @@ -1,7 +1,7 @@ - if @search_objects.to_a.empty? + = render partial: "search/results/filters" = render partial: "search/results/empty" = render_if_exists 'shared/promotions/promote_advanced_search' - = render_if_exists 'search/form_revert_to_basic' - else .row-content-block.d-md-flex.text-left.align-items-center - unless @search_objects.is_a?(Kaminari::PaginatableWithoutCount) @@ -10,10 +10,9 @@ - if @project - link_to_project = link_to(@project.full_name, @project, class: 'ml-md-1') - if @scope == 'blobs' - - repository_ref = params[:repository_ref].to_s.presence || @project.default_branch = s_("SearchCodeResults|in") .mx-md-1 - = render partial: "shared/ref_switcher", locals: { ref: repository_ref, form_path: request.fullpath, field_name: 'repository_ref' } + = render partial: "shared/ref_switcher", locals: { ref: repository_ref(@project), form_path: request.fullpath, field_name: 'repository_ref' } = s_('SearchCodeResults|of %{link_to_project}').html_safe % { link_to_project: link_to_project } - else = _("in project %{link_to_project}").html_safe % { link_to_project: link_to_project } @@ -21,8 +20,7 @@ - link_to_group = link_to(@group.name, @group, class: 'ml-md-1') = _("in group %{link_to_group}").html_safe % { link_to_group: link_to_group } = render_if_exists 'shared/promotions/promote_advanced_search' - - #js-search-filter-by-state{ 'v-cloak': true, data: { scope: @scope, state: params[:state] } } + = render partial: "search/results/filters" .results.gl-mt-3 - if @scope == 'commits' @@ -34,7 +32,7 @@ .term = render 'shared/projects/list', projects: @search_objects, pipeline_status: false - else - = render partial: "search/results/#{@scope.singularize}", collection: @search_objects + = render_if_exists partial: "search/results/#{@scope.singularize}", collection: @search_objects - if @scope != 'projects' = paginate_collection(@search_objects) diff --git a/app/views/search/results/_blob.html.haml b/app/views/search/results/_blob.html.haml index 6e17a25c713..aeb37022f99 100644 --- a/app/views/search/results/_blob.html.haml +++ b/app/views/search/results/_blob.html.haml @@ -1,5 +1,5 @@ - project = blob.project - return unless project -- blob_link = project_blob_path(project, tree_join(blob.ref, blob.path)) +- blob_link = project_blob_path(project, tree_join(repository_ref(project), blob.path)) = render partial: 'search/results/blob_data', locals: { blob: blob, project: project, path: blob.path, blob_link: blob_link } diff --git a/app/views/search/results/_filters.html.haml b/app/views/search/results/_filters.html.haml new file mode 100644 index 00000000000..8c402ddb3d1 --- /dev/null +++ b/app/views/search/results/_filters.html.haml @@ -0,0 +1,7 @@ +.d-lg-flex.align-items-end + #js-search-filter-by-state{ 'v-cloak': true, data: { scope: @scope, filter: params[:state]} } + - if Feature.enabled?(:search_filter_by_confidential, @group) + #js-search-filter-by-confidential{ 'v-cloak': true, data: { scope: @scope, filter: params[:confidential] } } + + - if %w(issues merge_requests).include?(@scope) + %hr.gl-mt-4.gl-mb-4 |