diff options
Diffstat (limited to 'app/views/search')
-rw-r--r-- | app/views/search/results/_blob_data.html.haml | 15 | ||||
-rw-r--r-- | app/views/search/results/_issuable.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/show.html.haml | 8 |
3 files changed, 18 insertions, 7 deletions
diff --git a/app/views/search/results/_blob_data.html.haml b/app/views/search/results/_blob_data.html.haml index fb2825ad15e..2f13d7d96c7 100644 --- a/app/views/search/results/_blob_data.html.haml +++ b/app/views/search/results/_blob_data.html.haml @@ -1,5 +1,5 @@ -.blob-result{ data: { qa_selector: 'result_item_content' } } - .file-holder +.blob-result.gl-mt-3.gl-mb-5{ data: { qa_selector: 'result_item_content' } } + .file-holder.file-holder-top-border .js-file-title.file-title{ data: { qa_selector: 'file_title_content' } } = link_to blob_link, data: {track_event: 'click_text', track_label: 'blob_path', track_property: 'search_result'} do = sprite_icon('document') @@ -7,5 +7,12 @@ = search_blob_title(project, path) = copy_file_path_button(path) - if blob.data - .file-content.code.term{ data: { qa_selector: 'file_text_content' } } - = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link, highlight_line: blob.highlight_line + - if blob.data.size > 0 + .file-content.code.term{ data: { qa_selector: 'file_text_content' } } + = render 'shared/file_highlight', blob: blob, first_line_number: blob.startline, blob_link: blob_link, highlight_line: blob.highlight_line + - else + .file-content.code + .nothing-here-block + .gl-text-gray-600.gl-font-sm + - max_file_size_indexed = Gitlab::CurrentSettings.elasticsearch_indexed_file_size_limit_kb.kilobytes + = _('The file could not be displayed because it is empty or larger than the maximum file size indexed (%{size}).') % { size: number_to_human_size(max_file_size_indexed) } diff --git a/app/views/search/results/_issuable.html.haml b/app/views/search/results/_issuable.html.haml index 551f5c048bc..63524bbf00e 100644 --- a/app/views/search/results/_issuable.html.haml +++ b/app/views/search/results/_issuable.html.haml @@ -12,7 +12,7 @@ .description.term.gl-px-0 = highlight_and_truncate_issuable(issuable, @search_term, @search_highlight) .col-sm-3.gl-mt-3.gl-sm-mt-0.gl-text-right - - if Feature.enabled?(:search_sort_issues_by_popularity) && issuable.respond_to?(:upvotes_count) && issuable.upvotes_count > 0 + - if issuable.respond_to?(:upvotes_count) && issuable.upvotes_count > 0 %li.issuable-upvotes.gl-list-style-none.has-tooltip{ title: _('Upvotes') } = sprite_icon('thumb-up', css_class: "gl-vertical-align-middle") = issuable.upvotes_count diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index d54310bfa82..ab5ca0cd90f 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -5,10 +5,14 @@ = hidden_field_tag :group_id, params[:group_id] - if params[:project_id].present? = hidden_field_tag :project_id, params[:project_id] +- group_attributes = @group&.attributes&.slice('id', 'name')&.merge(full_name: @group&.full_name) - project_attributes = @project&.attributes&.slice('id', 'namespace_id', 'name')&.merge(name_with_namespace: @project&.name_with_namespace) - if @search_results - - page_description(_("%{count} %{scope} for term '%{term}'") % { count: @search_results.formatted_count(@scope), scope: @scope, term: @search_term }) + - if @without_count + - page_description(_("%{scope} results for term '%{term}'") % { scope: @scope, term: @search_term }) + - else + - page_description(_("%{count} %{scope} for term '%{term}'") % { count: @search_results.formatted_count(@scope), scope: @scope, term: @search_term }) - page_card_attributes("Namespace" => @group&.full_path, "Project" => @project&.full_path) .page-title-holder.d-flex.flex-wrap.justify-content-between @@ -16,7 +20,7 @@ = render_if_exists 'search/form_elasticsearch', attrs: { class: 'mb-2 mb-sm-0 align-self-center' } .gl-mt-3 - #js-search-topbar{ data: { "group-initial-data": @group.to_json, "project-initial-data": project_attributes.to_json } } + #js-search-topbar{ data: { "group-initial-data": group_attributes.to_json, "project-initial-data": project_attributes.to_json } } - if @search_term = render 'search/category' = render 'search/results' |