diff --git a/app/views/dataset/_document.html.erb b/app/views/dataset/_document.html.erb index 8ab1625b9e75dd035c4bb0e5dedf52a3dfed49f5..3c27f28fe579c5ecc219a5a2f4b5de92fff643f4 100644 --- a/app/views/dataset/_document.html.erb +++ b/app/views/dataset/_document.html.erb @@ -3,15 +3,13 @@ data-action="click->dataset#toggleResultSelection" data-doc-id="<%= doc.id %>"> <h5> - <% - if doc.is_a?(Article) - url = "/catalog/#{doc.issue_id}?selected=#{doc.id}" + <% if doc.is_a?(Article) + url = "/catalog/#{doc.issue_id}?selected=#{doc.id}" elsif doc.is_a?(CompoundArticle) - url = "/catalog/#{doc.issue_id}?selected_compound=#{doc.id}" + url = "/catalog/#{doc.issue_id}?selected_compound=#{doc.id}" else - url = "/catalog/#{doc.id}" - end - %> + url = "/catalog/#{doc.id}" + end %> <a href="<%= url %>"> <span class="doc_index"><%= doc_index %>.</span> <%= doc.is_a?(Article) ? doc.id : doc.title %> @@ -30,9 +28,9 @@ </div> <div class="col-4"> <% if !highlight.nil? and !highlight.first.nil? %> - <% highlight.first[1].each do |extract| %> - <p>...<%= extract.gsub(/\n/,'<br/>').gsub('<br/><br/>','<br/>').html_safe %>...</p> - <% end %> + <%# highlight.first[1].each do |extract| %> + <p><%= highlight unless doc.is_a?(Issue) %><%#= extract.gsub(/\n/, "<br/>").gsub("<br/><br/>", "<br/>").html_safe %></p> + <%# end %> <% end %> </div> <div class="col-4"> diff --git a/app/views/dataset/_documents.html.erb b/app/views/dataset/_documents.html.erb index bf97719e7dab93c3cfb9e0712f4de19392813560..5ffc056d90ba9ad8df3ba597050cbdc394c2761e 100644 --- a/app/views/dataset/_documents.html.erb +++ b/app/views/dataset/_documents.html.erb @@ -1,7 +1,7 @@ <div class="list-group list-group-flush w-100"> <% docs.each_with_index do |doc, idx| %> <%# Highlight will be used when searching into a dataset %> - <%= render partial: "document", locals: {doc: doc, highlight: nil, doc_index: (pagenum-1) * rows + idx + 1} %> + <%= render partial: "document", locals: { doc: doc, highlight: doc.all_text, doc_index: (pagenum - 1) * rows + idx + 1 } %> <hr/> <% end %> </div> \ No newline at end of file