refinerycms-news 0.9.7 → 0.9.7.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@ class NewsItemsController < ApplicationController
6
6
  protected
7
7
 
8
8
  def find_latest_news_items
9
- @news_items = NewsItem.latest # 10 items
9
+ @news_items = NewsItem.latest.paginate(:page => params[:page]) # 10 items
10
10
  end
11
11
 
12
12
  def find_news_item
@@ -1,5 +1,5 @@
1
1
  <% content_for :body_content_left do %>
2
- <%= @page[:body] %>
2
+ <%= @page[:body] if @news_items.offset == 0 %>
3
3
 
4
4
  <% if @news_items.any? %>
5
5
  <% @news_items.each do |item| %>
@@ -9,9 +9,10 @@
9
9
  </p>
10
10
  <%= truncate(item.body, :length => 200, :omission => " ... #{link_to "Read more", news_item_url(item)}", :preserve_html_tags => true) %>
11
11
  <% end %>
12
+ <%= will_paginate(@news_items) %>
12
13
  <% else %>
13
14
  <p><em>Sorry we haven't posted up any news yet.</em></p>
14
15
  <% end %>
15
16
  <% end %>
16
-
17
+ <% content_for :body_content_right, "&nbsp;" if @news_items.offset > 0 -%>
17
18
  <%= render :partial => "/shared/content_page" %>
metadata CHANGED
@@ -6,7 +6,8 @@ version: !ruby/object:Gem::Version
6
6
  - 0
7
7
  - 9
8
8
  - 7
9
- version: 0.9.7
9
+ - 1
10
+ version: 0.9.7.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Resolve Digital
@@ -16,10 +17,23 @@ autorequire:
16
17
  bindir: bin
17
18
  cert_chain: []
18
19
 
19
- date: 2010-03-12 00:00:00 +13:00
20
+ date: 2010-05-01 00:00:00 +12:00
20
21
  default_executable:
21
- dependencies: []
22
-
22
+ dependencies:
23
+ - !ruby/object:Gem::Dependency
24
+ name: will_paginate
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - ">="
29
+ - !ruby/object:Gem::Version
30
+ segments:
31
+ - 2
32
+ - 3
33
+ - 11
34
+ version: 2.3.11
35
+ type: :runtime
36
+ version_requirements: *id001
23
37
  description: A really straightforward open source Ruby on Rails news plugin designed for integration with RefineryCMS.
24
38
  email: info@refinerycms.com
25
39
  executables: []
@@ -46,7 +60,6 @@ files:
46
60
  - generators/news/news_generator.rb
47
61
  - generators/news/templates/migration.rb
48
62
  - lib/news.rb
49
- - news.md
50
63
  - rails/init.rb
51
64
  has_rdoc: true
52
65
  homepage: http://refinerycms.com
data/news.md DELETED
@@ -1,23 +0,0 @@
1
- # News
2
-
3
- ![Refinery News](http://refinerycms.com/system/images/0000/0646/news.png)
4
-
5
- ## About
6
-
7
- __Refinery's news plugin allows you to post updates to the news section of your website.__
8
-
9
- Key features:
10
-
11
- * Default news page shows a summary of recent news posts
12
- * Detail view shows the full post and also linked to recent news on the "side bar"
13
-
14
- ## But I don't want a News Section, how do I kill it?
15
-
16
- Your news section loads because you have a page in your site that is told to not just render a normal page, but load the news section instead.
17
-
18
- By default this page is called "News". Go to your "Pages" tab in the Refinery admin area and click the edit icon on "News". Now click on "Hide/Show Advanced Options" and you'll see that a "Custom URL" is set to ``/news``. Simply change this to nothing, or delete the "News" page.
19
-
20
- You might also want to remove the News plugin from your backend view. To do that, you go to the "Users" tab in the Refinery admin area, edit your user, uncheck "News" from the list of plugins you can access.
21
-
22
- To get RSS for your entire site, insert this into the head section of your layout after installing:
23
- <%= auto_discovery_link_tag(:rss, news_items_url(:format => 'rss')) %>