ecm_news2 1.1.1 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92b241b146a78bfde99087aab42584c428943db7
4
- data.tar.gz: 995b0ea481f246102d38753dd9bd2c484e0c2e10
3
+ metadata.gz: 55156b8ab312c5b1073d803a41291663dc6e1758
4
+ data.tar.gz: 5c8bd5cbc671ecc02517b93791509fc6c85a8886
5
5
  SHA512:
6
- metadata.gz: 198655848fed40666c6d6dd7909cd51922336ad28f8c5b3d11cc1d2408397e805f6a76d2763bc9b07d08e5268c25db6c61f73c75abac003ce533fa762736d2d2
7
- data.tar.gz: cc66326f492b58f47c2b1cddea99e5d3d940a2ff202815760d9bfc51f1a3a453d0f9282f4f49c646474862ced9c312de779ffc9bbd44c915ae5f24f4208de63a
6
+ metadata.gz: 9789618fe8818ef30ae21fe7e7615ca31cb3041c357195891a2f03dff7900369881bb6c72bc64f60141840a7f82fb6870696b819a508272afb0d6f3e601fe85d
7
+ data.tar.gz: 20158d07159968299aaaf49e7e4c5f3c81421f7e89d929663698e1f3eeb688cce0b4265ebdfb24feffb7bf046b762e9f9b418d3cd9753fb8755200e8cec97184
@@ -1,11 +1,14 @@
1
1
  module Ecm::NewsHelper
2
2
  def render_news(count = Ecm::News::Configuration.render_news_default_count)
3
3
  items = Ecm::News::Item.published.where(:locale => I18n.locale.to_s).order("published_at DESC").limit(count)
4
+
4
5
  return I18n.t('ecm.news.item.messages.empty') if items.empty?
5
- output = ''
6
+
7
+ output = Ecm::News::Configuration.prevent_textile_rendering_in_html ? '<notextile>' : ''
6
8
  output << render(:partial => 'ecm/news/items/item_for_render_news', :collection => items, :as => :item)
7
9
  output << render(:partial => 'ecm/news/render_news_footer')
8
- return output.html_safe
10
+ output << '</notextile>' if Ecm::News::Configuration.prevent_textile_rendering_in_html
11
+ output.html_safe
9
12
  end
10
13
  end
11
14
 
@@ -40,6 +40,10 @@ module Ecm
40
40
  mattr_accessor :base_controller do
41
41
  'ApplicationController'
42
42
  end
43
+
44
+ mattr_accessor :prevent_textile_rendering_in_html do
45
+ true
46
+ end
43
47
  end
44
48
  end
45
49
  end
@@ -1,6 +1,6 @@
1
1
  module Ecm
2
2
  module News
3
- VERSION = "1.1.1"
3
+ VERSION = "1.2.0"
4
4
  end
5
5
  end
6
6
 
@@ -41,5 +41,11 @@ Ecm::News.configure do |config|
41
41
  # Default: config.base_controller = 'ApplicationController'
42
42
  #
43
43
  config.base_controller = 'ApplicationController'
44
+
45
+ # Adds <notextile> tags around the to fix html output.
46
+ #
47
+ # Default: config.prevent_textile_rendering_in_html = true
48
+ #
49
+ config.prevent_textile_rendering_in_html = true
44
50
  end
45
51
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_news2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel