alchemy_cms 2.0.rc5 → 2.0.rc6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -1
- data/README.md +1 -1
- data/alchemy_cms.gemspec +1 -2
- data/app/controllers/admin/contents_controller.rb +1 -1
- data/app/controllers/alchemy_controller.rb +3 -3
- data/app/views/admin/pages/configure.html.erb +16 -16
- data/app/views/layouts/alchemy.html.erb +0 -1
- data/app/views/layouts/login.html.erb +0 -1
- data/assets/javascripts/alchemy.js +5 -5
- data/assets/javascripts/jquery-ui.js +270 -148
- data/assets/javascripts/jquery.js +5 -5
- data/assets/stylesheets/alchemy.css +78 -55
- data/assets/stylesheets/elements.css +2 -2
- data/assets/stylesheets/jquery-ui-1.8.7.alchemy.css +3 -12
- data/config/locales/de.yml +4 -1
- data/config/locales/en.yml +4 -1
- data/lib/alchemy/version.rb +1 -1
- data/lib/rails/generators/alchemy/plugin/plugin_generator.rb +16 -7
- data/lib/rails/generators/alchemy/plugin/templates/authorization_rules.rb +29 -0
- data/lib/rails/generators/alchemy/plugin/templates/config.yml +7 -7
- data/lib/rails/generators/alchemy/plugin/templates/gettext.rb +2 -0
- data/lib/rails/generators/alchemy/plugin/templates/init.rb +1 -4
- data/lib/rails/generators/alchemy/plugin/templates/plugin.rb +0 -0
- data/lib/rails/generators/alchemy/plugin/templates/routes.rb +8 -2
- data/lib/rails/generators/alchemy/plugin/templates/translation.pot +3 -0
- data/lib/rails/generators/alchemy/plugin/templates/translation_de.po +3 -0
- data/lib/rails/generators/alchemy/plugin/templates/translation_en.po +3 -0
- data/lib/rails/templates/alchemy.rb +3 -4
- data/spec/controllers/admin/contents_controller_spec.rb +16 -0
- metadata +16 -22
@@ -6,24 +6,33 @@ module Alchemy
|
|
6
6
|
desc "This generator generates a Alchemy plugin skeleton for you."
|
7
7
|
argument :plugin_name, :banner => "your_plugin_name"
|
8
8
|
source_root File.expand_path('templates', File.dirname(__FILE__))
|
9
|
-
|
9
|
+
|
10
10
|
def create_directories
|
11
|
-
@
|
11
|
+
@plugin_name = plugin_name.underscore
|
12
|
+
@plugin_path = Rails.root.join('vendor/plugins', @plugin_name)
|
13
|
+
empty_directory "#{@plugin_path}/lib/#{@plugin_name}"
|
14
|
+
empty_directory "#{@plugin_path}/rails"
|
12
15
|
empty_directory "#{@plugin_path}/app/controllers/admin"
|
13
16
|
empty_directory "#{@plugin_path}/app/models"
|
14
17
|
empty_directory "#{@plugin_path}/app/views/admin"
|
15
18
|
empty_directory "#{@plugin_path}/config/alchemy"
|
16
|
-
empty_directory "#{@plugin_path}/
|
19
|
+
empty_directory "#{@plugin_path}/config/initializers"
|
20
|
+
empty_directory "#{@plugin_path}/locale/de"
|
21
|
+
empty_directory "#{@plugin_path}/locale/en"
|
17
22
|
end
|
18
|
-
|
23
|
+
|
19
24
|
def create_defaults
|
20
|
-
@plugin_name
|
21
|
-
template("
|
25
|
+
template("translation.pot", "#{@plugin_path}/locale/#{@plugin_name}.pot")
|
26
|
+
template("translation_de.po", "#{@plugin_path}/locale/de/#{@plugin_name}.po")
|
27
|
+
template("translation_en.po", "#{@plugin_path}/locale/en/#{@plugin_name}.po")
|
28
|
+
template("gettext.rb", "#{@plugin_path}/config/initializers/gettext.rb")
|
22
29
|
template("config.yml", "#{@plugin_path}/config/alchemy/config.yml")
|
23
30
|
template("authorization_rules.rb", "#{@plugin_path}/config/authorization_rules.rb")
|
24
31
|
template("routes.rb", "#{@plugin_path}/config/routes.rb")
|
32
|
+
template("plugin.rb", "#{@plugin_path}/lib/#{@plugin_name}.rb")
|
33
|
+
template("init.rb", "#{@plugin_path}/rails/init.rb")
|
25
34
|
end
|
26
|
-
|
35
|
+
|
27
36
|
end
|
28
37
|
end
|
29
38
|
end
|
@@ -2,4 +2,33 @@
|
|
2
2
|
# See https://github.com/stffn/declarative_authorization for further informations.
|
3
3
|
authorization do
|
4
4
|
|
5
|
+
role :guest do
|
6
|
+
has_permission_on :<%= @plugin_name.tableize %>, :to => [:show]
|
7
|
+
end
|
8
|
+
|
9
|
+
role :registered do
|
10
|
+
includes :guest
|
11
|
+
end
|
12
|
+
|
13
|
+
role :author do
|
14
|
+
includes :registered
|
15
|
+
end
|
16
|
+
|
17
|
+
role :editor do
|
18
|
+
includes :author
|
19
|
+
end
|
20
|
+
|
21
|
+
role :admin do
|
22
|
+
includes :editor
|
23
|
+
has_permission_on :admin_<%= @plugin_name.tableize %>, :to => [:manage]
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
privileges do
|
29
|
+
|
30
|
+
privilege :manage do
|
31
|
+
includes :index, :new, :create, :show, :edit, :update, :destroy
|
32
|
+
end
|
33
|
+
|
5
34
|
end
|
@@ -17,14 +17,14 @@
|
|
17
17
|
# controller: # Typically your controller and action you set for mainnavi entry.
|
18
18
|
# action: # [String]
|
19
19
|
|
20
|
-
name: <%= @plugin_name
|
20
|
+
name: <%= @plugin_name %>
|
21
21
|
|
22
22
|
navigation:
|
23
23
|
name: <%= @plugin_name.camelcase %>
|
24
|
-
controller:
|
25
|
-
action:
|
26
|
-
image:
|
24
|
+
controller: admin/<%= @plugin_name.tableize %>
|
25
|
+
action: index
|
26
|
+
image: <%= @plugin_name %>/<%= @plugin_name %>.png
|
27
27
|
sub_navigation:
|
28
|
-
- name:
|
29
|
-
controller:
|
30
|
-
action:
|
28
|
+
- name: <%= @plugin_name.camelcase %>
|
29
|
+
controller: admin/<%= @plugin_name.tableize %>
|
30
|
+
action: index
|
@@ -1,4 +1 @@
|
|
1
|
-
|
2
|
-
FastGettext.add_text_domain '<%= @plugin_name %>', :path => File.join(File.dirname(__FILE__), 'locale'), :format => :po
|
3
|
-
FastGettext.text_domain = '<%= @plugin_name %>'
|
4
|
-
end
|
1
|
+
require File.join(File.dirname(__FILE__), '..', 'lib/<%= @plugin_name %>')
|
File without changes
|
@@ -1,11 +1,10 @@
|
|
1
1
|
# This rails template installs Alchemy and all depending gems.
|
2
|
-
# Run it with +rails YOUR_APP_NAME -d mysql -m alchemy+.
|
3
2
|
|
4
3
|
# Installing Alchemy Gem
|
5
4
|
|
6
|
-
gem 'alchemy_cms', '>= 2.0.
|
7
|
-
gem 'ruby-debug', :group => :development
|
8
|
-
gem '
|
5
|
+
gem 'alchemy_cms', '>= 2.0.rc5'
|
6
|
+
gem 'ruby-debug', :group => :development, :platform => :ruby_18
|
7
|
+
gem 'ruby-debug19', :group => :development, :platform => :ruby_19
|
9
8
|
|
10
9
|
if yes?("Use Capistrano for deployment? (y/N)")
|
11
10
|
gem 'capistrano', :group => :development
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Admin::ContentsController do
|
4
|
+
|
5
|
+
before(:each) do
|
6
|
+
activate_authlogic
|
7
|
+
UserSession.create Factory(:admin_user)
|
8
|
+
end
|
9
|
+
|
10
|
+
it "should update a content" do
|
11
|
+
Factory(:element)
|
12
|
+
post :update, {:id => 1, :content => {:body => 'Peters Petshop'}}
|
13
|
+
Element.first.ingredient('intro').should == "Peters Petshop"
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: alchemy_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease: 4
|
5
|
-
version: 2.0.
|
5
|
+
version: 2.0.rc6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Thomas von Deyen
|
@@ -12,8 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2011-10-
|
16
|
-
default_executable:
|
15
|
+
date: 2011-10-30 00:00:00 Z
|
17
16
|
dependencies:
|
18
17
|
- !ruby/object:Gem::Dependency
|
19
18
|
name: rails
|
@@ -164,35 +163,35 @@ dependencies:
|
|
164
163
|
requirement: &id014 !ruby/object:Gem::Requirement
|
165
164
|
none: false
|
166
165
|
requirements:
|
167
|
-
- -
|
166
|
+
- - ~>
|
168
167
|
- !ruby/object:Gem::Version
|
169
168
|
version: 0.1.1
|
170
169
|
type: :runtime
|
171
170
|
version_requirements: *id014
|
172
171
|
- !ruby/object:Gem::Dependency
|
173
|
-
name:
|
172
|
+
name: rspec-rails
|
174
173
|
prerelease: false
|
175
174
|
requirement: &id015 !ruby/object:Gem::Requirement
|
176
175
|
none: false
|
177
176
|
requirements:
|
178
177
|
- - ">="
|
179
178
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
179
|
+
version: "2.0"
|
181
180
|
type: :development
|
182
181
|
version_requirements: *id015
|
183
182
|
- !ruby/object:Gem::Dependency
|
184
|
-
name:
|
183
|
+
name: sqlite3
|
185
184
|
prerelease: false
|
186
185
|
requirement: &id016 !ruby/object:Gem::Requirement
|
187
186
|
none: false
|
188
187
|
requirements:
|
189
188
|
- - ">="
|
190
189
|
- !ruby/object:Gem::Version
|
191
|
-
version: "
|
190
|
+
version: "0"
|
192
191
|
type: :development
|
193
192
|
version_requirements: *id016
|
194
193
|
- !ruby/object:Gem::Dependency
|
195
|
-
name:
|
194
|
+
name: ruby-debug19
|
196
195
|
prerelease: false
|
197
196
|
requirement: &id017 !ruby/object:Gem::Requirement
|
198
197
|
none: false
|
@@ -202,17 +201,6 @@ dependencies:
|
|
202
201
|
version: "0"
|
203
202
|
type: :development
|
204
203
|
version_requirements: *id017
|
205
|
-
- !ruby/object:Gem::Dependency
|
206
|
-
name: ruby-debug19
|
207
|
-
prerelease: false
|
208
|
-
requirement: &id018 !ruby/object:Gem::Requirement
|
209
|
-
none: false
|
210
|
-
requirements:
|
211
|
-
- - ">="
|
212
|
-
- !ruby/object:Gem::Version
|
213
|
-
version: "0"
|
214
|
-
type: :development
|
215
|
-
version_requirements: *id018
|
216
204
|
description: Alchemy is an awesome Rails CMS with an extremely flexible content storing architecture.
|
217
205
|
email:
|
218
206
|
- alchemy@magiclabs.de
|
@@ -693,8 +681,13 @@ files:
|
|
693
681
|
- lib/rails/generators/alchemy/plugin/plugin_generator.rb
|
694
682
|
- lib/rails/generators/alchemy/plugin/templates/authorization_rules.rb
|
695
683
|
- lib/rails/generators/alchemy/plugin/templates/config.yml
|
684
|
+
- lib/rails/generators/alchemy/plugin/templates/gettext.rb
|
696
685
|
- lib/rails/generators/alchemy/plugin/templates/init.rb
|
686
|
+
- lib/rails/generators/alchemy/plugin/templates/plugin.rb
|
697
687
|
- lib/rails/generators/alchemy/plugin/templates/routes.rb
|
688
|
+
- lib/rails/generators/alchemy/plugin/templates/translation.pot
|
689
|
+
- lib/rails/generators/alchemy/plugin/templates/translation_de.po
|
690
|
+
- lib/rails/generators/alchemy/plugin/templates/translation_en.po
|
698
691
|
- lib/rails/generators/alchemy/scaffold/scaffold_generator.rb
|
699
692
|
- lib/rails/generators/alchemy/scaffold/templates/elements.yml
|
700
693
|
- lib/rails/generators/alchemy/scaffold/templates/page_layouts.yml
|
@@ -712,6 +705,7 @@ files:
|
|
712
705
|
- spec/alchemy_spec.rb
|
713
706
|
- spec/config_spec.rb
|
714
707
|
- spec/controllers/admin/clipboard_controller_spec.rb
|
708
|
+
- spec/controllers/admin/contents_controller_spec.rb
|
715
709
|
- spec/dummy/Rakefile
|
716
710
|
- spec/dummy/app/controllers/application_controller.rb
|
717
711
|
- spec/dummy/app/helpers/application_helper.rb
|
@@ -765,7 +759,6 @@ files:
|
|
765
759
|
- spec/page_layout_spec.rb
|
766
760
|
- spec/routing_spec.rb
|
767
761
|
- spec/spec_helper.rb
|
768
|
-
has_rdoc: true
|
769
762
|
homepage: http://alchemy-cms.com
|
770
763
|
licenses:
|
771
764
|
- GPL-3
|
@@ -789,7 +782,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
789
782
|
requirements:
|
790
783
|
- ImageMagick (libmagick), v6.6 or greater.
|
791
784
|
rubyforge_project:
|
792
|
-
rubygems_version: 1.
|
785
|
+
rubygems_version: 1.8.11
|
793
786
|
signing_key:
|
794
787
|
specification_version: 3
|
795
788
|
summary: An extremly flexbile CMS for Rails 3.
|
@@ -797,6 +790,7 @@ test_files:
|
|
797
790
|
- spec/alchemy_spec.rb
|
798
791
|
- spec/config_spec.rb
|
799
792
|
- spec/controllers/admin/clipboard_controller_spec.rb
|
793
|
+
- spec/controllers/admin/contents_controller_spec.rb
|
800
794
|
- spec/dummy/Rakefile
|
801
795
|
- spec/dummy/app/controllers/application_controller.rb
|
802
796
|
- spec/dummy/app/helpers/application_helper.rb
|