ecm_news2 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 92117ec33a4996ea9fd8f734fc64fc37cdfc5c33
4
- data.tar.gz: 15df3bdbade4410589f2cce1ed29eda1fafeb480
3
+ metadata.gz: bfe2bb061335bad29daf124507abd7962c932da8
4
+ data.tar.gz: 1916f68d81c518a486e9681c1b87a25fe107ae26
5
5
  SHA512:
6
- metadata.gz: 9176da2d8544f1d4df6de194dbb1e0108c63aef136b666ad8e6dc234a4ff24112ae99aae0935786c2eedb30c1178eb5b7e386f392ded5cd2bd1bbf65bcd3f9bd
7
- data.tar.gz: f6de96a1bf4e47e1dad03fa07cd69ebc48b0f8efe512d319a6431515b62d03755f2faca6bae8f5a5d54cb4d64058223f03ff2beb4397aacde237ba076133dabe
6
+ metadata.gz: a6de097f72f00b3ab82dcad0fddab798ac2a4fa580aa8bd597012a0d729d35a09262aca9e4e810134262c8cc693263f688c5af3147afebbe6589e386b7d68122
7
+ data.tar.gz: 0ef53e73917cd56301c47d07c9b7147c533a3d648ac1ec0fc280383ecaffc78b01c03892ad47c3c7d1baba734fdf656b1418bba0fdf588991231d43253490a9e
@@ -1,6 +1,5 @@
1
1
  module Ecm::NewsHelper
2
- def render_news(count = nil)
3
- count = count ||= Ecm::News::Configuration.render_news_default_count
2
+ def render_news(count = Ecm::News::Configuration.render_news_default_count)
4
3
  items = Ecm::News::Item.published.where(:locale => I18n.locale.to_s).order("published_at DESC").limit(count)
5
4
  return I18n.t('ecm.news.item.messages.empty') if items.empty?
6
5
  output = ''
@@ -1,2 +1,2 @@
1
- <%= link_to(ecm_news_items_path, :class => 'btn list-link') do %><i class="icon-list"></i>&nbsp;<%= I18n.t('ecm.news.item.actions.all') %><% end %>
1
+ <%= link_to(t('ecm.news.item.actions.all'), ecm_news_items_path, :class => 'btn btn-default list-link') %>
2
2
 
@@ -1,9 +1,14 @@
1
1
  <div class="news-item show">
2
2
  <h1><%= item.title %></h1>
3
- <small class="item-published_at"><%= I18n.l(item.published_at) %></small>
3
+
4
+ <% if Ecm::News::Configuration.show_publish_time %>
5
+ <small class="item-published_at"><%= I18n.l(item.published_at) %></small>
6
+ <% end %>
7
+
4
8
  <% if item.preview_picture.present? %>
5
9
  <img class="img-responsive" src="<%= item.preview_picture.image.url %>" alt="...">
6
10
  <% end %>
7
- <p class="item-body"><%= mu(item, :body) %></p>
11
+
12
+ <div class="item-body"><%= mu(item, :body) %></div>
8
13
  </div>
9
14
 
@@ -1,8 +1,12 @@
1
1
  <div class="news-item small-preview">
2
- <h2 class="item-title"><%= item.title %></h2>
3
- <small class="item-published_at"><%= I18n.l(item.published_at) %></small>
4
- <p class="item-body"><%= truncate(mu(item, :body), :length => Ecm::News::Configuration.news_item_preview_length, :separator => ' ').html_safe %></p>
5
- <%= link_to(item, :class => 'btn more-link') do %><i class="icon-arrow-right"></i> <%= I18n.t('ecm.news.item.actions.more') %><% end %>
6
- <hr />
2
+ <h4 class="item-title"><%= item.title %></h4>
3
+ <% if Ecm::News::Configuration.show_publish_time %>
4
+ <small class="item-published_at"><%= I18n.l(item.published_at) %></small>
5
+ <% end %>
6
+ <div class="item-body truncate lines-<%= Ecm::News::Configuration.news_item_preview_lines %> bottom-margin-2"><%= mu(item, :body) %></div>
7
+
8
+ <div class="item-actions bottom-margin-2">
9
+ <%= link_to(t('ecm.news.item.actions.more'), item, :class => 'btn btn-primary btn-xs more-link') %>
10
+ </div>
7
11
  </div>
