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 +4 -4
- data/app/helpers/ecm/news_helper.rb +1 -2
- data/app/views/ecm/news/_render_news_footer.html.erb +1 -1
- data/app/views/ecm/news/items/_item.html.erb +7 -2
- data/app/views/ecm/news/items/_item_for_render_news.html.erb +9 -5
- data/app/views/ecm/news/items/_item_in_list.html.erb +1 -1
- data/lib/ecm/news/configuration.rb +7 -3
- data/lib/ecm/news/version.rb +1 -1
- data/lib/ecm_news2.rb +1 -0
- data/lib/generators/ecm/news/install/templates/ecm_news.rb +10 -5
- metadata +16 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfe2bb061335bad29daf124507abd7962c932da8
|
4
|
+
data.tar.gz: 1916f68d81c518a486e9681c1b87a25fe107ae26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6de097f72f00b3ab82dcad0fddab798ac2a4fa580aa8bd597012a0d729d35a09262aca9e4e810134262c8cc693263f688c5af3147afebbe6589e386b7d68122
|
7
|
+
data.tar.gz: 0ef53e73917cd56301c47d07c9b7147c533a3d648ac1ec0fc280383ecaffc78b01c03892ad47c3c7d1baba734fdf656b1418bba0fdf588991231d43253490a9e
|
@@ -1,6 +1,5 @@
|
|
1
1
|
module Ecm::NewsHelper
|
2
|
-
def render_news(count =
|
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')
|
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
|
-
|
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
|
-
|
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
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
<
|
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
|
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 :
|
21
|
-
|
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
|
data/lib/ecm/news/version.rb
CHANGED
data/lib/ecm_news2.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
Ecm::News.configure do |config|
|
2
|
-
# Number of
|
2
|
+
# Number of lines to render in news preview
|
3
3
|
#
|
4
|
-
# default: config.
|
5
|
-
config.
|
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[
|
15
|
-
config.markup_languages = %w[
|
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.
|
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-
|
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
|