ecm_news 0.1.3.pre → 0.1.4.pre

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,13 +1,15 @@
1
1
  module Ecm::NewsHelper
2
- def render_news(count)
2
+ def render_news(count = nil)
3
+ count = count ||= Ecm::News::Configuration.render_news_default_count
3
4
  items = Ecm::News::Item.published.where(:locale => I18n.locale.to_s).limit(count)
4
5
  return I18n.t('ecm.news.item.messages.empty') if items.empty?
5
6
  output = ''
6
7
  output << render(:partial => 'ecm/news/items/item_preview', :collection => items, :as => :item)
7
8
  output << link_to(ecm_news_items_path, :class => 'btn list-link') do
8
- content_tag(:i, "", :class => 'icon-list') + " " +
9
+ content_tag(:i, "", :class => 'icon-list') + " " +
9
10
  I18n.t('ecm.news.item.actions.all')
10
11
  end
11
12
  return output.html_safe
12
13
  end
13
- end
14
+ end
15
+
@@ -4,9 +4,8 @@
4
4
 
5
5
  <p class="item-body"><%= truncate(mu(item, :body), :length => 250, :separator => ' ').html_safe %></p>
6
6
 
7
- <%= link_to(item, :class => 'btn more-link') do %>
8
- <i class="icon-arrow-right"></i>
9
- <%= I18n.t('ecm.news.item.actions.more') %>
10
- <% end %>
7
+
8
+ <%= link_to(item, :class => 'btn more-link') do %><i class="icon-arrow-right"></i><%= I18n.t('ecm.news.item.actions.more') %><% end %>
9
+
11
10
  <hr />
12
11
  </div>
@@ -9,8 +9,8 @@ module Ecm
9
9
  yield self
10
10
  end
11
11
 
12
- # mattr_accessor :foo
13
- # @@foo = nil
12
+ mattr_accessor :render_news_default_count
13
+ @@render_news_default_count = 2
14
14
  end
15
15
  end
16
16
  end
@@ -1,5 +1,5 @@
1
1
  module Ecm
2
2
  module News
3
- VERSION = "0.1.3.pre"
3
+ VERSION = "0.1.4.pre"
4
4
  end
5
5
  end
@@ -1,2 +1,4 @@
1
1
  Ecm::News.configure do |config|
2
+ # Number of items that will be shown in #render_news
3
+ config.render_news_default_count = 2
2
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_news
3
3
  version: !ruby/object:Gem::Version
4
- hash: 961915968
4
+ hash: 961915996
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
9
+ - 4
10
10
  - pre
11
- version: 0.1.3.pre
11
+ version: 0.1.4.pre
12
12
  platform: ruby
13
13
  authors:
14
14
  - Roberto Vasquez Angel
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-09-18 00:00:00 Z
19
+ date: 2012-10-01 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails