feather_cms 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/README.md +4 -0
- data/lib/feather_cms/version.rb +1 -1
- data/lib/generators/feather_cms/USAGE +1 -1
- data/lib/generators/feather_cms/feather_cms_generator.rb +6 -6
- data/lib/generators/feather_cms/templates/form.html.erb +1 -1
- data/lib/generators/feather_cms/templates/migration.rb +2 -2
- metadata +4 -5
data/README.md
CHANGED
@@ -12,7 +12,11 @@ Now, generate the pages
|
|
12
12
|
|
13
13
|
$ rake db:migrate
|
14
14
|
|
15
|
+
# Use file system to store pages( default: public/system/templates)
|
15
16
|
$ rails g feather_cms about_us jobs team
|
17
|
+
|
18
|
+
#Use db to store pages
|
19
|
+
$ rails g feather_cms about_us jobs team --storage=db
|
16
20
|
|
17
21
|
This generates a route, the controller action and the view for each page. Start the server and use the URL http://localhost:3000/feathers/pages to go to the admin panel.
|
18
22
|
|
data/lib/feather_cms/version.rb
CHANGED
@@ -2,16 +2,16 @@ class FeatherCmsGenerator < Rails::Generators::NamedBase
|
|
2
2
|
source_root File.expand_path('../templates', __FILE__)
|
3
3
|
argument :attributes, :type => :array, :banner => "about_us jobs"
|
4
4
|
argument :name, :type => :string, :default => "feather_cms", :required => false
|
5
|
-
|
5
|
+
class_option :storage, :aliases => '-s', :type => :string, :desc => 'db or file storage.'
|
6
6
|
|
7
7
|
def create_cms_files
|
8
8
|
@pages = attributes.collect(&:name)
|
9
9
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
@storage = if ['file', 'db'].include?(options['storage'])
|
11
|
+
options['storage']
|
12
|
+
else
|
13
|
+
'file'
|
14
|
+
end
|
15
15
|
|
16
16
|
template 'initializer.rb', 'config/initializers/feather_cms.rb'
|
17
17
|
template 'controller.rb', 'app/controllers/feathers_controller.rb'
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<%%= link_to 'Draft Page', feather_page_path('<%= @type %>', :draft) %>
|
10
10
|
</li>
|
11
11
|
<li>
|
12
|
-
<%%= link_to 'Preview', feather_page_preview_path('<%= @type %>', status), target: '_blank' %>
|
12
|
+
<%%= link_to 'Preview', feather_page_preview_path('<%= @type %>', status), target: '_blank' unless @feather_page.new_record? %>
|
13
13
|
</li>
|
14
14
|
</ul>
|
15
15
|
</div>
|
@@ -3,8 +3,8 @@ class CreateFeatherPages < ActiveRecord::Migration
|
|
3
3
|
create_table :feather_pages do |t|
|
4
4
|
t.string :name
|
5
5
|
t.string :status, :default => 'draft'
|
6
|
-
<% if @
|
7
|
-
|
6
|
+
<% if @storage == 'db' %>
|
7
|
+
t.text :content
|
8
8
|
<% end %>
|
9
9
|
t.string :layout, :default => 'application'
|
10
10
|
t.timestamps
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feather_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-04-30 00:00:00.
|
12
|
+
date: 2012-04-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156032340 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156032340
|
25
25
|
description: Lightweight do it youself cms
|
26
26
|
email:
|
27
27
|
- jiren@joshsoftware.com
|
@@ -95,4 +95,3 @@ signing_key:
|
|
95
95
|
specification_version: 3
|
96
96
|
summary: Lightweight do it youself cms
|
97
97
|
test_files: []
|
98
|
-
has_rdoc:
|