Commit 1241aa31b9aeac9a999c7750806da0c882b4af50
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Merge branch 'stable' of gitlab.com:participa/noosfero into stable
Showing
3 changed files
with
20 additions
and
8 deletions
Show diff stats
app/helpers/layout_helper.rb
@@ -2,6 +2,7 @@ module LayoutHelper | @@ -2,6 +2,7 @@ module LayoutHelper | ||
2 | 2 | ||
3 | def body_classes | 3 | def body_classes |
4 | # Identify the current controller and action for the CSS: | 4 | # Identify the current controller and action for the CSS: |
5 | + (logged_in? ? " logged-in" : "") + | ||
5 | " controller-#{controller.controller_name}" + | 6 | " controller-#{controller.controller_name}" + |
6 | " action-#{controller.controller_name}-#{controller.action_name}" + | 7 | " action-#{controller.controller_name}-#{controller.action_name}" + |
7 | " template-#{@layout_template || if profile.blank? then 'default' else profile.layout_template end}" + | 8 | " template-#{@layout_template || if profile.blank? then 'default' else profile.layout_template end}" + |
plugins/virtuoso/lib/virtuoso_plugin/noosfero_harvest.rb
@@ -148,15 +148,9 @@ class VirtuosoPlugin::NoosferoHarvest | @@ -148,15 +148,9 @@ class VirtuosoPlugin::NoosferoHarvest | ||
148 | 148 | ||
149 | def process_value(value) | 149 | def process_value(value) |
150 | if value.kind_of?(String) | 150 | if value.kind_of?(String) |
151 | - value = /https?:\/\//.match(value) ? RDF::URI.new(value) : strip_tags(value) | ||
152 | - elsif value.kind_of?(ActiveSupport::TimeWithZone) | ||
153 | - value = RDF::Literal::DateTime.new(value) | ||
154 | - elsif !!value == value | ||
155 | - value = RDF::Literal::Boolean.new(value) | ||
156 | - elsif value.kind_of?(Float) | ||
157 | - value = RDF::Literal::Double.new(value) | 151 | + value = /^https?:\/\//.match(value) ? RDF::URI.new(value) : RDF::Literal.new(strip_tags(value).delete("\n|\r")) |
158 | else | 152 | else |
159 | - value | 153 | + value = RDF::Literal.new(value) |
160 | end | 154 | end |
161 | end | 155 | end |
162 | 156 |
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +require File.dirname(__FILE__) + '/../test_helper' | ||
2 | + | ||
3 | +class LayoutHelperTest < ActionView::TestCase | ||
4 | + | ||
5 | + should 'append logged-in class in body when user is logged-in' do | ||
6 | + expects(:logged_in?).returns(true) | ||
7 | + expects(:profile).returns(nil).at_least_once | ||
8 | + assert_includes body_classes.split, 'logged-in' | ||
9 | + end | ||
10 | + | ||
11 | + should 'not append logged-in class when user is not logged-in' do | ||
12 | + expects(:logged_in?).returns(false) | ||
13 | + expects(:profile).returns(nil).at_least_once | ||
14 | + assert_not_includes body_classes.split, 'logged-in' | ||
15 | + end | ||
16 | + | ||
17 | +end |