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.
@@ -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, :previous_label => '&laquo;', :next_label => '&raquo;' %>
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, :previous_label => '&laquo;', :next_label => '&raquo;' %>
20
+ <%= will_paginate @news_items %>
21
21
  <% else %>
22
22
  <p>
23
23
  <% unless searching? %>
@@ -1,8 +1,10 @@
1
- <h2><%= t('.recent_posts') %></h2>
2
- <ul>
3
- <% @news_items.each do |item| %>
4
- <li>
5
- <%= link_to item.title, news_item_url(item) %>
6
- </li>
7
- <% end %>
8
- </ul>
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
- <h3><%= link_to item.title, news_item_url(item) %></h3>
11
- <p>
12
- <small><%= t('.published') %> <%= l(item.publish_date, :format => :long) %></small>
13
- </p>
14
- <%= truncate item.body, :length => 200,
15
- :omission => " ... #{link_to t('.read_more'), news_item_url(item)}",
16
- :preserve_html_tags => true %>
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
- <p>
4
- <small><%= t('.published') %> <%= l(@news_item.publish_date, :format => :long) %></small>
5
- </p>
6
- <%= @news_item.body.html_safe %>
7
- <p>
8
- <%= link_to t('.back_to_index'), news_items_url %>
9
- </p>
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
@@ -1,33 +1,36 @@
1
1
  nl:
2
2
  plugins:
3
- news:
3
+ refinerycms_news:
4
4
  title: Nieuws
5
- activerecord:
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
- create: Maak een nieuw nieuwsbericht
22
- no_items_yet: Er zijn nog geen nieuwsberichten. Klik op "Maak een nieuw niewsbericht" om het eerste bericht te maken.
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
- create: Maak Nieuws Item
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
- show:
32
- published: Gepubliceerd op
33
- back_to_index: Terug naar de andere berichten
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
- puts "------------------------"
19
- puts "Now run:"
20
- puts "rake db:migrate"
21
- puts "------------------------"
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
@@ -2,7 +2,7 @@ module Refinery
2
2
  module News
3
3
  class << self
4
4
  def version
5
- %q{0.9.9.6}
5
+ %q{1.0}
6
6
  end
7
7
  end
8
8
  end
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.9.9'
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.count.should == 10
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).count.should == 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
- - 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-11-11 00:00:00 +13:00
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"