cartoonist-blog 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- class BlogAdminController < ApplicationController
1
+ class BlogAdminController < CartoonistController
2
2
  helper :blog
3
3
  before_filter :preview!, :only => [:preview]
4
4
  before_filter :ensure_ssl!
@@ -1,7 +1,7 @@
1
- class BlogController < ApplicationController
1
+ class BlogController < CartoonistController
2
2
  def archives
3
3
  @posts = BlogPost.archives
4
- render :layout => "page"
4
+ render :layout => "blog_archives"
5
5
  cache_page_as "blog/archives.#{cache_type}.tmp.html"
6
6
  end
7
7
 
@@ -31,7 +31,7 @@ class BlogController < ApplicationController
31
31
 
32
32
  format.rss do
33
33
  @feed = feed_content
34
- render :content_type => "application/xml"
34
+ render :content_type => "application/xml", :layout => "cartoonist"
35
35
  end
36
36
  end
37
37
  end
@@ -2,7 +2,15 @@ class BlogFeed
2
2
  attr_reader :pub_date, :items
3
3
 
4
4
  def initialize(feed)
5
- @pub_date = feed.first.posted_at.localtime.strftime "%a, %d %b %Y %H:%M:00 %z"
5
+ first = feed.first
6
+
7
+ if first
8
+ first_date = first.posted_at
9
+ else
10
+ first_date = Time.now
11
+ end
12
+
13
+ @pub_date = first_date.localtime.strftime "%a, %d %b %Y %H:%M:00 %z"
6
14
  @items = feed.map do |item|
7
15
  BlogFeed::Item.new item
8
16
  end
@@ -1,4 +1,4 @@
1
- <% content_for(:title, "Blog Archives for #{Setting[:site_name]}") %>
1
+ <% content_for :title, "Blog Archives for #{Setting[:site_name]}" %>
2
2
 
3
3
  <ul>
4
4
  <% @posts.each do |post| %>
@@ -67,4 +67,4 @@
67
67
  <% end %>
68
68
  <% end %>
69
69
 
70
- <%= render :template => "layouts/application" %>
70
+ <%= render :template => "layouts/cartoonist" %>
@@ -0,0 +1,17 @@
1
+ <% content_for :content_class, "blog-archives-content" %>
2
+
3
+ <% content_for :content do %>
4
+ <div class="blog-archives-page">
5
+ <h1><%= yield :title %></h1>
6
+
7
+ <%= yield %>
8
+ </div>
9
+ <% end %>
10
+
11
+ <% content_for :admin_content do %>
12
+ <% if preview? %>
13
+ <p><a href="/admin/main">admin</a></p>
14
+ <% end %>
15
+ <% end %>
16
+
17
+ <%= render :template => "layouts/cartoonist" %>
@@ -14,7 +14,7 @@ en:
14
14
  layout:
15
15
  tab:
16
16
  blog: Blog
17
- application:
17
+ cartoonist:
18
18
  layout:
19
19
  navigation:
20
20
  blog: Blog
@@ -2,7 +2,7 @@ module CartoonistBlog
2
2
  class Engine < ::Rails::Engine
3
3
  Cartoonist::Admin::Tab.add :blog, :url => "/blog_admin", :order => 1
4
4
  Cartoonist::RootPath.add :blog, "blog#index"
5
- Cartoonist::Navigation::Link.add :url => "/blog", :preview_url => "/blog_admin/preview", :class => "blog", :label => "application.layout.navigation.blog", :order => 1
5
+ Cartoonist::Navigation::Link.add :url => "/blog", :preview_url => "/blog_admin/preview", :class => "blog", :label => "cartoonist.layout.navigation.blog", :order => 1
6
6
  Cartoonist::Migration.add_for self
7
7
 
8
8
  Cartoonist::Backup.for :blog_posts do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cartoonist-blog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,19 +9,19 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-18 00:00:00.000000000 Z
12
+ date: 2012-04-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cartoonist
16
- requirement: &17149620 !ruby/object:Gem::Requirement
16
+ requirement: &15495680 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - =
20
20
  - !ruby/object:Gem::Version
21
- version: 0.0.6
21
+ version: 0.0.7
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *17149620
24
+ version_requirements: *15495680
25
25
  description: This core plugin for Cartoonist adds a simple blog.
26
26
  email: reasonnumber@gmail.com
27
27
  executables: []
@@ -43,6 +43,7 @@ files:
43
43
  - app/views/blog_admin/new.html.erb
44
44
  - app/views/layouts/blog.html.erb
45
45
  - app/views/layouts/blog_admin.html.erb
46
+ - app/views/layouts/blog_archives.html.erb
46
47
  - cartoonist-blog.gemspec
47
48
  - config/locales/en.yml
48
49
  - db/migrate/20120308064117_create_blog_posts.rb