tkh_content 0.0.1 → 0.0.2

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/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
 
4
4
 
5
+
6
+ ## 0.0.2
7
+
8
+ * Use switch_to_admin_layout method in pages controller
9
+ * Fixed edit_page_path in buttons of index view
10
+ * Fixed submit button syntax in form partial
11
+ * Added for_blog to page accessible attributes
12
+ * Added a blog layout. Show action renders this layout for appropriate blog posts
13
+
14
+
5
15
  ## 0.0.1
6
16
 
7
17
  * Initial release
@@ -5,21 +5,22 @@ class PagesController < ApplicationController
5
5
 
6
6
  def index
7
7
  @pages = Page.by_recent
8
- render layout: 'admin'
8
+ switch_to_admin_layout
9
9
  end
10
10
 
11
11
  def show
12
12
  @page = Page.find(params[:id])
13
+ render layout: 'blog' if @page.for_blog?
13
14
  end
14
15
 
15
16
  def new
16
17
  @page = Page.new
17
- render layout: 'admin'
18
+ switch_to_admin_layout
18
19
  end
19
20
 
20
21
  def edit
21
22
  @page = Page.find(params[:id])
22
- render layout: 'admin'
23
+ switch_to_admin_layout
23
24
  end
24
25
 
25
26
  def create
data/app/models/page.rb CHANGED
@@ -5,7 +5,7 @@ end
5
5
 
6
6
  class Page < ActiveRecord::Base
7
7
 
8
- attr_accessible :body, :description, :title, :blog_post
8
+ attr_accessible :body, :description, :title, :blog_post, :for_blog
9
9
 
10
10
  validates_presence_of :title
11
11
  validates_presence_of :description
@@ -0,0 +1,38 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>
5
+ <% if defined?(SETTINGS) && SETTINGS['site_name'] %>
6
+ <%= @meta_title ? "#{@meta_title} | #{SETTINGS['site_name']}" : SETTINGS['site_name'] %>
7
+ <% else %>
8
+ <%= @meta_title ? @meta_tile : 'A web site powered by tkh_cms' %>
9
+ <% end -%>
10
+ - The blog</title>
11
+ <meta name="description" content="<%= @meta_description -%>">
12
+ <%= stylesheet_link_tag "application", :media => "all" %>
13
+ <%= favicon_link_tag '/favicon.ico' %>
14
+ <%= csrf_meta_tags %>
15
+ </head>
16
+ <body>
17
+
18
+ <div id="content">
19
+
20
+ <article>
21
+ <% flash.each do |name, msg| %>
22
+ <%= content_tag :div, msg, :id => "flash_#{name}" %>
23
+ <% end %>
24
+
25
+ <h1>The blog</h1>
26
+
27
+ <%= yield %>
28
+ </article>
29
+
30
+ <aside>
31
+ <%# = render 'shared/sidebar' %>
32
+ </aside>
33
+
34
+ </div>
35
+
36
+ <%= javascript_include_tag "application" %>
37
+ </body>
38
+ </html>
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
 
11
11
  <div class="form-actions">
12
- <%= f.submit, :class => 'btn btn-primary' %>
12
+ <%= f.button :submit, :class => 'btn btn-primary' %>
13
13
  </div>
14
14
 
15
15
  <% end %>
@@ -16,7 +16,7 @@
16
16
  <td><%= link_to page.title, page_path(page) %></td>
17
17
  <td><%= truncate page.description, length: 55, separator: ' ...' %></td>
18
18
  <td><%= page.for_blog? ? '✓' : 'X' %></td>
19
- <td><%= link_to t('edit'), page, class: 'btn btn-mini' %>
19
+ <td><%= link_to t('edit'), edit_page_path(page), class: 'btn btn-mini' %>
20
20
  <%= link_to t('delete'), page, method: :delete, data: { confirm: t('are_you_sure') }, class: 'btn btn-mini btn-danger' %></td>
21
21
  </tr>
22
22
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module TkhContent
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_content
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-08-02 00:00:00.000000000 Z
12
+ date: 2012-08-03 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -100,6 +100,7 @@ extra_rdoc_files: []
100
100
  files:
101
101
  - app/controllers/pages_controller.rb
102
102
  - app/models/page.rb
103
+ - app/views/layouts/blog.html.erb
103
104
  - app/views/pages/_form.html.erb
104
105
  - app/views/pages/edit.html.erb
105
106
  - app/views/pages/index.html.erb
@@ -164,7 +165,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
165
  version: '0'
165
166
  segments:
166
167
  - 0
167
- hash: -2664592323236431348
168
+ hash: -4206250643872968901
168
169
  required_rubygems_version: !ruby/object:Gem::Requirement
169
170
  none: false
170
171
  requirements:
@@ -173,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
173
174
  version: '0'
174
175
  segments:
175
176
  - 0
176
- hash: -2664592323236431348
177
+ hash: -4206250643872968901
177
178
  requirements: []
178
179
  rubyforge_project:
179
180
  rubygems_version: 1.8.23