[Git][noosfero/noosfero][master] 2 commits: search: fix author and add profile to article display
Rodrigo Souto
gitlab at mg.gitlab.com
Thu Mar 1 15:29:01 BRT 2018
Rodrigo Souto pushed to branch master at Noosfero / noosfero
Commits:
c3b2377a by Rodrigo Souto at 2018-02-28T17:41:06Z
search: fix author and add profile to article display
- - - - -
323ed78a by Rodrigo Souto at 2018-03-01T18:28:52Z
Merge branch 'search-results-fields' into 'master'
search: fix author and add profile to article display
See merge request noosfero/noosfero!1409
- - - - -
4 changed files:
- app/views/search/_article_author.html.erb
- app/views/search/_article_common.html.erb
- + app/views/search/_article_profile.html.erb
- features/search_contents.feature
Changes:
=====================================
app/views/search/_article_author.html.erb
=====================================
--- a/app/views/search/_article_author.html.erb
+++ b/app/views/search/_article_author.html.erb
@@ -3,6 +3,10 @@
<tr class="search-article-author search-article-author-name">
<td class="search-field-label"><%= _("Author") %></td>
<td>
- <%= link_to_profile article.profile.name, article.profile.identifier %>
+ <% if article.author.present? %>
+ <%= link_to_profile article.author.name, article.author.identifier %>
+ <% else %>
+ <%= article.author_name %>
+ <% end %>
</td>
</tr>
=====================================
app/views/search/_article_common.html.erb
=====================================
--- a/app/views/search/_article_common.html.erb
+++ b/app/views/search/_article_common.html.erb
@@ -2,6 +2,7 @@
<% show_description = true if show_description.nil? %>
<%= render :partial => 'article_author', :object => article %>
+<%= render :partial => 'article_profile', :object => article %>
<%= render :partial => 'article_description', :object => article if show_description %>
<%= render :partial => 'article_tags', :object => article.tags %>
<%= render :partial => 'article_categories', :object => article.categories %>
=====================================
app/views/search/_article_profile.html.erb
=====================================
--- /dev/null
+++ b/app/views/search/_article_profile.html.erb
@@ -0,0 +1,8 @@
+<% article = article_profile %>
+
+<tr class="search-article-profile search-article-profile-name">
+ <td class="search-field-label"><%= _("Profile") %></td>
+ <td>
+ <%= link_to_profile article.profile.name, article.profile.identifier %>
+ </td>
+</tr>
=====================================
features/search_contents.feature
=====================================
--- a/features/search_contents.feature
+++ b/features/search_contents.feature
@@ -152,8 +152,8 @@ Feature: search contents
When I go to the search articles page
And I fill in "search-input" with "whales"
And I press "Search"
- Then I should see "Author" within ".search-article-author"
- Then I should see "Joao Silva" within ".search-article-author-name"
+ Then I should see "Profile" within ".search-article-profile"
+ Then I should see "Joao Silva" within ".search-article-profile-name"
When I follow "Joao Silva"
Then I should be on joaosilva's profile
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ce3eef545ccdf39a7324ad6c1fd4275056e31360...323ed78a94fb4e10c4d35233fcf5f8e3640207fa
---
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/ce3eef545ccdf39a7324ad6c1fd4275056e31360...323ed78a94fb4e10c4d35233fcf5f8e3640207fa
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180301/3aeed359/attachment-0001.html>
More information about the Noosfero-dev
mailing list