refinerycms-blog 1.0.rc11 → 1.0.rc13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -1 +1 @@
1
- gem 'filters_spam', '~> 0.2'
1
+ gem 'filters_spam', '~> 0.3'
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  GEM
2
2
  specs:
3
- filters_spam (0.2)
3
+ filters_spam (0.3)
4
4
 
5
5
  PLATFORMS
6
6
  ruby
7
7
 
8
8
  DEPENDENCIES
9
- filters_spam (~> 0.2)
9
+ filters_spam (~> 0.3)
@@ -2,7 +2,7 @@ class Admin::Blog::CommentsController < Admin::BaseController
2
2
 
3
3
  crudify :blog_comment,
4
4
  :title_attribute => :name,
5
- :order => 'created_at DESC'
5
+ :order => 'published_at DESC'
6
6
 
7
7
  def index
8
8
  @blog_comments = BlogComment.unmoderated
@@ -2,7 +2,7 @@ class Admin::Blog::PostsController < Admin::BaseController
2
2
 
3
3
  crudify :blog_post,
4
4
  :title_attribute => :title,
5
- :order => 'created_at DESC'
5
+ :order => 'published_at DESC'
6
6
 
7
7
  before_filter :find_all_categories,
8
8
  :only => [:new, :edit, :create, :update]
@@ -10,7 +10,7 @@ class BlogPost < ActiveRecord::Base
10
10
 
11
11
  has_friendly_id :title, :use_slug => true
12
12
 
13
- default_scope :order => "created_at DESC"
13
+ default_scope :order => "published_at DESC"
14
14
 
15
15
  if Rails.version < '3.0.0'
16
16
  named_scope :live, lambda { {:conditions => ["published_at < ? and draft = ?", Time.now, false]} }
@@ -2,9 +2,9 @@
2
2
 
3
3
  <% content_for :body_content_left do %>
4
4
  <% if @category.posts.any? %>
5
- <ul id="blog_posts">
5
+ <article id="blog_posts">
6
6
  <%= render :partial => "/blog/shared/post", :collection => @category.posts %>
7
- </ul>
7
+ </article>
8
8
  <% else %>
9
9
  <p>
10
10
  <%= t('.no_posts') %>
@@ -1,9 +1,11 @@
1
- <div class='blog_comment_message' id='<%= "comment-#{comment.to_param}" %>'>
1
+ <article class='blog_comment_message' id='<%= "comment-#{comment.to_param}" %>'>
2
2
  <p>
3
- <%= comment.message.to_s.gsub("\r\n\r\n", "</p><p>").gsub("\r\n", "<br/>") %>
3
+ <%= simple_format auto_link(comment.message.to_s) %>
4
4
  </p>
5
- </div>
6
- <p class='blog_comment_author'>
7
- <%= t('blog.posts.comments.by', :who => comment.name) %>,
8
- <%= t('blog.posts.comments.time_ago', :time => time_ago_in_words(comment.created_at)) %>
9
- </p>
5
+ <footer class='blog_comment_author'>
6
+ <p>
7
+ <%= t('blog.posts.comments.by', :who => comment.name) %>,
8
+ <%= t('blog.posts.comments.time_ago', :time => time_ago_in_words(comment.created_at)) %>
9
+ </p>
10
+ </footer>
11
+ </article>
@@ -1,9 +1,9 @@
1
1
  <% content_for :body_content_left do %>
2
2
  <%= @page[Page.default_parts.first.to_sym] %>
3
3
 
4
- <ul id="blog_posts">
4
+ <section id="blog_posts">
5
5
  <%= render :partial => "/blog/shared/post", :collection => @blog_posts %>
6
- </ul>
6
+ </section>
7
7
  <% end %>
8
8
 
9
9
  <% content_for :body_content_right do %>
@@ -9,7 +9,7 @@ xml.rss :version => "2.0" do
9
9
  xml.item do
10
10
  xml.title post.title
11
11
  xml.description post.body
12
- xml.pubDate post.created_at.to_s(:rfc822)
12
+ xml.pubDate post.published_at.to_s(:rfc822)
13
13
  xml.link blog_post_url(post)
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  <% content_for :head do %>
2
2
  <% if BlogPost::ShareThis.enabled? %>
3
- <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
4
- <script type="text/javascript">
3
+ <script src="http://w.sharethis.com/button/buttons.js"></script>
4
+ <script>
5
5
  stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});
6
6
  </script>
7
7
  <% end %>
@@ -10,68 +10,73 @@
10
10
  <% content_for :body_content_title, @blog_post.title %>
11
11
 
12
12
  <% content_for :body_content_left do %>