8
12
 
@@ -10,7 +10,7 @@
10
10
  </div>
11
11
  <div class="media-body">
12
12
  <h4 class="media-heading"><%= item.title %></h4>
13
- <div class="news-body truncate lines-3 bottom-margin-1">
13
+ <div class="news-body truncate lines-<%= Ecm::News::Configuration.news_item_preview_lines %> bottom-margin-1">
14
14
  <%= mu(item, :body) %>
15
15
  </div>
16
16
  <div class="object-actions">
@@ -14,17 +14,21 @@ module Ecm
14
14
  end
15
15
 
16
16
  mattr_accessor :markup_languages do
17
- []
17
+ ['textile']
18
18
  end
19
19
 
20
- mattr_accessor :news_item_preview_length do
21
- 250
20
+ mattr_accessor :news_item_preview_lines do
21
+ 3
22
22
  end
23
23
 
24
24
  mattr_accessor :render_news_default_count do
25
25
  2
26
26
  end
27
27
 
28
+ mattr_accessor :show_publish_time do
29
+ true
30
+ end
31
+
28
32
  mattr_accessor :base_controller do
29
33
  'ApplicationController'
30
34
  end
@@ -1,6 +1,6 @@
1
1
  module Ecm
2
2
  module News
3
- VERSION = "1.0.0"
3
+ VERSION = "1.0.2"
4
4
  end
5
5
  end
6
6
 
data/lib/ecm_news2.rb CHANGED
@@ -3,6 +3,7 @@ require 'acts_as_published'
3
3
  require 'friendly_id'
4
4
  require 'kaminari'
5
5
  require 'bootstrap-kaminari-views'
6
+ require 'ecm_pictures2'
6
7
 
7
8
  require 'ecm/news/engine'
8
9
  require 'ecm/news/configuration'
@@ -1,8 +1,8 @@
1
1
  Ecm::News.configure do |config|
2
- # Number of characters to render in news preview
2
+ # Number of lines to render in news preview
3
3
  #
4
- # default: config.news_preview_length = 250
5
- config.news_item_preview_length = 250
4
+ # default: config.news_item_preview_lines = 3
5
+ config.news_item_preview_lines = 3
6
6
 
7
7
  # Number of items that will be shown in #render_news
8
8
  #
@@ -11,14 +11,19 @@ Ecm::News.configure do |config|
11
11
 
12
12
  # Accepted markup languages
13
13
  #
14
- # default: config.markup_languages = %w[ markdown rdoc textile ]
15
- config.markup_languages = %w[ markdown rdoc textile ]
14
+ # default: config.markup_languages = %w[ textile ]
15
+ config.markup_languages = %w[ textile ]
16
16
 
17
17
  # Default markup language
18
18
  #
19
19
  # default: config.default_markup_language = 'textile'
20
20
  config.default_markup_language = 'textile'
21
21
 
22
+ # Show or hide the publishing time for news
23
+ #
24
+ # Default: config.show_publish_time = true
25
+ config.show_publish_time = true
26
+
22
27
  # Set the base controller for the contact form
23
28
  #
24
29
  # Default: config.base_controller = 'ApplicationController'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ecm_news2
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roberto Vasquez Angel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2015-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,20 +30,6 @@ dependencies:
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 5.0.0
33
- - !ruby/object:Gem::Dependency
34
- name: activeadmin
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: 1.0.0.pre2
40
- type: :runtime
41
- prerelease: false
42
- version_requirements: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: 1.0.0.pre2
47
33
  - !ruby/object:Gem::Dependency
48
34
  name: acts_as_markup
49
35
  requirement: !ruby/object:Gem::Requirement
@@ -212,6 +198,20 @@ dependencies:
212
198
  - - ">="
213
199
  - !ruby/object:Gem::Version
214
200
  version: '0'
201
+ - !ruby/object:Gem::Dependency
202
+ name: activeadmin
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - "~>"
206
+ - !ruby/object:Gem::Version
207
+ version: 1.0.0.pre2
208
+ type: :development
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - "~>"
213
+ - !ruby/object:Gem::Version
214
+ version: 1.0.0.pre2
215
215
  - !ruby/object:Gem::Dependency
216
216
  name: coffee-rails
217
217
  requirement: !ruby/object:Gem::Requirement