mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Update global search to use new step text elements [SCI-6873] (#4165)
This commit is contained in:
parent
803f65e689
commit
a7e88e59bd
3 changed files with 15 additions and 11 deletions
|
@ -60,8 +60,9 @@ class Step < ApplicationRecord
|
|||
.pluck(:id)
|
||||
|
||||
new_query = Step.distinct
|
||||
.left_outer_joins(:step_texts)
|
||||
.where(steps: { protocol_id: protocol_ids })
|
||||
.where_attributes_like(%i(name description), query, options)
|
||||
.where_attributes_like(['name', 'step_texts.text'], query, options)
|
||||
|
||||
# Show all results if needed
|
||||
if page == Constants::SEARCH_NO_LIMIT
|
||||
|
|
|
@ -4,16 +4,18 @@
|
|||
<%= render partial: "search/results/partials/step_text.html.erb", locals: { step: step, query: search_query, target: nil } %>
|
||||
</h5>
|
||||
|
||||
<% if step.description.present? %>
|
||||
<p>
|
||||
<span>
|
||||
<%=t "search.index.description" %>
|
||||
<%= highlight custom_auto_link(step.tinymce_render(:description),
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
team: current_team), search_query.strip.split(/\s+/) %>
|
||||
</span>
|
||||
<p>
|
||||
<% if step.step_texts.present? %>
|
||||
<% step.step_texts.each do |step_text| %>
|
||||
<p>
|
||||
<span>
|
||||
<%= t('search.index.text') %>
|
||||
<%= highlight custom_auto_link(step_text.tinymce_render(:text),
|
||||
simple_format: false,
|
||||
tags: %w(img),
|
||||
team: current_team), search_query.strip.split(/\s+/) %>
|
||||
</span>
|
||||
<p>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -311,6 +311,7 @@ en:
|
|||
authors: "Authors: "
|
||||
description: "Description: "
|
||||
no_description: "No description"
|
||||
text: "Text"
|
||||
team: "Team: "
|
||||
folder: "Folders: "
|
||||
repository: "Inventory: "
|
||||
|
|
Loading…
Reference in a new issue