13
- <p class='posted_at'>
14
- <%= t('blog.shared.posts.created_at', :when => @blog_post.created_at.strftime('%d %B %Y')) %>.
13
+ <article id="show_blog_post">
14
+ <header>
15
+ <p class='posted_at'>
16
+ <%= t('blog.shared.posts.created_at', :when => @blog_post.published_at.strftime('%d %B %Y')) %>.
15
17
 
16
- <% if (categories = @blog_post.categories).any? %>
17
- <span class='filed_in'>
18
- <%= t('.filed_in') %>
19
- <% categories.each_with_index do |category, index| %>
20
- <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
18
+ <% if (categories = @blog_post.categories).any? %>
19
+ <span class='filed_in'>
20
+ <%= t('.filed_in') %>
21
+ <% categories.each_with_index do |category, index| %>
22
+ <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %>
23
+ <% end %>
24
+ </span>
21
25
  <% end %>
22
- </span>
23
- <% end %>
24
- </p>
25
- <%= @blog_post.body %>
26
-
27
- <% if BlogPost::ShareThis.enabled? %>
28
- <span class="st_sharethis" displayText="ShareThis"></span>
29
- <% end %>
30
-
31
- <% if BlogPost.comments_allowed? %>
32
- <h2><%= t('.comments.title') %></h2>
33
-
34
- <% if (comments = @blog_post.comments.approved).any? %>
35
- <%= render :partial => "comment", :collection => comments %>
36
- <% else %>
37
- <p>
38
- <%= t('blog.shared.comments.none') %>.
39
26
  </p>
40
- <% end %>
27
+ </header>
28
+ <%=raw @blog_post.body %>
41
29
 
42
- <% flash.each do |key, value| %>
43
- <div id='flash' class="flash flash_<%= key %>">
44
- <%= value %>
45
- </div>
30
+ <% if BlogPost::ShareThis.enabled? %>
31
+ <span class="st_sharethis" displayText="ShareThis"></span>
46
32
  <% end %>
47
-
48
- <h2><%= t('.comments.add') %></h2>
49
- <% form_for [:blog_post, @blog_comment] do |f| %>
50
- <% if Rails.version < '3.0.0'%>
51
- <%= f.error_messages %>
33
+ </article>
34
+ <% if BlogPost.comments_allowed? %>
35
+ <aside id="comments">
36
+ <h2><%= t('.comments.title') %></h2>
37
+
38
+ <% if (comments = @blog_post.comments.approved).any? %>
39
+ <%= render :partial => "comment", :collection => comments %>
52
40
  <% else %>
53
- <%= render :partial => "/shared/admin/error_messages",
54
- :locals => {
55
- :object => f.object,
56
- :include_object_name => true
57
- } %>
41
+ <p>
42
+ <%= t('blog.shared.comments.none') %>.
43
+ </p>
58
44
  <% end %>
59
- <div class='field'>
60
- <%= f.label :name %>
61
- <%= f.text_field :name %>
62
- </div>
63
- <div class='field'>
64
- <%= f.label :email %>
65
- <%= f.text_field :email %>
66
- </div>
67
- <div class='field message_field'>
68
- <%= f.label :message %>
69
- <%= f.text_area :message, :rows => 6 %>
70
- </div>
71
- <div class='field form-actions'>
72
- <%= f.submit t('.submit') %>
73
- </div>
74
- <% end %>
45
+
46
+ <% flash.each do |key, value| %>
47
+ <div id='flash' class="flash flash_<%= key %>">
48
+ <%= value %>
49
+ </div>
50
+ <% end %>
51
+
52
+ <h2><%= t('.comments.add') %></h2>
53
+ <% form_for [:blog_post, @blog_comment] do |f| %>
54
+ <% if Rails.version < '3.0.0'%>
55
+ <%= f.error_messages %>
56
+ <% else %>
57
+ <%= render :partial => "/shared/admin/error_messages",
58
+ :locals => {
59
+ :object => f.object,
60
+ :include_object_name => true
61
+ } %>
62
+ <% end %>
63
+ <div class='field'>
64
+ <%= f.label :name %>
65
+ <%= f.text_field :name %>
66
+ </div>
67
+ <div class='field'>
68
+ <%= f.label :email %>
69
+ <%= f.email_field :email %>
70
+ </div>
71
+ <div class='field message_field'>
72
+ <%= f.label :message %>
73
+ <%= f.text_area :message, :rows => 6 %>
74
+ </div>
75
+ <div class='field form-actions'>
76
+ <%= f.submit t('.submit') %>
77
+ </div>
78
+ <% end %>
79
+ </aside>
75
80
  <% end %>
76
81
  <% end %>
77
82
 
