[Git][noosfero/noosfero][stable-1.7] Merge branch 'search-content-description' into 'master'

Rodrigo Souto gitlab at mg.gitlab.com
Mon Jan 23 15:27:54 BRST 2017


Rodrigo Souto pushed to branch stable-1.7 at Noosfero / noosfero


Commits:
5183fa5c by Rodrigo Souto at 2017-01-23T17:19:57+00:00
Merge branch 'search-content-description' into 'master'

search: content description uses lead instead of body

See merge request !1084
- - - - -


1 changed file:

- app/views/search/_article_description.html.erb


Changes:

=====================================
app/views/search/_article_description.html.erb
=====================================
--- a/app/views/search/_article_description.html.erb
+++ b/app/views/search/_article_description.html.erb
@@ -3,8 +3,10 @@
 <tr class="search-article-description">
   <td class="search-field-label"><%= _("Description") %></td>
 
-  <% if !article.body.blank? %>
-    <% description = strip_tags(article.body.to_s) %>
+  <% content = article.abstract.present? ? article.abstract : article.body %>
+
+  <% if content.present? %>
+    <% description = strip_tags(content.to_s) %>
     <% description.gsub!(/\s{2,}/, ' ') %>
     <% description = excerpt description, description.first(3), radius: 200 %>
 



View it on GitLab: https://gitlab.com/noosfero/noosfero/commit/5183fa5c292a3a1be374ba356876a7292d3b7599
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170123/13728535/attachment.html>


More information about the Noosfero-dev mailing list