cartoonist-blog 0.0.6 → 0.0.7
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/app/controllers/blog_admin_controller.rb +1 -1
- data/app/controllers/blog_controller.rb +3 -3
- data/app/models/blog_feed.rb +9 -1
- data/app/views/blog/archives.html.erb +1 -1
- data/app/views/layouts/blog.html.erb +1 -1
- data/app/views/layouts/blog_archives.html.erb +17 -0
- data/config/locales/en.yml +1 -1
- data/lib/cartoonist-blog/engine.rb +1 -1
- metadata +6 -5
@@ -1,7 +1,7 @@
|
|
1
|
-
class BlogController <
|
1
|
+
class BlogController < CartoonistController
|
2
2
|
def archives
|
3
3
|
@posts = BlogPost.archives
|
4
|
-
render :layout => "
|
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
|
data/app/models/blog_feed.rb
CHANGED
@@ -2,7 +2,15 @@ class BlogFeed
|
|
2
2
|
attr_reader :pub_date, :items
|
3
3
|
|
4
4
|
def initialize(feed)
|
5
|
-
|
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
|
@@ -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" %>
|
data/config/locales/en.yml
CHANGED
@@ -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 => "
|
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.
|
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-
|
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: &
|
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.
|
21
|
+
version: 0.0.7
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
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
|