alchemy_cms 2.6.3 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.simplecov +14 -0
- data/.travis.yml +1 -1
- data/Gemfile +7 -6
- data/README.md +15 -5
- data/alchemy_cms.gemspec +3 -2
- data/app/assets/javascripts/alchemy/alchemy.base.js.coffee +9 -17
- data/app/assets/javascripts/alchemy/alchemy.dirty.js.coffee +70 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +80 -0
- data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +43 -19
- data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +3 -1
- data/app/assets/javascripts/alchemy/alchemy.js +4 -2
- data/app/assets/javascripts/alchemy/alchemy.onload.js.coffee +1 -1
- data/app/assets/javascripts/alchemy/alchemy.spinner.js.coffee +14 -0
- data/app/assets/javascripts/alchemy/alchemy.tinymce.js.coffee.erb +96 -0
- data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +22 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js.coffee +28 -17
- data/app/assets/stylesheets/alchemy/base.scss +6 -0
- data/app/assets/stylesheets/alchemy/elements.scss +2 -28
- data/app/assets/stylesheets/alchemy/errors.scss +1 -1
- data/app/assets/stylesheets/alchemy/menubar.css.scss +2 -0
- data/app/assets/stylesheets/alchemy/sitemap.scss +21 -34
- data/app/assets/stylesheets/alchemy/tables.scss +13 -3
- data/app/controllers/alchemy/admin/attachments_controller.rb +10 -5
- data/app/controllers/alchemy/admin/base_controller.rb +19 -0
- data/app/controllers/alchemy/admin/contents_controller.rb +1 -4
- data/app/controllers/alchemy/admin/dashboard_controller.rb +2 -1
- data/app/controllers/alchemy/admin/elements_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_files_controller.rb +1 -1
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +70 -56
- data/app/controllers/alchemy/admin/pages_controller.rb +37 -114
- data/app/controllers/alchemy/admin/pictures_controller.rb +5 -12
- data/app/controllers/alchemy/admin/resources_controller.rb +3 -1
- data/app/controllers/alchemy/admin/trash_controller.rb +1 -1
- data/app/controllers/alchemy/attachments_controller.rb +1 -1
- data/app/controllers/alchemy/base_controller.rb +3 -15
- data/app/controllers/alchemy/messages_controller.rb +4 -10
- data/app/controllers/alchemy/pages_controller.rb +6 -6
- data/app/controllers/alchemy/passwords_controller.rb +1 -1
- data/app/controllers/alchemy/user_sessions_controller.rb +1 -1
- data/app/helpers/alchemy/admin/base_helper.rb +49 -230
- data/app/helpers/alchemy/admin/contents_helper.rb +5 -1
- data/app/helpers/alchemy/admin/elements_helper.rb +19 -47
- data/app/helpers/alchemy/admin/essences_helper.rb +59 -17
- data/app/helpers/alchemy/admin/navigation_helper.rb +204 -0
- data/app/helpers/alchemy/admin/pages_helper.rb +22 -79
- data/app/helpers/alchemy/admin/pictures_helper.rb +1 -1
- data/app/helpers/alchemy/admin/tags_helper.rb +42 -0
- data/app/helpers/alchemy/base_helper.rb +0 -11
- data/app/helpers/alchemy/elements_helper.rb +48 -25
- data/app/helpers/alchemy/essences_helper.rb +0 -20
- data/app/helpers/alchemy/pages_helper.rb +18 -14
- data/app/helpers/alchemy/url_helper.rb +1 -0
- data/app/mailers/alchemy/messages.rb +4 -6
- data/app/models/alchemy/attachment.rb +3 -0
- data/app/models/alchemy/cell.rb +33 -35
- data/app/models/alchemy/content.rb +20 -111
- data/app/models/alchemy/content/factory.rb +188 -0
- data/app/models/alchemy/element.rb +51 -200
- data/app/models/alchemy/element/definitions.rb +52 -0
- data/app/models/alchemy/element/presenters.rb +87 -0
- data/app/models/alchemy/essence_date.rb +1 -1
- data/app/models/alchemy/essence_file.rb +6 -7
- data/app/models/alchemy/essence_picture.rb +19 -4
- data/app/models/alchemy/message.rb +18 -14
- data/app/models/alchemy/page.rb +120 -214
- data/app/models/alchemy/page/elements.rb +145 -36
- data/app/models/alchemy/page/natures.rb +90 -0
- data/app/models/alchemy/page/scopes.rb +93 -0
- data/app/models/alchemy/page/users.rb +25 -0
- data/app/models/alchemy/picture.rb +15 -0
- data/app/models/alchemy/site.rb +15 -1
- data/app/models/alchemy/site/layout.rb +38 -0
- data/app/models/alchemy/user.rb +13 -3
- data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +7 -7
- data/app/views/alchemy/admin/attachments/_file_to_assign.html.erb +8 -8
- data/app/views/alchemy/admin/attachments/_tag_list.html.erb +1 -16
- data/app/views/alchemy/admin/attachments/destroy.js.erb +1 -4
- data/app/views/alchemy/admin/contents/create.js.erb +1 -1
- data/app/views/alchemy/admin/dashboard/index.html.erb +14 -13
- data/app/views/alchemy/admin/elements/_element_head.html.erb +7 -7
- data/app/views/alchemy/admin/elements/_refresh_editor.js.erb +10 -0
- data/app/views/alchemy/admin/elements/create.js.erb +44 -44
- data/app/views/alchemy/admin/elements/fold.js.erb +22 -26
- data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
- data/app/views/alchemy/admin/elements/update.js.erb +22 -25
- data/app/views/alchemy/admin/essence_files/assign.js.erb +8 -3
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +14 -12
- data/app/views/alchemy/admin/essence_pictures/edit.html.erb +22 -39
- data/app/views/alchemy/admin/pages/_page.html.erb +73 -80
- data/app/views/alchemy/admin/pages/destroy.js.erb +2 -2
- data/app/views/alchemy/admin/pages/edit.html.erb +21 -18
- data/app/views/alchemy/admin/pages/fold.js.erb +1 -0
- data/app/views/alchemy/admin/pages/info.html.erb +32 -0
- data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +11 -13
- data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +20 -20
- data/app/views/alchemy/admin/partials/_sub_navigation.html.erb +8 -0
- data/app/views/alchemy/admin/partials/_toolbar_button.html.erb +25 -0
- data/app/views/alchemy/admin/partials/_upload_form.html.erb +15 -15
- data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +39 -39
- data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +10 -10
- data/app/views/alchemy/admin/pictures/_tag_list.html.erb +1 -16
- data/app/views/alchemy/admin/resources/destroy.js.erb +1 -1
- data/app/views/alchemy/base/500.html.erb +1 -1
- data/app/views/alchemy/base/permission_denied.js.erb +1 -1
- data/app/views/alchemy/base/redirect.js.erb +1 -1
- data/app/views/alchemy/essences/_essence_link_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_text_editor.html.erb +1 -1
- data/app/views/alchemy/essences/{_essence_picture_tools.html.erb → shared/_essence_picture_tools.html.erb} +5 -5
- data/app/views/alchemy/essences/{_linkable_essence_tools.html.erb → shared/_linkable_essence_tools.html.erb} +0 -0
- data/app/views/alchemy/messages/contact_form_mail.de.text.erb +12 -0
- data/app/views/alchemy/messages/contact_form_mail.en.text.erb +12 -0
- data/app/views/alchemy/notifications/reset_password_instructions.de.text.erb +1 -1
- data/app/views/alchemy/notifications/reset_password_instructions.en.text.erb +2 -2
- data/app/views/alchemy/pages/sitemap.xml.erb +3 -5
- data/app/views/alchemy/user_sessions/leave.html.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +4 -2
- data/app/views/layouts/alchemy/sitemap.xml.erb +1 -1
- data/bin/alchemy +7 -13
- data/config/alchemy/config.yml +1 -0
- data/config/authorization_rules.rb +2 -3
- data/config/initializers/dragonfly.rb +2 -0
- data/config/locales/alchemy.de.yml +8 -9
- data/config/locales/alchemy.en.yml +7 -4
- data/config/routes.rb +3 -0
- data/db/migrate/{20130214233001_alchemy_two_point_five.rb → 20130827094554_alchemy_two_point_six.rb} +29 -6
- data/lib/alchemy/auth/engine.rb +9 -0
- data/lib/alchemy/capistrano.rb +37 -12
- data/lib/alchemy/config.rb +48 -35
- data/lib/alchemy/engine.rb +35 -6
- data/lib/alchemy/essence.rb +25 -29
- data/lib/alchemy/ferret/search.rb +86 -0
- data/lib/alchemy/{scoped_pagination_url_helper.rb → kaminari/scoped_pagination_url_helper.rb} +0 -0
- data/lib/alchemy/logger.rb +3 -4
- data/lib/alchemy/page_layout.rb +124 -55
- data/lib/alchemy/resource.rb +0 -10
- data/lib/alchemy/resources_helper.rb +0 -5
- data/lib/alchemy/seeder.rb +1 -32
- data/lib/alchemy/shell.rb +6 -1
- data/lib/alchemy/tinymce.rb +41 -32
- data/lib/alchemy/upgrader.rb +3 -1
- data/lib/alchemy/upgrader/two_point_five.rb +15 -8
- data/lib/alchemy/upgrader/two_point_one.rb +10 -10
- data/lib/alchemy/upgrader/two_point_two.rb +96 -51
- data/lib/alchemy/version.rb +1 -1
- data/lib/alchemy_cms.rb +5 -46
- data/lib/rails/generators/alchemy/deploy_script/templates/deploy.rb.tt +1 -1
- data/lib/rails/generators/alchemy/devise/devise_generator.rb +9 -4
- data/lib/rails/generators/alchemy/essence/essence_generator.rb +7 -6
- data/lib/rails/generators/alchemy/essence/templates/editor.html.erb +1 -1
- data/lib/rails/generators/alchemy/scaffold/files/_standard.html.erb +1 -0
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +1 -0
- data/lib/rails/generators/alchemy/site_layouts/site_layouts_generator.rb +23 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.erb +1 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.haml +1 -0
- data/lib/rails/generators/alchemy/site_layouts/templates/layout.html.slim +1 -0
- data/lib/rails/templates/alchemy.rb +2 -2
- data/lib/tasks/alchemy/db.rake +3 -1
- data/lib/tasks/alchemy/tidy.rake +82 -0
- data/lib/tasks/alchemy/upgrade.rake +2 -1
- data/spec/controllers/admin/attachments_controller_spec.rb +124 -0
- data/spec/controllers/admin/base_controller_spec.rb +35 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +1 -1
- data/spec/controllers/admin/contents_controller_spec.rb +17 -26
- data/spec/controllers/admin/dashboard_controller_spec.rb +121 -0
- data/spec/controllers/admin/elements_controller_spec.rb +1 -1
- data/spec/controllers/admin/essence_files_controller_spec.rb +67 -0
- data/spec/controllers/admin/essence_pictures_controller_spec.rb +161 -0
- data/spec/controllers/admin/languages_controller_spec.rb +1 -1
- data/spec/controllers/admin/layoutpages_controller_spec.rb +28 -0
- data/spec/controllers/admin/pages_controller_spec.rb +164 -118
- data/spec/controllers/admin/pictures_controller_spec.rb +89 -0
- data/spec/controllers/admin/trash_controller_spec.rb +21 -31
- data/spec/controllers/admin/users_controller_spec.rb +114 -85
- data/spec/controllers/attachments_controller_spec.rb +6 -2
- data/spec/controllers/base_controller_spec.rb +22 -0
- data/spec/controllers/elements_controller_spec.rb +1 -1
- data/spec/controllers/messages_controller_spec.rb +200 -0
- data/spec/controllers/pictures_controller_spec.rb +1 -1
- data/spec/controllers/user_sessions_controller_spec.rb +7 -6
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/config/alchemy/cells.yml +2 -0
- data/spec/dummy/config/application.rb +19 -8
- data/spec/dummy/db/migrate/{20130214233001_alchemy_two_point_five.rb → 20130827094554_alchemy_two_point_six.rb} +29 -6
- data/spec/dummy/db/schema.rb +1 -1
- data/spec/fast_specs.rb +15 -0
- data/spec/helpers/admin/base_helper_spec.rb +53 -34
- data/spec/helpers/admin/contents_helper_spec.rb +15 -7
- data/spec/helpers/admin/elements_helper_spec.rb +79 -34
- data/spec/helpers/admin/essences_helper_spec.rb +45 -31
- data/spec/helpers/admin/navigation_helper_spec.rb +204 -0
- data/spec/helpers/admin/pages_helper_spec.rb +25 -15
- data/spec/helpers/admin/tags_helper_spec.rb +62 -2
- data/spec/helpers/elements_helper_spec.rb +202 -138
- data/spec/helpers/pages_helper_spec.rb +48 -0
- data/spec/helpers/url_helper_spec.rb +7 -0
- data/spec/libraries/config_spec.rb +110 -3
- data/spec/libraries/essence_spec.rb +29 -9
- data/spec/libraries/page_layout_spec.rb +134 -0
- data/spec/libraries/resource_spec.rb +3 -16
- data/spec/libraries/resources_helper_spec.rb +4 -8
- data/spec/libraries/shell_spec.rb +1 -0
- data/spec/libraries/tinymce_spec.rb +61 -0
- data/spec/mailers/messages_spec.rb +23 -0
- data/spec/models/attachment_spec.rb +45 -0
- data/spec/models/cell_spec.rb +62 -9
- data/spec/models/content_spec.rb +110 -28
- data/spec/models/element_spec.rb +275 -253
- data/spec/models/essence_date_spec.rb +25 -0
- data/spec/models/essence_file_spec.rb +23 -0
- data/spec/models/essence_html_spec.rb +13 -0
- data/spec/models/essence_picture_spec.rb +16 -0
- data/spec/models/essence_text_spec.rb +29 -0
- data/spec/models/language_spec.rb +34 -0
- data/spec/models/message_spec.rb +43 -0
- data/spec/models/page_spec.rb +726 -567
- data/spec/models/picture_spec.rb +98 -0
- data/spec/models/site_spec.rb +60 -2
- data/spec/models/tag_spec.rb +31 -0
- data/spec/models/user_spec.rb +4 -4
- data/spec/spec_helper.rb +49 -58
- data/spec/support/alchemy/controller_helpers.rb +35 -0
- data/spec/support/alchemy/{specs_helpers.rb → integration_helpers.rb} +4 -8
- data/spec/{factories.rb → support/factories.rb} +11 -1
- data/vendor/assets/javascripts/jquery_plugins/jquery.ui.nestedSortable.js +2 -8
- metadata +166 -106
- data/Guardfile +0 -16
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +0 -93
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +0 -122
- data/app/models/alchemy/tree_node.rb +0 -4
- data/app/views/alchemy/admin/pages/_page_infos.html.erb +0 -3
- data/app/views/alchemy/admin/partials/_sub_navigation_tab.html.erb +0 -8
- data/app/views/alchemy/messages/contact_form_mail.text.erb +0 -12
- data/config/initializers/kaminari_config.rb +0 -9
- data/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +0 -21
- data/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +0 -11
- data/lib/alchemy/auth_engine.rb +0 -7
- data/lib/alchemy/authentication_helpers.rb +0 -9
- data/lib/alchemy/ferret_search.rb +0 -84
- data/lib/extensions/array.rb +0 -25
- data/lib/extensions/hash.rb +0 -34
- data/spec/dummy/db/migrate/20130221200514_migrate_attachments_to_dragonfly.rb +0 -21
- data/spec/dummy/db/migrate/20130312205327_change_alchemy_users_role_to_roles.rb +0 -11
- data/spec/models/page_layout_spec.rb +0 -60
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 47456fa8fded3fd78ac81d01bb4dd3b051c34c77
|
4
|
+
data.tar.gz: f94ce0049b27128fe5868a04e13b41376a34db06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d32252e1256371e7c98bee941dfedf654fd5e4115bec71e8181d626c6da0baf9d9b38c2d1cf752a295d12a527ef073d2328ca761c4a83904e6d7dc47af25fbe0
|
7
|
+
data.tar.gz: 91f58b59b4d938486de085b6783b4054bad57b7f8c08740ef3490b621311cd9109d71c5c454c2b61452724be8d211a118c922371bf8a05d836bb394cae983c92
|
data/.simplecov
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
SimpleCov.adapters.define 'alchemy' do
|
2
|
+
add_filter '/spec/'
|
3
|
+
add_filter '/config/'
|
4
|
+
add_filter '/db/'
|
5
|
+
add_filter '/bin/'
|
6
|
+
add_filter '/script/'
|
7
|
+
|
8
|
+
add_group 'Controllers', 'app/controllers/alchemy'
|
9
|
+
add_group 'Models', 'app/models/alchemy'
|
10
|
+
add_group 'Mailers', 'app/mailers/alchemy'
|
11
|
+
add_group 'Helpers', 'app/helpers/alchemy'
|
12
|
+
add_group 'Sweepers', 'app/sweepers'
|
13
|
+
add_group 'Libraries', 'lib'
|
14
|
+
end
|
data/.travis.yml
CHANGED
data/Gemfile
CHANGED
@@ -5,6 +5,7 @@ gemspec
|
|
5
5
|
# For some strange reason it's only loaded outside any group
|
6
6
|
gem 'jasmine'
|
7
7
|
gem 'jasminerice'
|
8
|
+
gem 'multi_json', '1.7.2' # http://stackoverflow.com/q/16543693
|
8
9
|
|
9
10
|
# Code coverage plattform
|
10
11
|
gem 'coveralls', require: false
|
@@ -13,11 +14,12 @@ group :test do
|
|
13
14
|
gem 'sqlite3' if ENV['DB'].nil? || ENV['DB'] == 'sqlite'
|
14
15
|
gem 'mysql2' if ENV['DB'] == 'mysql'
|
15
16
|
gem 'pg' if ENV['DB'] == 'postgresql'
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
unless ENV['FAST_SPECS']
|
18
|
+
gem 'poltergeist'
|
19
|
+
gem 'connection_pool' # https://gist.github.com/mperham/3049152
|
20
|
+
unless ENV['CI']
|
21
|
+
gem 'launchy'
|
22
|
+
end
|
21
23
|
end
|
22
24
|
end
|
23
25
|
|
@@ -29,7 +31,6 @@ end
|
|
29
31
|
|
30
32
|
group :development do
|
31
33
|
unless ENV['CI']
|
32
|
-
gem 'guard-spork'
|
33
34
|
gem 'debugger'
|
34
35
|
gem 'quiet_assets' # Mute assets loggin
|
35
36
|
gem 'thin' # Get rid off 'Could not determine content-length of response body' Warning. Start with 'rails s thin'
|
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
![Alchemy CMS](http://alchemy-cms.com/assets/alchemy_logo.png)
|
2
2
|
|
3
|
-
[![
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/alchemy_cms.png)](http://badge.fury.io/rb/alchemy_cms)
|
4
|
+
[![Build Status](https://secure.travis-ci.org/magiclabs/alchemy_cms.png?branch=2.7-stable)](http://travis-ci.org/magiclabs/alchemy_cms) [![Code Climate](https://codeclimate.com/github/magiclabs/alchemy_cms.png)](https://codeclimate.com/github/magiclabs/alchemy_cms) [![Coverage Status](https://coveralls.io/repos/magiclabs/alchemy_cms/badge.png?branch=2.7-stable)](https://coveralls.io/r/magiclabs/alchemy_cms)
|
4
5
|
|
5
6
|
About
|
6
7
|
-----
|
@@ -42,7 +43,7 @@ If you are looking for a Rails 2.3 compatible version check the [1.6-stable bran
|
|
42
43
|
Ruby Version
|
43
44
|
------------
|
44
45
|
|
45
|
-
Alchemy runs with Ruby 1.9.
|
46
|
+
Alchemy runs with Ruby >= 1.9.3 (including Ruby 2.0.0).
|
46
47
|
|
47
48
|
For a Ruby 1.8.7 compatible version use the [2.3-stable branch](https://github.com/magiclabs/alchemy_cms/tree/2.3-stable).
|
48
49
|
|
@@ -66,7 +67,7 @@ Add to existing Rails project
|
|
66
67
|
|
67
68
|
In your Gemfile:
|
68
69
|
|
69
|
-
gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: '2.
|
70
|
+
gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: '2.7-stable'
|
70
71
|
|
71
72
|
Run in terminal:
|
72
73
|
|
@@ -100,6 +101,14 @@ Tipps
|
|
100
101
|
- Ask the community: http://groups.google.com/group/alchemy-cms
|
101
102
|
|
102
103
|
|
104
|
+
Getting Help
|
105
|
+
------------
|
106
|
+
|
107
|
+
* If you have bugs, please use the [issue tracker on Github](https://github.com/magiclabs/alchemy_cms/issues).
|
108
|
+
* For Q&A and general usage, please use the [User Group](http://groups.google.com/group/alchemy-cms) or the IRC channel.
|
109
|
+
* New features should be discussed on our [Trello Board](https://trello.com/alchemycms). *PLEASE* don't use the Github issues for new features.
|
110
|
+
|
111
|
+
|
103
112
|
Resources
|
104
113
|
---------
|
105
114
|
|
@@ -109,7 +118,8 @@ Resources
|
|
109
118
|
* Issue-Tracker: <https://github.com/magiclabs/alchemy_cms/issues>
|
110
119
|
* Sourcecode: <https://github.com/magiclabs/alchemy_cms>
|
111
120
|
* User Group: <http://groups.google.com/group/alchemy-cms>
|
112
|
-
*
|
121
|
+
* IRC Channel: #alchemy_cms on irc.freenode.net
|
122
|
+
* Discussion Board: <https://trello.com/alchemycms>
|
113
123
|
|
114
124
|
Authors
|
115
125
|
---------
|
@@ -123,4 +133,4 @@ Authors
|
|
123
133
|
License
|
124
134
|
-------
|
125
135
|
|
126
|
-
* BSD: <https://raw.github.com/magiclabs/alchemy_cms/
|
136
|
+
* BSD: <https://raw.github.com/magiclabs/alchemy_cms/2.7-stable/LICENSE>
|
data/alchemy_cms.gemspec
CHANGED
@@ -34,7 +34,6 @@ POST_INSTALL
|
|
34
34
|
|
35
35
|
s.add_runtime_dependency %q<rails>, ["~> 3.2.13"]
|
36
36
|
s.add_runtime_dependency %q<devise>, ["~> 2.2.3"]
|
37
|
-
s.add_runtime_dependency %q<devise-encryptable>, ["~> 0.1.1"]
|
38
37
|
s.add_runtime_dependency %q<awesome_nested_set>, ["~> 2.0"]
|
39
38
|
s.add_runtime_dependency %q<acts-as-taggable-on>, ["~> 2.1"]
|
40
39
|
s.add_runtime_dependency %q<declarative_authorization>, ["~> 0.5.7"]
|
@@ -44,7 +43,7 @@ POST_INSTALL
|
|
44
43
|
s.add_runtime_dependency %q<acts_as_list>, ["~> 0.2.0"]
|
45
44
|
s.add_runtime_dependency %q<magiclabs-userstamp>, ["~> 2.0.2"]
|
46
45
|
s.add_runtime_dependency %q<dynamic_form>, ["~> 1.1"]
|
47
|
-
s.add_runtime_dependency %q<jquery-rails>, ["~>
|
46
|
+
s.add_runtime_dependency %q<jquery-rails>, ["~> 3.0.4"]
|
48
47
|
s.add_runtime_dependency %q<jquery-ui-rails>, ["~> 3.0.1"]
|
49
48
|
s.add_runtime_dependency %q<sass-rails>, ['~> 3.2.3']
|
50
49
|
s.add_runtime_dependency %q<coffee-rails>, ['~> 3.2.1']
|
@@ -52,11 +51,13 @@ POST_INSTALL
|
|
52
51
|
s.add_runtime_dependency %q<sassy-buttons>, ['~> 0.1.3']
|
53
52
|
s.add_runtime_dependency %q<rails3-jquery-autocomplete>, ['~> 1.0.10']
|
54
53
|
s.add_runtime_dependency %q<tvdeyen-handles_sortable_columns>, ['~> 0.1.5']
|
54
|
+
s.add_runtime_dependency %q<spinner.rb>
|
55
55
|
|
56
56
|
s.add_development_dependency %q<bumpy>
|
57
57
|
s.add_development_dependency %q<capybara>, ['~> 2.0.3']
|
58
58
|
s.add_development_dependency %q<factory_girl_rails>
|
59
59
|
s.add_development_dependency %q<rspec-rails>, ['~> 2.13.1']
|
60
|
+
s.add_development_dependency %q<sqlite3>
|
60
61
|
s.add_development_dependency %q<yard>
|
61
62
|
s.add_development_dependency %q<redcarpet>
|
62
63
|
|
@@ -42,23 +42,6 @@ $.extend Alchemy,
|
|
42
42
|
$overlay.css "visibility", "hidden"
|
43
43
|
return
|
44
44
|
|
45
|
-
# Checks if the element is dirty (has unsaved changes)
|
46
|
-
# and only calls the Alchemy.ElementEditors.toggleFold function, if it is not dirty.
|
47
|
-
toggleElement: (id, text) ->
|
48
|
-
if Alchemy.isPageDirty()
|
49
|
-
Alchemy.openConfirmWindow
|
50
|
-
title: text.title
|
51
|
-
message: text.message
|
52
|
-
okLabel: text.okLabel
|
53
|
-
cancelLabel: text.cancelLabel
|
54
|
-
okCallback: ->
|
55
|
-
Alchemy.ElementEditors.toggleFold id
|
56
|
-
return
|
57
|
-
false
|
58
|
-
else
|
59
|
-
Alchemy.ElementEditors.toggleFold id
|
60
|
-
return
|
61
|
-
|
62
45
|
# Shows spinner while loading images and
|
63
46
|
# fades the image after its been loaded
|
64
47
|
ImageLoader: (scope = document, options = {color: '#fff'}) ->
|
@@ -127,6 +110,15 @@ $.extend Alchemy,
|
|
127
110
|
console.trace()
|
128
111
|
return
|
129
112
|
|
113
|
+
# Translates given string
|
114
|
+
#
|
115
|
+
_t: (id) ->
|
116
|
+
translation = Alchemy.translations[id]
|
117
|
+
if (translation)
|
118
|
+
translation[Alchemy.locale]
|
119
|
+
else
|
120
|
+
id
|
121
|
+
|
130
122
|
getUrlParam: (name) ->
|
131
123
|
results = new RegExp("[\\?&]" + name + "=([^&#]*)").exec(window.location.href)
|
132
124
|
results[1] or 0 if results
|
@@ -0,0 +1,70 @@
|
|
1
|
+
window.Alchemy = {} if typeof (window.Alchemy) is "undefined"
|
2
|
+
|
3
|
+
$.extend Alchemy,
|
4
|
+
|
5
|
+
ElementDirtyObserver: (selector) ->
|
6
|
+
$elements = $(selector)
|
7
|
+
$elements.find('input[type="text"], select').change ->
|
8
|
+
$this = $(this)
|
9
|
+
$this.addClass('dirty')
|
10
|
+
Alchemy.setElementDirty $this.parents(".element_editor")
|
11
|
+
$elements.find('.element_foot input[type="checkbox"]').click ->
|
12
|
+
$this = $(this)
|
13
|
+
$this.addClass "dirty"
|
14
|
+
Alchemy.setElementDirty $this.parents(".element_editor")
|
15
|
+
|
16
|
+
setElementDirty: (element) ->
|
17
|
+
$element = $(element)
|
18
|
+
$element
|
19
|
+
.addClass('dirty')
|
20
|
+
.find('.element_head .icon')
|
21
|
+
.addClass('element_dirty')
|
22
|
+
window.onbeforeunload = @pageUnload
|
23
|
+
|
24
|
+
pageUnload: ->
|
25
|
+
Alchemy.pleaseWaitOverlay(false)
|
26
|
+
Alchemy._t('page_dirty_notice')
|
27
|
+
|
28
|
+
setElementClean: (element) ->
|
29
|
+
$element = $(element)
|
30
|
+
$element
|
31
|
+
.removeClass('dirty')
|
32
|
+
.find('.element_foot input[type="checkbox"], input[type="text"], select')
|
33
|
+
.removeClass('dirty')
|
34
|
+
$element.find('.element_head .icon').removeClass('element_dirty')
|
35
|
+
window.onbeforeunload = undefined
|
36
|
+
|
37
|
+
isPageDirty: ->
|
38
|
+
$('#element_area').find('.element_editor.dirty').length > 0
|
39
|
+
|
40
|
+
isElementDirty: (element) ->
|
41
|
+
$(element).hasClass('dirty')
|
42
|
+
|
43
|
+
checkPageDirtyness: (element) ->
|
44
|
+
okcallback = undefined
|
45
|
+
if $(element).is("form")
|
46
|
+
okcallback = ->
|
47
|
+
$form = $("<form action=\"#{element.action}\" method=\"POST\" style=\"display: none\" />")
|
48
|
+
$form.append $(element).find("input")
|
49
|
+
$form.appendTo "body"
|
50
|
+
Alchemy.pleaseWaitOverlay()
|
51
|
+
$form.submit()
|
52
|
+
else if $(element).is("a")
|
53
|
+
okcallback = ->
|
54
|
+
Alchemy.pleaseWaitOverlay()
|
55
|
+
document.location = element.pathname
|
56
|
+
if Alchemy.isPageDirty()
|
57
|
+
Alchemy.pleaseWaitOverlay(false)
|
58
|
+
Alchemy.openConfirmWindow
|
59
|
+
title: Alchemy._t('warning')
|
60
|
+
message: Alchemy._t('page_dirty_notice')
|
61
|
+
okLabel: Alchemy._t('ok')
|
62
|
+
cancelLabel: Alchemy._t('cancel')
|
63
|
+
okCallback: okcallback
|
64
|
+
false
|
65
|
+
else
|
66
|
+
true
|
67
|
+
|
68
|
+
PageLeaveObserver: ->
|
69
|
+
$("#main_navi a").click (event) ->
|
70
|
+
event.preventDefault() unless Alchemy.checkPageDirtyness(event.currentTarget)
|
@@ -0,0 +1,80 @@
|
|
1
|
+
window.Alchemy = {} if typeof (window.Alchemy) is "undefined"
|
2
|
+
|
3
|
+
$.extend Alchemy,
|
4
|
+
|
5
|
+
SortableElements: (page_id, form_token, selector) ->
|
6
|
+
selector = "#element_area .sortable_cell" if typeof (selector) is "undefined"
|
7
|
+
$(selector).sortable
|
8
|
+
items: "div.element_editor"
|
9
|
+
handle: ".element_handle"
|
10
|
+
axis: "y"
|
11
|
+
placeholder: "droppable_element_placeholder"
|
12
|
+
forcePlaceholderSize: true
|
13
|
+
dropOnEmpty: true
|
14
|
+
opacity: 0.5
|
15
|
+
cursor: "move"
|
16
|
+
tolerance: "pointer"
|
17
|
+
update: (event, ui) ->
|
18
|
+
ids = $.map $(this).children(), (child) ->
|
19
|
+
$(child).attr "data-element-id"
|
20
|
+
params_string = ""
|
21
|
+
cell_id = $(this).attr("data-cell-id")
|
22
|
+
# Is the trash window open?
|
23
|
+
if $("#alchemyTrashWindow").length > 0
|
24
|
+
# updating the trash icon
|
25
|
+
if $("#trash_items div.element_editor").not(".dragged").length is 0
|
26
|
+
$("#element_trash_button .icon").removeClass "full"
|
27
|
+
$("#trash_empty_notice").show()
|
28
|
+
$(event.target).css "cursor", "progress"
|
29
|
+
params_string = "page_id=" + page_id + "&authenticity_token=" + encodeURIComponent(form_token) + "&" + $.param(element_ids: ids)
|
30
|
+
params_string += "&cell_id=" + cell_id if cell_id
|
31
|
+
$.ajax
|
32
|
+
url: Alchemy.routes.order_admin_elements_path
|
33
|
+
type: "POST"
|
34
|
+
data: params_string
|
35
|
+
complete: ->
|
36
|
+
$(event.target).css "cursor", "auto"
|
37
|
+
Alchemy.TrashWindow.refresh page_id
|
38
|
+
|
39
|
+
start: (event, ui) ->
|
40
|
+
$textareas = ui.item.find("textarea.default_tinymce, textarea.custom_tinymce")
|
41
|
+
Alchemy.Tinymce.removeEditor $textareas
|
42
|
+
|
43
|
+
stop: (event, ui) ->
|
44
|
+
$textareas = ui.item.find("textarea.default_tinymce, textarea.custom_tinymce")
|
45
|
+
Alchemy.Tinymce.addEditor $textareas
|
46
|
+
|
47
|
+
SortableContents: (selector, token) ->
|
48
|
+
$(selector).sortable
|
49
|
+
items: "div.dragable_picture"
|
50
|
+
handle: "div.picture_handle"
|
51
|
+
opacity: 0.5
|
52
|
+
cursor: "move"
|
53
|
+
tolerance: "pointer"
|
54
|
+
containment: "parent"
|
55
|
+
update: (event, ui) ->
|
56
|
+
ids = $.map $(this).children("div.dragable_picture"), (child) ->
|
57
|
+
child.id.replace /essence_picture_/, ""
|
58
|
+
$(event.originalTarget).css "cursor", "progress"
|
59
|
+
$.ajax
|
60
|
+
url: Alchemy.routes.order_admin_contents_path
|
61
|
+
type: "POST"
|
62
|
+
data: "authenticity_token=" + encodeURIComponent(token) + "&" + $.param(content_ids: ids)
|
63
|
+
complete: ->
|
64
|
+
$(event.originalTarget).css "cursor", "move"
|
65
|
+
|
66
|
+
DraggableTrashItems: (items_n_cells) ->
|
67
|
+
$("#trash_items div.draggable").each ->
|
68
|
+
cell_classes = ""
|
69
|
+
cell_names = items_n_cells[@id]
|
70
|
+
$.each cell_names, (i) ->
|
71
|
+
cell_classes += "." + this + "_cell" + ", "
|
72
|
+
$(this).draggable
|
73
|
+
helper: "clone"
|
74
|
+
iframeFix: "iframe#alchemyPreviewWindow"
|
75
|
+
connectToSortable: cell_classes.replace(/,.$/, "")
|
76
|
+
start: (event, ui) ->
|
77
|
+
$(this).hide().addClass "dragged"
|
78
|
+
ui.helper.css width: "300px"
|
79
|
+
stop: ->
|
80
|
+
$(this).show().removeClass "dragged"
|
@@ -9,30 +9,33 @@ window.Alchemy = {} if typeof(window.Alchemy) is 'undefined'
|
|
9
9
|
Alchemy.ElementEditors =
|
10
10
|
|
11
11
|
# Binds all events to element editor partials.
|
12
|
+
#
|
12
13
|
# Calles once per page load.
|
14
|
+
#
|
13
15
|
init: ->
|
14
16
|
$elements = $("#element_area .element_editor")
|
15
17
|
self = Alchemy.ElementEditors
|
16
18
|
self.reinit $elements
|
17
|
-
return
|
18
19
|
|
19
|
-
# Binds events to all given element editors
|
20
|
+
# Binds events to all given element editors.
|
21
|
+
#
|
20
22
|
# Called after replacing element editors via ajax.
|
23
|
+
#
|
21
24
|
reinit: (elements) ->
|
22
25
|
self = Alchemy.ElementEditors
|
23
26
|
$elements = $(elements)
|
24
27
|
$elements.each ->
|
25
28
|
self.bindEvent this
|
26
|
-
return
|
27
29
|
$elements.find(".element_head").click self.onClickElement
|
28
30
|
$elements.find(".element_head").dblclick ->
|
29
31
|
id = $(this).parent().attr("id").replace(/\D/g, "")
|
30
|
-
self.
|
31
|
-
|
32
|
-
return
|
32
|
+
self.toggle id
|
33
|
+
Alchemy.ElementEditors.observeToggler($elements)
|
33
34
|
|
34
35
|
# Click event handler.
|
36
|
+
#
|
35
37
|
# Also triggers custom 'Alchemy.SelectElement' event on target element in preview frame.
|
38
|
+
#
|
36
39
|
onClickElement: (e) ->
|
37
40
|
self = Alchemy.ElementEditors
|
38
41
|
$element = $(this).parent(".element_editor")
|
@@ -44,20 +47,22 @@ Alchemy.ElementEditors =
|
|
44
47
|
$frame_elements = document.getElementById("alchemyPreviewWindow").contentWindow.jQuery("[data-alchemy-element]")
|
45
48
|
$selected_element = $frame_elements.closest("[data-alchemy-element=\"" + id + "\"]")
|
46
49
|
$selected_element.trigger "Alchemy.SelectElement"
|
47
|
-
return
|
48
50
|
|
49
51
|
# Binds the custom 'Alchemy.SelectElementEditor' event.
|
52
|
+
#
|
50
53
|
# Triggered, if an element gets selected inside the preview iframe.
|
54
|
+
#
|
51
55
|
bindEvent: (element) ->
|
52
56
|
self = Alchemy.ElementEditors
|
53
57
|
$(element).bind "Alchemy.SelectElementEditor", self.selectElement
|
54
|
-
return
|
55
58
|
|
56
59
|
# Selects an element in the element window.
|
60
|
+
#
|
57
61
|
# Expands the element, if necessary.
|
58
62
|
# Also chooses the right cell, if necessary.
|
59
63
|
# Can be triggered through custom event 'Alchemy.SelectElementEditor'
|
60
64
|
# Used by the elements on click events in the preview frame.
|
65
|
+
#
|
61
66
|
selectElement: (e) ->
|
62
67
|
self = Alchemy.ElementEditors
|
63
68
|
id = @id.replace(/\D/g, "")
|
@@ -74,25 +79,44 @@ Alchemy.ElementEditors =
|
|
74
79
|
self.toggleFold id
|
75
80
|
else
|
76
81
|
self.scrollToElement this
|
77
|
-
return
|
78
82
|
|
79
83
|
# Scrolls the element window to given element editor dom element.
|
84
|
+
#
|
80
85
|
scrollToElement: (el) ->
|
81
86
|
$("#alchemyElementWindow").scrollTo el,
|
82
87
|
duration: 400
|
83
88
|
offset: -10
|
84
|
-
|
89
|
+
|
90
|
+
# Expands or folds a element editor
|
91
|
+
#
|
92
|
+
# If the element is dirty (has unsaved changes) it displays a warning.
|
93
|
+
#
|
94
|
+
toggle: (id, text) ->
|
95
|
+
el = $("#element_#{id}")
|
96
|
+
if Alchemy.isElementDirty(el)
|
97
|
+
Alchemy.openConfirmWindow
|
98
|
+
title: Alchemy._t('warning')
|
99
|
+
message: Alchemy._t('element_dirty_notice')
|
100
|
+
okLabel: Alchemy._t('ok')
|
101
|
+
cancelLabel: Alchemy._t('cancel')
|
102
|
+
okCallback: =>
|
103
|
+
@toggleFold id
|
104
|
+
false
|
105
|
+
else
|
106
|
+
@toggleFold id
|
85
107
|
|
86
108
|
# Folds or expands the element editor with the given id.
|
109
|
+
#
|
87
110
|
toggleFold: (id) ->
|
88
|
-
self = Alchemy.ElementEditors
|
89
111
|
spinner = Alchemy.Spinner.small()
|
90
|
-
element = $('.ajax_folder',
|
91
|
-
$("#element_
|
92
|
-
element.prepend
|
93
|
-
$.post Alchemy.routes.fold_admin_element_path(id),
|
94
|
-
$("#element_
|
112
|
+
element = $('.ajax_folder', "#element_#{id}")
|
113
|
+
$("#element_#{id}_folder").hide()
|
114
|
+
element.prepend spinner.spin().el
|
115
|
+
$.post Alchemy.routes.fold_admin_element_path(id), =>
|
116
|
+
$("#element_#{id}_folder").show()
|
95
117
|
spinner.stop()
|
96
|
-
|
97
|
-
|
98
|
-
|
118
|
+
@scrollToElement "#element_#{id}"
|
119
|
+
|
120
|
+
observeToggler: (scope) ->
|
121
|
+
$('[data-element-dirty]', scope).click ->
|
122
|
+
Alchemy.ElementEditors.toggle $(this).data('element-dirty')
|