@@ -1,24 +1,28 @@
1
1
  <% if post.live? %>
2
- <li>
3
- <h2><%= link_to post.title, blog_post_url(post) %></h2>
4
- <p class='posted_at'>
5
- <%= t('blog.shared.posts.created_at', :when => post.published_at.strftime('%d %B %Y')) %>
6
- </p>
7
- <div clas='clearfix'>
2
+ <article class="blog_post" id="<%= dom_id(post) %>">
3
+ <header>
4
+ <h1><%= link_to post.title, blog_post_url(post) %></h1>
5
+ <p class='posted_at'>
6
+ <%= t('blog.shared.posts.created_at', :when => post.published_at.strftime('%d %B %Y')) %>
7
+ </p>
8
+ </header>
9
+ <section class='clearfix'>
8
10
  <%= truncate(post.body,
9
11
  :length => RefinerySetting.find_or_set(:blog_post_teaser_length, 250),
10
12
  :preserve_html_tags => true) %>
11
- </div>
12
- <p>
13
- <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
13
+ </section>
14
+ <footer>
15
+ <p>
16
+ <%= link_to t('blog.shared.posts.read_more'), blog_post_url(post) %>
14
17
 
15
- <span class='comment_count'>
16
- <% if post.comments.any? %>
17
- (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
18
- <% else %>
19
- (<%= t('blog.shared.comments.none') %>)
20
- <% end %>
21
- </span>
22
- </p>
23
- </li>
18
+ <span class='comment_count'>
19
+ <% if post.comments.any? %>
20
+ (<%= pluralize(post.comments.count, t('blog.shared.comments.singular')) %>)
21
+ <% else %>
22
+ (<%= t('blog.shared.comments.none') %>)
23
+ <% end %>
24
+ </span>
25
+ </p>
26
+ </footer>
27
+ </article>
24
28
  <% end %>
data/config/routes.rb CHANGED
@@ -32,8 +32,8 @@ if Rails.version < '3.0.0'
32
32
  else
33
33
  Refinery::Application.routes.draw do
34
34
  scope(:path => 'blog', :module => 'blog') do
35
- root :to => 'posts#index'
36
- match 'feed.rss', :to => 'posts#index.rss', :as => 'rss_feed'
35
+ root :to => 'posts#index', :as => 'blog_root'
36
+ match 'feed.rss', :to => 'posts#index.rss', :as => 'blog_rss_feed'
37
37
  match ':id', :to => 'posts#show', :as => 'blog_post'
38
38
  match 'categories/:id', :to => 'categories#show', :as => 'blog_category'
39
39
  match ':id/comments', :to => 'posts#comment', :as => 'blog_post_blog_comments'
@@ -37,7 +37,7 @@ class RefineryBlogGenerator < Rails::Generator::NamedBase
37
37
  :attributes => [
38
38
  Rails::Generator::GeneratedAttribute.new('title', 'string'),
39
39
  Rails::Generator::GeneratedAttribute.new('body', 'text'),
40
- Rails::Generator::GeneratedAttribute.new('draft', 'boolean')
40
+ Rails::Generator::GeneratedAttribute.new('draft', 'boolean'),
41
41
  Rails::Generator::GeneratedAttribute.new('published_at', 'datetime')
42
42
  ], :id => true
43
43
  },{
@@ -16,7 +16,8 @@ class RefineryBlogGenerator < Rails::Generators::NamedBase
16
16
  :attributes => [
17
17
  Rails::Generators::GeneratedAttribute.new('title', 'string'),
18
18
  Rails::Generators::GeneratedAttribute.new('body', 'text'),
19
- Rails::Generators::GeneratedAttribute.new('draft', 'boolean')
19
+ Rails::Generators::GeneratedAttribute.new('draft', 'boolean'),
20
+ Rails::Generators::GeneratedAttribute.new('published_at', 'datetime')
20
21
  ], :id => true
21
22
  },{
22
23
  :table_name => 'blog_comments',
@@ -42,7 +42,7 @@ module Refinery
42
42
 
43
43
  class << self
44
44
  def version
45
- %q{1.0.rc11}
45
+ %q{1.0.rc13}
46
46
  end
47
47
  end
48
48
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-blog
3
3
  version: !ruby/object:Gem::Version
4
- hash: -398340060
4
+ hash: -398340062
5
5
  prerelease: true
6
6
  segments:
7
7
  - 1
8
8
  - 0
9
- - rc11
10
- version: 1.0.rc11
9
+ - rc13
10
+ version: 1.0.rc13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Resolve Digital
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-21 00:00:00 +12:00
19
+ date: 2010-10-05 00:00:00 +13:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency