alchemy_cms 3.0.4 → 3.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/Gemfile +4 -7
- data/README.md +207 -115
- data/alchemy_cms.gemspec +10 -9
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -2
- data/app/assets/javascripts/alchemy/alchemy.image_cropper.js.coffee +2 -2
- data/app/assets/javascripts/alchemy/alchemy.js +6 -7
- data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +1 -43
- data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +1 -1
- data/app/assets/stylesheets/alchemy/_mixins.scss +2 -1
- data/app/assets/stylesheets/alchemy/buttons.scss +0 -5
- data/app/assets/stylesheets/alchemy/dialogs.scss +1 -0
- data/app/assets/stylesheets/alchemy/frame.scss +9 -12
- data/app/assets/stylesheets/tinymce/skins/alchemy/content.min.css.scss +11 -2
- data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +9 -1
- data/app/controllers/alchemy/admin/attachments_controller.rb +2 -4
- data/app/controllers/alchemy/admin/essence_pictures_controller.rb +34 -38
- data/app/controllers/alchemy/api/base_controller.rb +19 -0
- data/app/controllers/alchemy/api/contents_controller.rb +35 -0
- data/app/controllers/alchemy/api/elements_controller.rb +29 -0
- data/app/controllers/alchemy/api/pages_controller.rb +32 -0
- data/app/controllers/alchemy/contents_controller.rb +1 -0
- data/app/controllers/alchemy/elements_controller.rb +5 -2
- data/app/controllers/alchemy/pages_controller.rb +4 -1
- data/app/controllers/alchemy/pictures_controller.rb +4 -36
- data/app/helpers/alchemy/admin/essences_helper.rb +5 -2
- data/app/helpers/alchemy/essences_helper.rb +14 -1
- data/app/models/alchemy/content.rb +32 -4
- data/app/models/alchemy/element.rb +2 -16
- data/app/models/alchemy/element/presenters.rb +2 -2
- data/app/models/alchemy/essence_file.rb +5 -0
- data/app/models/alchemy/essence_picture.rb +12 -8
- data/app/models/alchemy/picture.rb +1 -74
- data/app/models/alchemy/picture/transformations.rb +249 -0
- data/app/serializers/alchemy/content_serializer.rb +3 -10
- data/app/serializers/alchemy/element_serializer.rb +6 -3
- data/app/serializers/alchemy/legacy_element_serializer.rb +17 -0
- data/app/views/alchemy/admin/dashboard/_sites.html.erb +14 -4
- data/app/views/alchemy/admin/essence_pictures/crop.html.erb +8 -5
- data/app/views/alchemy/admin/pages/edit.html.erb +9 -9
- data/app/views/alchemy/admin/pictures/info.html.erb +2 -3
- data/app/views/alchemy/admin/tags/edit.html.erb +1 -1
- data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +8 -7
- data/app/views/alchemy/essences/_essence_boolean_view.html.erb +3 -3
- data/app/views/alchemy/essences/_essence_date_editor.html.erb +8 -2
- data/app/views/alchemy/essences/_essence_date_view.html.erb +10 -8
- data/app/views/alchemy/essences/_essence_file_editor.html.erb +48 -53
- data/app/views/alchemy/essences/_essence_file_view.html.erb +5 -5
- data/app/views/alchemy/essences/_essence_html_editor.html.erb +5 -4
- data/app/views/alchemy/essences/_essence_link_editor.html.erb +17 -15
- data/app/views/alchemy/essences/_essence_link_view.html.erb +11 -7
- data/app/views/alchemy/essences/_essence_picture_editor.html.erb +4 -2
- data/app/views/alchemy/essences/_essence_picture_view.html.erb +4 -2
- data/app/views/alchemy/essences/_essence_richtext_view.html.erb +5 -4
- data/app/views/alchemy/essences/_essence_select_editor.html.erb +22 -32
- data/app/views/alchemy/essences/_essence_text_view.html.erb +7 -6
- data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
- data/app/views/layouts/alchemy/admin.html.erb +5 -3
- data/config/initializers/inflections.rb +3 -0
- data/config/initializers/simple_form.rb +1 -1
- data/config/locales/alchemy.en.yml +0 -1
- data/config/routes.rb +14 -0
- data/lib/alchemy/capistrano.rb +71 -0
- data/lib/alchemy/engine.rb +0 -3
- data/lib/alchemy/essence.rb +1 -1
- data/lib/alchemy/permissions.rb +19 -5
- data/lib/alchemy/picture_attributes.rb +1 -1
- data/lib/alchemy/test_support/auth_helpers.rb +1 -1
- data/lib/alchemy/test_support/essence_shared_examples.rb +37 -22
- data/lib/alchemy/test_support/integration_helpers.rb +1 -1
- data/lib/alchemy/tinymce.rb +21 -4
- data/lib/alchemy/upgrader/three_point_one.rb +43 -0
- data/lib/alchemy/upgrader/three_point_zero.rb +13 -0
- data/lib/alchemy/version.rb +2 -1
- data/lib/rails/generators/alchemy/module/module_generator.rb +30 -0
- data/lib/rails/generators/alchemy/module/templates/ability.rb.tt +11 -0
- data/lib/rails/generators/alchemy/module/templates/controller.rb.tt +2 -0
- data/lib/rails/generators/alchemy/module/templates/module_config.rb.tt +15 -0
- data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +0 -1
- data/lib/rails/templates/alchemy.rb +2 -2
- data/lib/tasks/alchemy/db.rake +7 -1
- data/spec/controllers/admin/attachments_controller_spec.rb +38 -38
- data/spec/controllers/admin/base_controller_spec.rb +18 -18
- data/spec/controllers/admin/clipboard_controller_spec.rb +23 -18
- data/spec/controllers/admin/contents_controller_spec.rb +33 -27
- data/spec/controllers/admin/dashboard_controller_spec.rb +14 -14
- data/spec/controllers/admin/elements_controller_spec.rb +125 -105
- data/spec/controllers/admin/essence_files_controller_spec.rb +6 -7
- data/spec/controllers/admin/essence_pictures_controller_spec.rb +52 -42
- data/spec/controllers/admin/languages_controller_spec.rb +3 -3
- data/spec/controllers/admin/pages_controller_spec.rb +81 -71
- data/spec/controllers/admin/pictures_controller_spec.rb +69 -72
- data/spec/controllers/admin/resources_controller_spec.rb +5 -5
- data/spec/controllers/admin/trash_controller_spec.rb +15 -12
- data/spec/controllers/alchemy/admin/tags_controller_spec.rb +8 -8
- data/spec/controllers/alchemy/api/contents_controller_spec.rb +73 -0
- data/spec/controllers/alchemy/api/elements_controller_spec.rb +69 -0
- data/spec/controllers/alchemy/api/pages_controller_spec.rb +86 -0
- data/spec/controllers/attachments_controller_spec.rb +8 -8
- data/spec/controllers/contents_controller_spec.rb +22 -0
- data/spec/controllers/elements_controller_spec.rb +10 -4
- data/spec/controllers/messages_controller_spec.rb +35 -34
- data/spec/controllers/pages_controller_spec.rb +37 -28
- data/spec/controllers/pictures_controller_spec.rb +90 -23
- data/spec/dummy/app/models/dummy_user.rb +0 -4
- data/spec/dummy/app/views/alchemy/elements/_all_you_can_eat_editor.html.erb +11 -0
- data/spec/dummy/config/alchemy/elements.yml +22 -1
- data/spec/dummy/config/alchemy/page_layouts.yml +4 -0
- data/spec/dummy/config/application.rb +2 -1
- data/spec/dummy/config/environments/test.rb +3 -1
- data/spec/features/admin/dashboard_spec.rb +41 -6
- data/spec/features/admin/language_tree_feature_spec.rb +3 -3
- data/spec/features/admin/legacy_page_url_management_spec.rb +1 -1
- data/spec/features/admin/link_overlay_spec.rb +7 -7
- data/spec/features/admin/locale_select_feature_spec.rb +5 -2
- data/spec/features/admin/modules_integration_spec.rb +1 -1
- data/spec/features/admin/page_creation_feature_spec.rb +3 -2
- data/spec/features/admin/page_editing_feature_spec.rb +66 -79
- data/spec/features/admin/picture_library_integration_spec.rb +8 -8
- data/spec/features/admin/resources_integration_spec.rb +21 -21
- data/spec/features/admin/tinymce_feature_spec.rb +36 -0
- data/spec/features/navigation_spec.rb +1 -1
- data/spec/features/page_feature_spec.rb +34 -34
- data/spec/features/picture_security_spec.rb +4 -4
- data/spec/features/security_spec.rb +1 -1
- data/spec/features/translation_integration_spec.rb +7 -7
- data/spec/helpers/admin/base_helper_spec.rb +51 -49
- data/spec/helpers/admin/contents_helper_spec.rb +11 -11
- data/spec/helpers/admin/elements_helper_spec.rb +20 -17
- data/spec/helpers/admin/essences_helper_spec.rb +42 -11
- data/spec/helpers/admin/navigation_helper_spec.rb +64 -54
- data/spec/helpers/admin/pages_helper_spec.rb +10 -10
- data/spec/helpers/admin/tags_helper_spec.rb +16 -16
- data/spec/helpers/base_helper_spec.rb +11 -11
- data/spec/helpers/elements_block_helper_spec.rb +24 -24
- data/spec/helpers/elements_helper_spec.rb +46 -46
- data/spec/helpers/essences_helper_spec.rb +90 -17
- data/spec/helpers/pages_helper_spec.rb +53 -53
- data/spec/helpers/picture_url_helpers_spec.rb +6 -6
- data/spec/helpers/url_helper_spec.rb +32 -32
- data/spec/libraries/config_spec.rb +9 -9
- data/spec/libraries/controller_actions_spec.rb +14 -14
- data/spec/libraries/i18n_spec.rb +6 -6
- data/spec/libraries/kaminari/scoped_pagination_url_helper_spec.rb +4 -4
- data/spec/libraries/modules_spec.rb +4 -4
- data/spec/libraries/mount_point_spec.rb +13 -13
- data/spec/libraries/page_layout_spec.rb +24 -24
- data/spec/libraries/permissions_spec.rb +97 -80
- data/spec/libraries/resource_spec.rb +37 -37
- data/spec/libraries/resources_helper_spec.rb +19 -19
- data/spec/libraries/shell_spec.rb +17 -17
- data/spec/libraries/template_tracker_spec.rb +14 -14
- data/spec/libraries/tinymce_spec.rb +8 -8
- data/spec/libraries/userstamp_spec.rb +2 -2
- data/spec/mailers/messages_spec.rb +4 -4
- data/spec/models/attachment_spec.rb +86 -30
- data/spec/models/cell_spec.rb +10 -10
- data/spec/models/content_spec.rb +106 -46
- data/spec/models/element_spec.rb +94 -115
- data/spec/models/essence_date_spec.rb +1 -1
- data/spec/models/essence_file_spec.rb +4 -4
- data/spec/models/essence_picture_spec.rb +56 -25
- data/spec/models/essence_richtext_spec.rb +1 -1
- data/spec/models/essence_text_spec.rb +7 -7
- data/spec/models/language_spec.rb +12 -12
- data/spec/models/legacy_page_url_spec.rb +2 -2
- data/spec/models/message_spec.rb +12 -5
- data/spec/models/page_spec.rb +259 -235
- data/spec/models/picture_spec.rb +72 -166
- data/spec/models/site_spec.rb +41 -41
- data/spec/models/tag_spec.rb +7 -7
- data/spec/routing/api_routing_spec.rb +150 -0
- data/spec/routing/routing_spec.rb +28 -28
- data/spec/spec_helper.rb +6 -5
- data/spec/support/hint_examples.rb +5 -5
- data/spec/support/transformation_examples.rb +173 -0
- data/spec/tasks/helpers_spec.rb +29 -29
- data/spec/views/essences/essence_boolean_editor_spec.rb +32 -0
- data/spec/views/essences/essence_boolean_view_spec.rb +2 -2
- data/spec/views/essences/essence_date_view_spec.rb +1 -1
- data/spec/views/essences/essence_link_view_spec.rb +11 -0
- data/spec/views/essences/essence_picture_view_spec.rb +56 -11
- data/spec/views/essences/essence_richtext_view_spec.rb +12 -0
- data/spec/views/essences/essence_text_view_spec.rb +12 -0
- data/vendor/assets/javascripts/tinymce/langs/de.js +20 -2
- data/vendor/assets/javascripts/tinymce/langs/fr.js +14 -1
- data/vendor/assets/javascripts/tinymce/langs/nl.js +22 -4
- data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/code/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/link/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/plugins/table/plugin.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/themes/modern/theme.min.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.min.js +11 -10
- metadata +72 -42
- data/app/views/alchemy/messages/contact_form_mail.es.text.erb +0 -12
- data/config/locales/alchemy.es.yml +0 -958
- data/config/locales/alchemy.ru.yml +0 -837
- data/config/locales/simple_form.es.yml +0 -6
- data/config/locales/simple_form.ru.yml +0 -25
- data/lib/rails/generators/alchemy/scaffold/files/alchemy.es.yml +0 -31
- data/vendor/assets/javascripts/tinymce/langs/es.js +0 -197
- data/vendor/assets/javascripts/tinymce/langs/ru.js +0 -197
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8ff921fd176dd5ee1ffbbb6c23b73d3a03f6f05
|
4
|
+
data.tar.gz: 09825c9d513e598cab488839e88f80ef301f2c67
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5baf66ef54d6670f7f8f05d5a55bdfef93d7725c9084d12dd84cd430851ff261190473837555fb767fd9822326582474c71b15e088a53dbf4e96e44473a3d85d
|
7
|
+
data.tar.gz: e3cfe5a46b73571a77da7296df1b1d8c978b7ab6004e6f7ce9e8b9c42e1910cd0e24cac3ab81f1edc5238e7d7a492889d9e266b3cfa47f975de6daa1a5b11e1a
|
data/.travis.yml
CHANGED
@@ -1,19 +1,17 @@
|
|
1
1
|
language: ruby
|
2
|
-
sudo: false
|
3
|
-
cache: bundler
|
4
2
|
rvm:
|
5
3
|
- 1.9.3
|
6
4
|
- 2.0.0
|
7
5
|
- 2.1
|
8
6
|
branches:
|
9
7
|
only:
|
10
|
-
-
|
11
|
-
before_script: '
|
12
|
-
script:
|
8
|
+
- master
|
9
|
+
before_script: 'rake alchemy:spec:prepare'
|
10
|
+
script: rspec
|
13
11
|
env:
|
14
12
|
- DB=mysql
|
15
13
|
- DB=postgresql
|
16
|
-
- RAILS_VERSION=4.
|
14
|
+
- RAILS_VERSION=4.1.5
|
17
15
|
notifications:
|
18
16
|
irc:
|
19
17
|
on_success: change
|
data/Gemfile
CHANGED
@@ -3,15 +3,12 @@ source 'http://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
if ENV['RAILS_VERSION']
|
6
|
-
gem 'rails', ENV['RAILS_VERSION']
|
6
|
+
gem 'rails', "~> #{ENV['RAILS_VERSION']}"
|
7
7
|
end
|
8
8
|
|
9
9
|
# Code coverage plattform
|
10
10
|
gem 'coveralls', require: false
|
11
11
|
|
12
|
-
# Fixes issues with wrong exit codes. See: https://github.com/colszowka/simplecov/issues/269
|
13
|
-
gem 'simplecov', '0.7.1'
|
14
|
-
|
15
12
|
gem 'database_cleaner'
|
16
13
|
|
17
14
|
group :test do
|
@@ -19,6 +16,7 @@ group :test do
|
|
19
16
|
gem 'mysql2' if ENV['DB'] == 'mysql'
|
20
17
|
gem 'pg' if ENV['DB'] == 'postgresql'
|
21
18
|
gem 'poltergeist'
|
19
|
+
gem 'rspec-activemodel-mocks'
|
22
20
|
unless ENV['CI']
|
23
21
|
gem 'launchy'
|
24
22
|
end
|
@@ -27,12 +25,11 @@ end
|
|
27
25
|
group :development, :test do
|
28
26
|
unless ENV['CI']
|
29
27
|
gem 'annotate'
|
30
|
-
gem 'pry'
|
31
28
|
gem 'bumpy'
|
32
29
|
gem 'yard'
|
33
30
|
gem 'redcarpet'
|
34
|
-
gem 'pry-
|
35
|
-
gem 'spring'
|
31
|
+
gem 'pry-byebug'
|
32
|
+
gem 'spring'
|
36
33
|
gem 'spring-commands-rspec'
|
37
34
|
end
|
38
35
|
gem 'jasmine-rails', github: 'searls/jasmine-rails'
|
data/README.md
CHANGED
@@ -1,32 +1,31 @@
|
|
1
|
-
[![Gem Version](https://badge.fury.io/rb/alchemy_cms.
|
2
|
-
[![Build Status](https://travis-ci.org/
|
1
|
+
[![Gem Version](https://badge.fury.io/rb/alchemy_cms.png)](http://badge.fury.io/rb/alchemy_cms)
|
2
|
+
[![Build Status](https://travis-ci.org/magiclabs/alchemy_cms.svg?branch=master)](https://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=master)](https://coveralls.io/r/magiclabs/alchemy_cms?branch=master)
|
3
|
+
|
4
|
+
**CAUTION: This master branch is a development branch that can contain bugs. For productive environments you should use the [current Ruby gem version](http://rubygems.org/gems/alchemy_cms/versions/3.0.0), or the [latest stable branch (3.0-stable)](https://github.com/magiclabs/alchemy_cms/tree/3.0-stable).**
|
3
5
|
|
4
6
|
About
|
5
7
|
-----
|
6
8
|
|
7
9
|
![Alchemy CMS](http://alchemy-cms.com/assets/alchemy_logo.svg)
|
8
10
|
|
9
|
-
Alchemy is
|
11
|
+
Alchemy is a powerful, flexible and user centric Rails CMS.
|
10
12
|
|
11
|
-
Read more on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
|
13
|
+
Read more about Alchemy on the [website](http://alchemy-cms.com) and in the [guidelines](http://guides.alchemy-cms.com).
|
12
14
|
|
13
15
|
Features
|
14
16
|
--------
|
15
17
|
|
16
|
-
- Highly flexible
|
17
|
-
-
|
18
|
-
-
|
19
|
-
-
|
20
|
-
-
|
21
|
-
-
|
22
|
-
- RSS Feeds
|
23
|
-
- Contactforms
|
18
|
+
- Highly flexible templating that completely separates content from markup
|
19
|
+
- End-User centric graphical user interface
|
20
|
+
- Multi language and multi domain
|
21
|
+
- SEO friendly urls
|
22
|
+
- User Access Control
|
23
|
+
- Build in contact form mailer
|
24
24
|
- Attachments and downloads
|
25
25
|
- Powerful image rendering
|
26
|
-
- Extendable
|
27
|
-
- Integrates
|
28
|
-
-
|
29
|
-
- BSD License
|
26
|
+
- Extendable via Rails engines
|
27
|
+
- Integrates into existing Rails Apps
|
28
|
+
- Flexible caching
|
30
29
|
- Hostable on any Server that supports Ruby on Rails, a SQL Database and ImageMagick
|
31
30
|
|
32
31
|
Rails Version
|
@@ -34,181 +33,261 @@ Rails Version
|
|
34
33
|
|
35
34
|
**This version of Alchemy CMS runs with Rails 4 (including 4.1)**
|
36
35
|
|
37
|
-
|
38
|
-
|
39
|
-
If you are looking for a Rails 3.1 compatible version check the [2.1-stable branch](https://github.com/AlchemyCMS/alchemy_cms/tree/2.1-stable).
|
36
|
+
**Rails 4.2 support is coming soon. Watch [this pull request](https://github.com/magiclabs/alchemy_cms/pull/655).**
|
40
37
|
|
41
|
-
|
42
|
-
|
43
|
-
|
38
|
+
* For a Rails 3.2 compatible version use the [`2.8-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.8-stable).
|
39
|
+
* For a Rails 3.1 compatible version use the [`2.1-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.1-stable).
|
40
|
+
* For a Rails 3.0 compatible version use the [`2.0-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/2.0-stable).
|
41
|
+
* For a Rails 2.3 compatible version use the [`1.6-stable` branch](https://github.com/magiclabs/alchemy_cms/tree/1.6-stable).
|
44
42
|
|
45
43
|
Ruby Version
|
46
44
|
------------
|
47
45
|
|
48
46
|
Alchemy runs with Ruby >= 1.9.3 (including Ruby 2.0 and 2.1).
|
49
47
|
|
50
|
-
For a Ruby 1.8.7 compatible version use the [2.3-stable branch](https://github.com/
|
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).
|
51
49
|
|
52
50
|
|
53
51
|
Installation
|
54
52
|
------------
|
55
53
|
|
56
|
-
###
|
54
|
+
### Install as a standalone project
|
57
55
|
|
58
|
-
|
56
|
+
Use the installer:
|
59
57
|
|
60
|
-
|
58
|
+
```shell
|
59
|
+
$ gem install alchemy_cms --pre
|
60
|
+
$ alchemy new my_magicpage
|
61
|
+
```
|
61
62
|
|
62
|
-
|
63
|
+
and follow the instructions to finish the installation.
|
63
64
|
|
64
|
-
|
65
|
+
The installer has some options (like choosing the database). See them with:
|
65
66
|
|
66
|
-
|
67
|
+
```shell
|
68
|
+
$ alchemy --help
|
69
|
+
```
|
67
70
|
|
68
|
-
###
|
71
|
+
### Install into an existing Rails project
|
69
72
|
|
70
|
-
#### 1.
|
73
|
+
#### 1. Add the Alchemy gem:
|
71
74
|
|
72
|
-
|
73
|
-
alchemy new my_magicpage
|
74
|
-
cd my_magicpage
|
75
|
+
Put this into your `Gemfile`:
|
75
76
|
|
76
|
-
|
77
|
+
```ruby
|
78
|
+
gem 'alchemy_cms', github: 'magiclabs/alchemy_cms', branch: 'master'
|
79
|
+
```
|
77
80
|
|
78
|
-
|
81
|
+
**NOTE:** You normally want to use a stable branch, like `3.0-stable`.
|
79
82
|
|
80
|
-
|
83
|
+
#### 2. Update your bundle:
|
81
84
|
|
82
|
-
|
85
|
+
```shell
|
86
|
+
$ bundle install
|
87
|
+
```
|
83
88
|
|
84
|
-
|
89
|
+
#### 3. Set the authentication user
|
85
90
|
|
86
|
-
|
91
|
+
Now you have to decide, if you want to use your own user model or if you want to use
|
92
|
+
the Devise based user model that Alchemy provides and was extracted [into its own gem](https://github.com/magiclabs/alchemy-devise).
|
87
93
|
|
88
|
-
|
94
|
+
##### Use Alchemy user
|
89
95
|
|
90
|
-
|
96
|
+
If you don't have your own user class, you can use the Alchemy user model. Just add the following gem into your `Gemfile`:
|
91
97
|
|
92
|
-
|
98
|
+
```ruby
|
99
|
+
gem 'alchemy-devise', '~> 2.0'
|
100
|
+
```
|
93
101
|
|
94
|
-
|
102
|
+
Then run:
|
95
103
|
|
96
|
-
|
104
|
+
```shell
|
105
|
+
$ bundle install
|
106
|
+
$ bin/rake alchemy_devise:install:migrations
|
107
|
+
```
|
97
108
|
|
98
|
-
|
109
|
+
##### Use your User model
|
99
110
|
|
100
|
-
|
111
|
+
In order to use your own user model you need to tell Alchemy about it.
|
101
112
|
|
102
|
-
|
103
|
-
bin/rake alchemy:install
|
113
|
+
The best practice is to use an initializer:
|
104
114
|
|
105
|
-
|
115
|
+
```ruby
|
116
|
+
# config/initializers/alchemy.rb
|
117
|
+
Alchemy.user_class_name = 'YourUserClass' # Defaults to 'User'
|
118
|
+
Alchemy.login_path = '/your/login/path' # Defaults to '/login'
|
119
|
+
Alchemy.logout_path = '/your/logout/path' # Defaults to '/logout'
|
120
|
+
```
|
106
121
|
|
107
|
-
|
122
|
+
The only thing Alchemy needs to know from your user class is the `alchemy_roles` method.
|
108
123
|
|
109
|
-
|
124
|
+
This method has to return an `Array` (or `ActiveRecord::Relation`) with at least one of the following roles: `member`, `author`, `editor`, `admin`.
|
110
125
|
|
111
|
-
|
126
|
+
Example:
|
112
127
|
|
113
|
-
|
128
|
+
```ruby
|
129
|
+
# app/models/user.rb
|
114
130
|
|
115
|
-
|
116
|
-
|
131
|
+
def alchemy_roles
|
132
|
+
if admin?
|
133
|
+
%w(admin)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
```
|
117
137
|
|
118
|
-
|
138
|
+
Please follow [this guide](http://guides.alchemy-cms.com/edge/custom_authentication.html) for further instructions on how to customize your user class even more.
|
119
139
|
|
120
|
-
|
121
|
-
Alchemy.user_class_name = 'YourUserClass'
|
122
|
-
Alchemy.login_path = '/your/login/path'
|
123
|
-
Alchemy.logout_path = '/your/logout/path'
|
140
|
+
#### 4. Install Alchemy into your app:
|
124
141
|
|
125
|
-
|
142
|
+
**After** you set the user model you need to run the Alchemy install task:
|
126
143
|
|
127
|
-
|
144
|
+
```shell
|
145
|
+
$ bin/rake alchemy:install
|
146
|
+
```
|
128
147
|
|
129
|
-
|
130
|
-
* `author`
|
131
|
-
* `editor`
|
132
|
-
* `admin`
|
148
|
+
Now everything should be set up and you should be able to visit the Alchemy Dashboard at:
|
133
149
|
|
134
|
-
|
150
|
+
<http://localhost:3000/admin>
|
135
151
|
|
136
|
-
|
137
|
-
self.admin?
|
138
|
-
%w(admin)
|
139
|
-
end
|
140
|
-
end
|
152
|
+
*) Use your custom path if you mounted Alchemy at something else then `'/'`
|
141
153
|
|
142
|
-
**Optionally** you can add a `alchemy_display_name` method that returns a name representing the currently logged in user. This is used in the admin views.
|
143
154
|
|
144
|
-
|
155
|
+
Customizing
|
156
|
+
-----------
|
145
157
|
|
146
|
-
|
147
|
-
"#{first_name} #{last_name}".strip
|
148
|
-
end
|
158
|
+
Alchemy has very flexible ways to organize and manage content. Please be sure to read [the introduction guide](http://guides.alchemy-cms.com/edge/index.html) in order to understand the basic idea of how Alchemy works.
|
149
159
|
|
150
|
-
Testing
|
151
|
-
-------
|
152
160
|
|
153
|
-
|
161
|
+
Upgrading
|
162
|
+
---------
|
154
163
|
|
155
|
-
|
164
|
+
The Alchemy team takes upgrades very seriously and tries to make them as smooth as we can. Therefore we have build in upgrade tasks, that try to automate as much as possible.
|
156
165
|
|
157
|
-
|
166
|
+
That's why after updating the Alchemy gem you should **always run the upgrader**:
|
158
167
|
|
159
|
-
|
168
|
+
```shell
|
169
|
+
$ bundle update alchemy_cms
|
170
|
+
$ bin/rake alchemy:upgrade
|
171
|
+
```
|
160
172
|
|
161
|
-
|
173
|
+
Alchemy will print out useful information after running the automated tasks that help a smooth upgrade path. So please **take your time and read them**.
|
162
174
|
|
163
|
-
|
175
|
+
Always be sure to keep an eye on the `config/alchemy/config.yml.defaults` file and update your `config/alchemy/config.yml` accordingly.
|
164
176
|
|
165
|
-
|
177
|
+
Also, `git diff` is your friend. You are using git to track changes of your projects, right?
|
166
178
|
|
167
|
-
This default task executes the database preparations and runs all defined test cases.
|
168
179
|
|
169
180
|
Deployment
|
170
181
|
----------
|
171
182
|
|
172
|
-
Alchemy ships with
|
173
|
-
takes care of everything you need to deploy an Alchemy site.
|
183
|
+
Alchemy ships with Capistrano based deployment receipts which takes care of everything you need to deploy an Alchemy site.
|
174
184
|
|
175
|
-
|
185
|
+
#### Add Capistrano gem
|
176
186
|
|
177
|
-
|
187
|
+
First you need to add Capistrano to your `Gemfile`:
|
178
188
|
|
179
|
-
|
189
|
+
```ruby
|
190
|
+
# Gemfile
|
191
|
+
gem 'capistrano', '2.15.5', group: 'development'
|
192
|
+
```
|
180
193
|
|
181
|
-
|
182
|
-
require 'alchemy/capistrano'
|
194
|
+
**A note about Capistrano version:**
|
183
195
|
|
184
|
-
|
196
|
+
Alchemy's deploy script is currently **only compatible with Capistrano 2.x** ([See this pull request](https://github.com/magiclabs/alchemy_cms/pull/616) if you want to help us upgrade to 3.x).
|
185
197
|
|
186
|
-
|
198
|
+
#### Generate the deploy file
|
187
199
|
|
188
|
-
|
189
|
-
---------
|
200
|
+
To generate the deploy file you need to use this generator:
|
190
201
|
|
191
|
-
|
202
|
+
```shell
|
203
|
+
$ bin/rails g alchemy:deploy_script
|
204
|
+
```
|
192
205
|
|
193
|
-
|
206
|
+
and follow the instructions.
|
194
207
|
|
195
|
-
|
208
|
+
If you *have your own Capistrano receipts* you can require the Alchemy tasks in your `config/deploy.rb` file:
|
196
209
|
|
210
|
+
```ruby
|
211
|
+
# deploy.rb
|
212
|
+
require 'alchemy/capistrano'
|
213
|
+
```
|
197
214
|
|
198
|
-
|
199
|
-
|
215
|
+
#### Synchronize your data
|
216
|
+
|
217
|
+
Alchemy Capistrano receipts offer much more then only deployment related tasks. We also have tasks to make your local development easier. To get a list of all receipts type:
|
218
|
+
|
219
|
+
```shell
|
220
|
+
$ bundle exec cap -T alchemy
|
221
|
+
```
|
222
|
+
|
223
|
+
##### Import data from server
|
224
|
+
|
225
|
+
```shell
|
226
|
+
$ bundle exec cap alchemy:import:all
|
227
|
+
```
|
228
|
+
|
229
|
+
This imports your servers data onto your local development machine. This is very handy if you want to clone the current server state.
|
230
|
+
|
231
|
+
##### Export data to server
|
232
|
+
|
233
|
+
That even works the other way around:
|
234
|
+
|
235
|
+
```shell
|
236
|
+
$ bundle exec cap alchemy:export:all
|
237
|
+
```
|
238
|
+
|
239
|
+
**NOTE:** This will **overwrite the database** on your server. But calm down my dear friend, Alchemy will ask you to perform a backup before overwriting it.
|
240
|
+
|
241
|
+
#### Without Capistrano
|
200
242
|
|
201
|
-
|
202
|
-
|
203
|
-
|
243
|
+
If you don't use Capistrano you have to **make sure** that the `uploads`, `tmp/cache/assets`, `public/assets` and `public/pictures` folders get **shared between deployments**, otherwise you **will loose data**. No, not really, but you know, just keep them in sync.
|
244
|
+
|
245
|
+
Please take a look into Alchemys [Capistrano receipt](https://github.com/magiclabs/alchemy_cms/blob/master/lib/alchemy/capistrano.rb) in order to see how you could achieve this.
|
246
|
+
|
247
|
+
|
248
|
+
Testing
|
249
|
+
-------
|
250
|
+
|
251
|
+
If you want to contribute to Alchemy ([and we encourage you to do so](https://github.com/magiclabs/alchemy_cms/blob/master/CONTRIBUTING.md)) we have a strong test suite that helps you to not break anything.
|
252
|
+
|
253
|
+
To prepare the tests of your Alchemy fork please make sure to run the preparation task:
|
254
|
+
|
255
|
+
```shell
|
256
|
+
# ~/your/local/alchemy_cms
|
257
|
+
$ bin/rake alchemy:spec:prepare
|
258
|
+
```
|
259
|
+
|
260
|
+
to set up the database for testing.
|
261
|
+
|
262
|
+
##### Run your tests with:
|
263
|
+
|
264
|
+
```shell
|
265
|
+
$ bundle exec rspec
|
266
|
+
```
|
267
|
+
|
268
|
+
**Alternatively** you can just run:
|
269
|
+
|
270
|
+
```shell
|
271
|
+
$ bundle exec rake
|
272
|
+
```
|
273
|
+
|
274
|
+
*) This default task executes the database preparations and runs all defined test cases.
|
275
|
+
|
276
|
+
**A note about RSpec version:**
|
277
|
+
|
278
|
+
Alchemy specs are written **in RSpec 3**. Please **do not use depricated RSpec 2.x syntax**. Thanks
|
204
279
|
|
205
280
|
|
206
281
|
Getting Help
|
207
282
|
------------
|
208
283
|
|
209
|
-
*
|
210
|
-
*
|
211
|
-
*
|
284
|
+
* Read the guidelines: http://guides.alchemy-cms.com.
|
285
|
+
* Read the documentation: http://rubydoc.info/github/magiclabs/alchemy_cms
|
286
|
+
* If you found a bug please use the [issue tracker on Github](https://github.com/magiclabs/alchemy_cms/issues).
|
287
|
+
* For questions about general usage please use [Stack Overflow](http://stackoverflow.com/questions/tagged/alchemy-cms), [the User Group](http://groups.google.com/group/alchemy-cms) or the [IRC channel](irc://irc.freenode.net#alchemy_cms).
|
288
|
+
* New features should be discussed on our [Trello Board](https://trello.com/alchemycms).
|
289
|
+
|
290
|
+
**PLEASE** don't use the Github issues for feature requests. If you want to contribute to Alchemy please [read the contribution guidelines](https://github.com/magiclabs/alchemy_cms/blob/master/CONTRIBUTING.md) before doing so.
|
212
291
|
|
213
292
|
|
214
293
|
Resources
|
@@ -216,12 +295,14 @@ Resources
|
|
216
295
|
|
217
296
|
* Homepage: <http://alchemy-cms.com>
|
218
297
|
* Live-Demo: <http://demo.alchemy-cms.com> (user: demo, password: demo123)
|
219
|
-
* API Documentation: <http://rubydoc.info/github/
|
220
|
-
* Issue-Tracker: <https://github.com/
|
221
|
-
* Sourcecode: <https://github.com/
|
298
|
+
* API Documentation: <http://rubydoc.info/github/magiclabs/alchemy_cms>
|
299
|
+
* Issue-Tracker: <https://github.com/magiclabs/alchemy_cms/issues>
|
300
|
+
* Sourcecode: <https://github.com/magiclabs/alchemy_cms>
|
222
301
|
* User Group: <http://groups.google.com/group/alchemy-cms>
|
223
|
-
* IRC Channel:
|
302
|
+
* IRC Channel: <irc://irc.freenode.net#alchemy_cms>
|
224
303
|
* Discussion Board: <https://trello.com/alchemycms>
|
304
|
+
* Twitter: <https://twitter.com/alchemy_cms>
|
305
|
+
|
225
306
|
|
226
307
|
Authors
|
227
308
|
---------
|
@@ -232,7 +313,18 @@ Authors
|
|
232
313
|
* Hendrik Mans: <https://github.com/hmans>
|
233
314
|
* Carsten Fregin: <https://github.com/cfregin>
|
234
315
|
|
316
|
+
|
235
317
|
License
|
236
318
|
-------
|
237
319
|
|
238
|
-
* BSD: <https://raw.github.com/
|
320
|
+
* BSD: <https://raw.github.com/magiclabs/alchemy_cms/master/LICENSE>
|
321
|
+
|
322
|
+
|
323
|
+
Spread the love
|
324
|
+
---------------
|
325
|
+
|
326
|
+
If you like Alchemy, please help us to spread the word about Alchemy and star this repo [on GitHub](https://github.com/magiclabs/alchemy_cms), upvote it [on The Ruby Toolbox](https://www.ruby-toolbox.com/projects/alchemy_cms), mention us [on Twitter](https://twitter.com/alchemy_cms) and vote for it [on Bitnami](https://bitnami.com/stack/alchemy).
|
327
|
+
|
328
|
+
That will help us to keep Alchemy awesome.
|
329
|
+
|
330
|
+
Thank you <3!
|