[Git][noosfero/noosfero][master] 2 commits: search: content description uses lead instead of body

Rodrigo Souto gitlab at mg.gitlab.com
Tue Jan 17 15:34:17 BRST 2017


Rodrigo Souto pushed to branch master at Noosfero / noosfero


Commits:
8f02c74f by Rodrigo Souto at 2017-01-09T08:48:38-03:00
search: content description uses lead instead of body

- - - - -
18224ab4 by Rodrigo Souto at 2017-01-17T17:34:04+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/compare/03b54d3a7d2666e1a62abadc16df350c0e7ea718...18224ab42551059c11486555106f2194549a57e3
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20170117/8f2ce894/attachment.html>


More information about the Noosfero-dev mailing list