refinerycms-news 0.9.9.6 → 1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/admin/news_items/index.html.erb +2 -2
- data/app/views/news_items/_recent_posts.html.erb +10 -8
- data/app/views/news_items/index.html.erb +9 -7
- data/app/views/news_items/show.html.erb +9 -7
- data/config/locales/de.yml +36 -0
- data/config/locales/nl.yml +22 -19
- data/lib/generators/refinerycms_news_generator.rb +6 -4
- data/lib/news.rb +1 -1
- data/readme.md +10 -1
- data/spec/models/news_item_spec.rb +2 -2
- metadata +4 -9
@@ -13,11 +13,11 @@
|
|
13
13
|
<h2><%= t('shared.admin.search.results_for', :query => params[:search]) %></h2>
|
14
14
|
<% end %>
|
15
15
|
<% if @news_items.any? %>
|
16
|
-
<%= will_paginate @news_items
|
16
|
+
<%= will_paginate @news_items %>
|
17
17
|
<ul>
|
18
18
|
<%= render :partial => "news_item", :collection => @news_items %>
|
19
19
|
</ul>
|
20
|
-
<%= will_paginate @news_items
|
20
|
+
<%= will_paginate @news_items %>
|
21
21
|
<% else %>
|
22
22
|
<p>
|
23
23
|
<% unless searching? %>
|
@@ -1,8 +1,10 @@
|
|
1
|
-
<
|
2
|
-
<
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
1
|
+
<nav id="recent_news_items">
|
2
|
+
<h2><%= t('.recent_posts') %></h2>
|
3
|
+
<ul>
|
4
|
+
<% @news_items.each do |item| %>
|
5
|
+
<li>
|
6
|
+
<%= link_to item.title, news_item_url(item) %>
|
7
|
+
</li>
|
8
|
+
<% end %>
|
9
|
+
</ul>
|
10
|
+
</nav>
|
@@ -7,13 +7,15 @@
|
|
7
7
|
|
8
8
|
<% if @news_items.any? %>
|
9
9
|
<% @news_items.each do |item| %>
|
10
|
-
<
|
11
|
-
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
10
|
+
<article class="news_item_truncated">
|
11
|
+
<h3><%= link_to item.title, news_item_url(item) %></h3>
|
12
|
+
<p>
|
13
|
+
<small><%= t('.published') %> <%= l(item.publish_date, :format => :long) %></small>
|
14
|
+
</p>
|
15
|
+
<%= truncate item.body, :length => 200,
|
16
|
+
:omission => " ... #{link_to t('.read_more'), news_item_url(item)}",
|
17
|
+
:preserve_html_tags => true %>
|
18
|
+
</article>
|
17
19
|
<% end %>
|
18
20
|
|
19
21
|
<%= will_paginate(@news_items) %>
|
@@ -1,12 +1,14 @@
|
|
1
1
|
<% content_for :body_content_title, @news_item.title %>
|
2
2
|
<% content_for :body_content_left do %>
|
3
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
<article class="news_item">
|
4
|
+
<p>
|
5
|
+
<small><%= t('.published') %> <%= l(@news_item.publish_date, :format => :long) %></small>
|
6
|
+
</p>
|
7
|
+
<%= @news_item.body.html_safe %>
|
8
|
+
<p>
|
9
|
+
<%= link_to t('.back_to_index'), news_items_url %>
|
10
|
+
</p>
|
11
|
+
</article>
|
10
12
|
<% end %>
|
11
13
|
<% content_for :body_content_right, render(:partial => 'recent_posts') %>
|
12
14
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
de:
|
2
|
+
plugins:
|
3
|
+
refinerycms_news:
|
4
|
+
title: News
|
5
|
+
description: Bietet einen einfachen Newsbereich an
|
6
|
+
admin:
|
7
|
+
news_items:
|
8
|
+
news_item:
|
9
|
+
view_live_html: "Diesen News-Eintrag live anschauen <br/><em>(Öffnet sich in eine neuen Fenster)</em>"
|
10
|
+
edit: "Diesen News-Eintrag editieren"
|
11
|
+
delete: "Diesen News-Eintrag endgültig löschen"
|
12
|
+
published: Veröffentlicht
|
13
|
+
index:
|
14
|
+
actions: Actions
|
15
|
+
create: "News-Eintrag hinzufügen"
|
16
|
+
news_item: News
|
17
|
+
no_items: "Entschuldigung, es wurde nichts gefunden."
|
18
|
+
no_items_yet: 'Es sind keine News-Einträge vorhanden. Klick auf "News-Eintrag hinzufügen" um den ersten Eintrag zu machen.'
|
19
|
+
news_items:
|
20
|
+
show:
|
21
|
+
back_to_index: "Zurück zur Übersicht"
|
22
|
+
published: Veröffentlicht
|
23
|
+
recent_posts:
|
24
|
+
recent_posts: Aktuelle Einträge
|
25
|
+
index:
|
26
|
+
published: Veröffentlicht
|
27
|
+
read_more: Weiterlesen
|
28
|
+
no_items_yet: Zur Zeit gibt es keine News.
|
29
|
+
activerecord:
|
30
|
+
attributes:
|
31
|
+
news_item:
|
32
|
+
title: Titel
|
33
|
+
body: Inhalt
|
34
|
+
publish_date: Veröffentlichungsdatum
|
35
|
+
models:
|
36
|
+
news_item: News-Eintrag
|
data/config/locales/nl.yml
CHANGED
@@ -1,33 +1,36 @@
|
|
1
1
|
nl:
|
2
2
|
plugins:
|
3
|
-
|
3
|
+
refinerycms_news:
|
4
4
|
title: Nieuws
|
5
|
-
|
6
|
-
attributes:
|
7
|
-
news_item:
|
8
|
-
title: Titel
|
9
|
-
content: Inhoud
|
10
|
-
publish_date: Publiceer Datum
|
11
|
-
models:
|
12
|
-
news_item: Nieuws Item
|
5
|
+
description: Nieuwsberichten voor de op de site.
|
13
6
|
admin:
|
14
7
|
news_items:
|
15
8
|
news_item:
|
16
|
-
view_live_html: Bekijk dit bericht op de website.<br/><em>(opent in een nieuw venster.)</em>
|
17
|
-
edit: Bewerk dit bericht
|
18
|
-
delete: Verwijder dit bericht permanent
|
9
|
+
view_live_html: "Bekijk dit bericht op de website.<br/><em>(opent in een nieuw venster.)</em>"
|
10
|
+
edit: "Bewerk dit bericht"
|
11
|
+
delete: "Verwijder dit bericht permanent"
|
19
12
|
published: Gepubliceerd op
|
20
13
|
index:
|
21
|
-
|
22
|
-
|
14
|
+
actions: Acties
|
15
|
+
create: "Maak een nieuw nieuwsbericht"
|
16
|
+
news_item: Nieuws
|
17
|
+
no_items: "Sorry, geen nieuwsberichten gevonden."
|
18
|
+
no_items_yet: 'Er zijn nog geen nieuwsberichten. Klik op "Maak een nieuw niewsbericht" om het eerste bericht te maken.'
|
23
19
|
news_items:
|
20
|
+
show:
|
21
|
+
back_to_index: "Terug naar de andere berichten"
|
22
|
+
published: Gepubliceerd op
|
24
23
|
recent_posts:
|
25
24
|
recent_posts: Laatste nieuws item
|
26
25
|
index:
|
27
|
-
|
28
|
-
published: "Gepubliceerd op"
|
26
|
+
published: Gepubliceerd op
|
29
27
|
read_more: Lees meer
|
30
28
|
no_items_yet: "Sorry, er zijn nog geen nieuwsberichten geplaatst."
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
activerecord:
|
30
|
+
attributes:
|
31
|
+
news_item:
|
32
|
+
title: Titel
|
33
|
+
body: Inhoud
|
34
|
+
publish_date: Publiceer datum
|
35
|
+
models:
|
36
|
+
news_item: Nieuws Item
|
@@ -15,10 +15,12 @@ class RefinerycmsNewsGenerator < Rails::Generators::NamedBase
|
|
15
15
|
template('db/migrate/migration_number_create_singular_name.rb',
|
16
16
|
Rails.root.join("db/migrate/#{next_migration_number}_create_#{singular_name}.rb"))
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
18
|
+
unless self.behavior == :revoke
|
19
|
+
puts "------------------------"
|
20
|
+
puts "Now run:"
|
21
|
+
puts "rake db:migrate"
|
22
|
+
puts "------------------------"
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
data/lib/news.rb
CHANGED
data/readme.md
CHANGED
@@ -19,7 +19,7 @@ Key features:
|
|
19
19
|
|
20
20
|
Include the latest [gem](http://rubygems.org/gems/refinerycms-news) into your Refinery CMS application's Gemfile:
|
21
21
|
|
22
|
-
gem "refinerycms-news", '~> 0
|
22
|
+
gem "refinerycms-news", '~> 1.0'
|
23
23
|
|
24
24
|
Then type the following at command line inside your Refinery CMS application's root directory:
|
25
25
|
|
@@ -27,6 +27,15 @@ Then type the following at command line inside your Refinery CMS application's r
|
|
27
27
|
rails generate refinerycms_news
|
28
28
|
rake db:migrate
|
29
29
|
|
30
|
+
## Customising the views
|
31
|
+
|
32
|
+
Type this command at your project root to override the default front end views:
|
33
|
+
|
34
|
+
$ rake refinery:override view=news_items/*
|
35
|
+
Copied view template file to app/views/news_items/_recent_posts.html.erb
|
36
|
+
Copied view template file to app/views/news_items/index.html.erb
|
37
|
+
Copied view template file to app/views/news_items/show.html.erb
|
38
|
+
|
30
39
|
## RSS (Really Simple Syndication)
|
31
40
|
|
32
41
|
To get RSS for your entire site, insert this into the head section of your layout after installing:
|
@@ -56,12 +56,12 @@ describe NewsItem do
|
|
56
56
|
5.times { Factory(:news_item, :publish_date => Time.now + 1.hour) }
|
57
57
|
NewsItem.latest.count.should == 5
|
58
58
|
7.times { Factory(:news_item) }
|
59
|
-
NewsItem.latest.
|
59
|
+
NewsItem.latest.length.should == 10
|
60
60
|
end
|
61
61
|
|
62
62
|
it "returns latest n news items" do
|
63
63
|
4.times { Factory(:news_item) }
|
64
|
-
NewsItem.latest(3).
|
64
|
+
NewsItem.latest(3).length.should == 3
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
metadata
CHANGED
@@ -1,14 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-news
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 47
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
6
|
+
- 1
|
7
7
|
- 0
|
8
|
-
|
9
|
-
- 9
|
10
|
-
- 6
|
11
|
-
version: 0.9.9.6
|
8
|
+
version: "1.0"
|
12
9
|
platform: ruby
|
13
10
|
authors:
|
14
11
|
- Resolve Digital
|
@@ -16,7 +13,7 @@ autorequire:
|
|
16
13
|
bindir: bin
|
17
14
|
cert_chain: []
|
18
15
|
|
19
|
-
date: 2010-
|
16
|
+
date: 2010-12-31 00:00:00 +13:00
|
20
17
|
default_executable:
|
21
18
|
dependencies:
|
22
19
|
- !ruby/object:Gem::Dependency
|
@@ -27,7 +24,6 @@ dependencies:
|
|
27
24
|
requirements:
|
28
25
|
- - ~>
|
29
26
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 43
|
31
27
|
segments:
|
32
28
|
- 0
|
33
29
|
- 9
|
@@ -56,6 +52,7 @@ files:
|
|
56
52
|
- app/views/news_items/index.html.erb
|
57
53
|
- app/views/news_items/index.rss.builder
|
58
54
|
- app/views/news_items/show.html.erb
|
55
|
+
- config/locales/de.yml
|
59
56
|
- config/locales/en.yml
|
60
57
|
- config/locales/es-MX.yml
|
61
58
|
- config/locales/es.yml
|
@@ -96,7 +93,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
96
93
|
requirements:
|
97
94
|
- - ">="
|
98
95
|
- !ruby/object:Gem::Version
|
99
|
-
hash: 3
|
100
96
|
segments:
|
101
97
|
- 0
|
102
98
|
version: "0"
|
@@ -105,7 +101,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
101
|
requirements:
|
106
102
|
- - ">="
|
107
103
|
- !ruby/object:Gem::Version
|
108
|
-
hash: 3
|
109
104
|
segments:
|
110
105
|
- 0
|
111
106
|
version: "0"
|