Commit 91261f4b752c3f73289500957e8a5f90fd0437d4

Authored by Antonio Terceiro
2 parents 6ddf4a29 52477c2c

Merge branch 'some-bug-fixes' into 'master'

Some bug fixes for Noosfero 1.3

This merge request contains a few bug fixes that were reported during pre release testing of Noosfero 1.3. See commits for reference of issues.

See merge request !716
app/controllers/my_profile/cms_controller.rb
... ... @@ -27,7 +27,7 @@ class CmsController < MyProfileController
27 27  
28 28 helper_method :file_types
29 29  
30   - protect_if :except => [:suggest_an_article, :set_home_page, :edit, :destroy, :publish, :upload_files, :new] do |c, user, profile|
  30 + protect_if :except => [:suggest_an_article, :set_home_page, :edit, :destroy, :publish, :publish_on_portal_community, :publish_on_communities, :search_communities_to_publish, :upload_files, :new] do |c, user, profile|
31 31 user && (user.has_permission?('post_content', profile) || user.has_permission?('publish_content', profile))
32 32 end
33 33  
... ... @@ -288,7 +288,7 @@ class CmsController < MyProfileController
288 288 task.cancel
289 289 end
290 290 if @failed.blank?
291   - session[:notice] = _("Your publish request was sent successfully")
  291 + session[:notice] = _("You published this content successfully")
292 292 if @back_to
293 293 redirect_to @back_to
294 294 else
... ...
app/helpers/action_tracker_helper.rb
... ... @@ -67,19 +67,19 @@ module ActionTrackerHelper
67 67 }
68 68 end
69 69  
70   - def create_product_description
  70 + def create_product_description ta
71 71 _('created the product %{title}') % {
72 72 title: link_to(truncate(ta.get_name), ta.get_url),
73 73 }
74 74 end
75 75  
76   - def update_product_description
  76 + def update_product_description ta
77 77 _('updated the product %{title}') % {
78 78 title: link_to(truncate(ta.get_name), ta.get_url),
79 79 }
80 80 end
81 81  
82   - def remove_product_description
  82 + def remove_product_description ta
83 83 _('removed the product %{title}') % {
84 84 title: truncate(ta.get_name),
85 85 }
... ...
app/views/content_viewer/view_page.html.erb
... ... @@ -31,7 +31,7 @@
31 31 <% cache(@page.cache_key(params, user, language)) do %>
32 32 <div class="<%="article-body article-body-" + @page.css_class_name %>">
33 33 <% options = @page.image? ? {:gallery_view => true} : {} %>
34   - <% if @page.image.present? && !@page.event? %>
  34 + <% if @page.image.present? && !@page.event? && !@page.blog? %>
35 35 <div class="article-body-img">
36 36 <%= image_tag(@page.image.public_filename) %>
37 37 <p><%= @page.image.label%></p>
... ...
app/views/profile/_create_product.html.erb
... ... @@ -3,7 +3,7 @@
3 3 </div>
4 4 <div class='profile-activity-description'>
5 5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
6   - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p>
  6 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
7 7  
8 8 <div class='profile-wall-actions'>
9 9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
... ...
app/views/profile/_favorite_enterprise.html.erb
... ... @@ -5,7 +5,7 @@
5 5 <p class='profile-activity-text'>
6 6 <%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %>
7 7 </p>
8   - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p>
  8 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
9 9  
10 10 <div class='profile-wall-actions'>
11 11 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
... ...
app/views/profile/_remove_product.html.erb
... ... @@ -2,7 +2,7 @@
2 2 </div>
3 3 <div class='profile-activity-description'>
4 4 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
5   - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p>
  5 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
6 6  
7 7 <div class='profile-wall-actions'>
8 8 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
... ...
app/views/profile/_update_product.html.erb
... ... @@ -3,7 +3,7 @@
3 3 </div>
4 4 <div class='profile-activity-description'>
5 5 <p class='profile-activity-text'><%= link_to activity.user.short_name(nil), activity.user.url %> <%= describe activity %></p>
6   - <p class='profile-activity-time'><%= time_ago_as_sentence activity.created_at %></p>
  6 + <p class='profile-activity-time'><%= time_ago_in_words activity.created_at %></p>
7 7  
8 8 <div class='profile-wall-actions'>
9 9 <%= link_to_function(_('Remove'), 'remove_item_wall(this, \'%s\', \'%s\', \'%s\'); return false ;' % [".profile-activity-item", url_for(:profile => params[:profile], :action => :remove_activity, :activity_id => activity.id, :view => params[:view]), _('Are you sure you want to remove this activity and all its replies?')]) if logged_in? && current_person == @profile %>
... ...
po/pt/noosfero.po
... ... @@ -8888,7 +8888,7 @@ msgstr &quot;Sua entrada está esperando aprovação&quot;
8888 8888 #: app/views/blocks/profile_info_actions/_join_leave_community.html.erb:14
8889 8889 #: app/views/blocks/profile_info_actions/_join_leave_community.html.erb:18
8890 8890 msgid "Join this community"
8891   -msgstr "Entrar nesta comunidade"
  8891 +msgstr "Entrar na comunidade"
8892 8892  
8893 8893 #: app/views/blocks/profile_info_actions/_join_leave_community.html.erb:23
8894 8894 msgid "Please confirm to leave the community '%{name}'"
... ...
public/designs/themes/base/style.scss
... ... @@ -642,7 +642,6 @@ div#notice {
642 642 border-radius-topright: 0px;
643 643 border-radius-bottomright: 0px;
644 644 background-color: #cecece;
645   - width: 100%;
646 645 border-right: 2px solid #555753;
647 646 }
648 647  
... ...
test/functional/content_viewer_controller_test.rb
... ... @@ -1616,4 +1616,14 @@ class ContentViewerControllerTest &lt; ActionController::TestCase
1616 1616 page.reload
1617 1617 assert_equal 1, page.hits
1618 1618 end
  1619 +
  1620 + should 'show blog image only inside blog cover' do
  1621 + blog = create(Blog, :profile_id => profile.id, :name=>'testblog', :image_builder => { :uploaded_data => fixture_file_upload('/files/rails.png', 'image/png')})
  1622 + blog.save!
  1623 + get :view_page, :profile => profile.identifier, :page => [blog.path]
  1624 +
  1625 + assert_select '.blog-cover > img', 1
  1626 + assert_select '.article-body-img > img', 0
  1627 + end
  1628 +
1619 1629 end
... ...