[Git][noosfero/noosfero][stable-1.5] 2 commits: Fixes pluralization of search results string
Rodrigo Souto
gitlab at mg.gitlab.com
Mon May 23 09:43:05 BRT 2016
Rodrigo Souto pushed to branch stable-1.5 at Noosfero / noosfero
Commits:
2062e988 by Larissa Reis at 2016-05-23T09:29:56-03:00
Fixes pluralization of search results string
- - - - -
da418309 by Larissa Reis at 2016-05-23T09:41:29-03:00
follow-articles: sets profile on url to avoid route no match
For profiles with own domain sometimes there is no profile set, so we
have to give a profile on url generation to avoid breakage here.
- - - - -
3 changed files:
- app/helpers/article_helper.rb
- app/views/profile_search/_results_list.html.erb
- app/views/search/_search_content.html.erb
Changes:
=====================================
app/helpers/article_helper.rb
=====================================
--- a/app/helpers/article_helper.rb
+++ b/app/helpers/article_helper.rb
@@ -174,9 +174,9 @@ module ArticleHelper
def following_button(page, user)
if !user.blank? and user != page.author
if page.is_followed_by? user
- button :cancel, unfollow_button_text(page), {:controller => 'profile', :action => 'unfollow_article', :article_id => page.id}
+ button :cancel, unfollow_button_text(page), {:controller => 'profile', :profile => page.profile.identifier, :action => 'unfollow_article', :article_id => page.id, :profile => page.profile.identifier}
else
- button :add, follow_button_text(page), {:controller => 'profile', :action => 'follow_article', :article_id => page.id}
+ button :add, follow_button_text(page), {:controller => 'profile', :profile => page.profile.identifier, :action => 'follow_article', :article_id => page.id, :profile => page.profile.identifier}
end
end
end
=====================================
app/views/profile_search/_results_list.html.erb
=====================================
--- a/app/views/profile_search/_results_list.html.erb
+++ b/app/views/profile_search/_results_list.html.erb
@@ -1,7 +1,7 @@
<div id='search-content'>
<% if @results %>
<div class='results-found-message'>
- <%= _("%s results found") % @results.total_entries %>
+ <%= n_("%s result found", "%s results found", @results.total_entries) % @results.total_entries %>
</div>
<ul class='results-list'>
=====================================
app/views/search/_search_content.html.erb
=====================================
--- a/app/views/search/_search_content.html.erb
+++ b/app/views/search/_search_content.html.erb
@@ -1,6 +1,6 @@
<div id='search-content'>
<div class='total'>
- <%= _('Total of %s results ') % @searches[@asset][:results].total_entries.inspect %>
+ <%= n_('Total of 1 result', 'Total of %s results', @searches[@asset][:results].total_entries) % @searches[@asset][:results].total_entries.inspect %>
</div>
<%= display_results(@searches, @asset) %>
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/19eca0b5cd295ea6781581bd39787a0a5835b982...da41830995808fc9eacdccee692e7c36074d0f1c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20160523/c933b57a/attachment-0001.html>
More information about the Noosfero-dev
mailing list