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
data/Guardfile
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do
|
5
|
-
watch(%r{lib/})
|
6
|
-
watch('spec/dummy/config/application.rb')
|
7
|
-
watch('spec/dummy/config/environment.rb')
|
8
|
-
watch(%r{^spec/dummy/config/environments/.+\.rb$})
|
9
|
-
watch(%r{^spec/dummy/config/initializers/.+\.rb$})
|
10
|
-
watch('Gemfile')
|
11
|
-
watch('Gemfile.lock')
|
12
|
-
watch('spec/factories.rb')
|
13
|
-
watch('spec/spec_helper.rb') { :rspec }
|
14
|
-
watch('test/test_helper.rb') { :test_unit }
|
15
|
-
watch(%r{features/support/}) { :cucumber }
|
16
|
-
end
|
@@ -1,93 +0,0 @@
|
|
1
|
-
if (typeof(Alchemy) === 'undefined') {
|
2
|
-
var Alchemy = {};
|
3
|
-
}
|
4
|
-
|
5
|
-
(function($) {
|
6
|
-
|
7
|
-
$.extend(Alchemy, {
|
8
|
-
|
9
|
-
ElementDirtyObserver: function(selector) {
|
10
|
-
var $elements = $(selector);
|
11
|
-
$elements.find('textarea.default_tinymce').map(function() {
|
12
|
-
var $this = $(this);
|
13
|
-
var ed = tinymce.get(this.id);
|
14
|
-
if (ed) {
|
15
|
-
ed.onChange.add(function(ed, l) {
|
16
|
-
Alchemy.setElementDirty($this.parents('.element_editor'));
|
17
|
-
});
|
18
|
-
}
|
19
|
-
});
|
20
|
-
$elements.find('input[type="text"]').bind('change', function() {
|
21
|
-
$(this).addClass('dirty');
|
22
|
-
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
23
|
-
});
|
24
|
-
$elements.find('.element_foot input[type="checkbox"]').bind('click', function() {
|
25
|
-
$(this).addClass('dirty');
|
26
|
-
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
27
|
-
});
|
28
|
-
$elements.find('select').bind('change', function() {
|
29
|
-
$(this).addClass('dirty');
|
30
|
-
Alchemy.setElementDirty($(this).parents('.element_editor'));
|
31
|
-
});
|
32
|
-
},
|
33
|
-
|
34
|
-
setElementDirty: function(element) {
|
35
|
-
var $element = $(element);
|
36
|
-
$element.addClass('dirty');
|
37
|
-
$element.find('.element_head .icon').addClass('element_dirty');
|
38
|
-
},
|
39
|
-
|
40
|
-
setElementClean: function(element) {
|
41
|
-
var $element = $(element);
|
42
|
-
$element.removeClass('dirty');
|
43
|
-
$element.find('.element_foot input[type="checkbox"]').removeClass('dirty');
|
44
|
-
$element.find('input[type="text"]').removeClass('dirty');
|
45
|
-
$element.find('select').removeClass('dirty');
|
46
|
-
$element.find('.element_head .icon').removeClass('element_dirty');
|
47
|
-
},
|
48
|
-
|
49
|
-
isPageDirty: function() {
|
50
|
-
return $('#element_area').find('.element_editor.dirty').size() > 0;
|
51
|
-
},
|
52
|
-
|
53
|
-
checkPageDirtyness: function(element, text) {
|
54
|
-
var okcallback;
|
55
|
-
if ($(element).is('form')) {
|
56
|
-
okcallback = function() {
|
57
|
-
var $form = $('<form action="' + element.action + '" method="POST" style="display: none"></form>');
|
58
|
-
$form.append($(element).find('input'));
|
59
|
-
$form.appendTo('body');
|
60
|
-
Alchemy.pleaseWaitOverlay();
|
61
|
-
$form.submit();
|
62
|
-
};
|
63
|
-
} else if ($(element).is('a')) {
|
64
|
-
okcallback = function() {
|
65
|
-
Alchemy.pleaseWaitOverlay();
|
66
|
-
document.location = element.pathname;
|
67
|
-
};
|
68
|
-
}
|
69
|
-
if (Alchemy.isPageDirty()) {
|
70
|
-
Alchemy.openConfirmWindow({
|
71
|
-
title: text.title,
|
72
|
-
message: text.message,
|
73
|
-
okLabel: text.okLabel,
|
74
|
-
cancelLabel: text.cancelLabel,
|
75
|
-
okCallback: okcallback
|
76
|
-
});
|
77
|
-
return false;
|
78
|
-
} else {
|
79
|
-
return true;
|
80
|
-
}
|
81
|
-
},
|
82
|
-
|
83
|
-
PageLeaveObserver: function(texts) {
|
84
|
-
$('#main_navi a').click(function(event) {
|
85
|
-
if (!Alchemy.checkPageDirtyness(event.currentTarget, texts)) {
|
86
|
-
event.preventDefault();
|
87
|
-
}
|
88
|
-
});
|
89
|
-
}
|
90
|
-
|
91
|
-
});
|
92
|
-
|
93
|
-
})(jQuery);
|
@@ -1,122 +0,0 @@
|
|
1
|
-
if (typeof(Alchemy) === 'undefined') {
|
2
|
-
var Alchemy = {};
|
3
|
-
}
|
4
|
-
|
5
|
-
(function($) {
|
6
|
-
|
7
|
-
$.extend(Alchemy, {
|
8
|
-
|
9
|
-
SortableElements: function(page_id, form_token, selector) {
|
10
|
-
if (typeof(selector) === 'undefined') {
|
11
|
-
selector = '#element_area .sortable_cell';
|
12
|
-
}
|
13
|
-
$(selector).sortable({
|
14
|
-
items: 'div.element_editor',
|
15
|
-
handle: '.element_handle',
|
16
|
-
axis: 'y',
|
17
|
-
placeholder: 'droppable_element_placeholder',
|
18
|
-
forcePlaceholderSize: true,
|
19
|
-
dropOnEmpty: true,
|
20
|
-
opacity: 0.5,
|
21
|
-
cursor: 'move',
|
22
|
-
tolerance: 'pointer',
|
23
|
-
update: function(event, ui) {
|
24
|
-
var ids = $.map($(this).children(), function(child) {
|
25
|
-
return $(child).attr('data-element-id');
|
26
|
-
});
|
27
|
-
var params_string = '';
|
28
|
-
var cell_id = $(this).attr('data-cell-id');
|
29
|
-
// Is the trash window open?
|
30
|
-
if ($('#alchemyTrashWindow').length > 0) {
|
31
|
-
// updating the trash icon
|
32
|
-
if ($('#trash_items div.element_editor').not('.dragged').length === 0) {
|
33
|
-
$('#element_trash_button .icon').removeClass('full');
|
34
|
-
$('#trash_empty_notice').show();
|
35
|
-
}
|
36
|
-
}
|
37
|
-
$(event.target).css("cursor", "progress");
|
38
|
-
params_string = "page_id=" + page_id + "&authenticity_token=" + encodeURIComponent(form_token) + "&" + $.param({
|
39
|
-
element_ids: ids
|
40
|
-
});
|
41
|
-
if (cell_id) {
|
42
|
-
params_string += "&cell_id=" + cell_id;
|
43
|
-
}
|
44
|
-
$.ajax({
|
45
|
-
url: Alchemy.routes.order_admin_elements_path,
|
46
|
-
type: 'POST',
|
47
|
-
data: params_string,
|
48
|
-
complete: function() {
|
49
|
-
$(event.target).css("cursor", "auto");
|
50
|
-
Alchemy.TrashWindow.refresh(page_id);
|
51
|
-
}
|
52
|
-
});
|
53
|
-
},
|
54
|
-
start: function(event, ui) {
|
55
|
-
var $textareas = ui.item.find('textarea.default_tinymce, textarea.custom_tinymce');
|
56
|
-
$textareas.each(function() {
|
57
|
-
tinymce.get(this.id).remove();
|
58
|
-
});
|
59
|
-
},
|
60
|
-
stop: function(event, ui) {
|
61
|
-
var $textareas = ui.item.find('textarea.default_tinymce, textarea.custom_tinymce');
|
62
|
-
$textareas.each(function() {
|
63
|
-
Alchemy.Tinymce.addEditor(this.id);
|
64
|
-
});
|
65
|
-
}
|
66
|
-
});
|
67
|
-
},
|
68
|
-
|
69
|
-
SortableContents: function(selector, token) {
|
70
|
-
$(selector).sortable({
|
71
|
-
items: 'div.dragable_picture',
|
72
|
-
handle: 'div.picture_handle',
|
73
|
-
opacity: 0.5,
|
74
|
-
cursor: 'move',
|
75
|
-
tolerance: 'pointer',
|
76
|
-
containment: 'parent',
|
77
|
-
update: function(event, ui) {
|
78
|
-
var ids = $.map($(this).children('div.dragable_picture'), function(child) {
|
79
|
-
return child.id.replace(/essence_picture_/, '');
|
80
|
-
});
|
81
|
-
$(event.originalTarget).css("cursor", "progress");
|
82
|
-
$.ajax({
|
83
|
-
url: Alchemy.routes.order_admin_contents_path,
|
84
|
-
type: 'POST',
|
85
|
-
data: "authenticity_token=" + encodeURIComponent(token) + "&" + $.param({
|
86
|
-
content_ids: ids
|
87
|
-
}),
|
88
|
-
complete: function() {
|
89
|
-
$(event.originalTarget).css("cursor", "move");
|
90
|
-
}
|
91
|
-
});
|
92
|
-
}
|
93
|
-
});
|
94
|
-
},
|
95
|
-
|
96
|
-
DraggableTrashItems: function(items_n_cells) {
|
97
|
-
$("#trash_items div.draggable").each(function() {
|
98
|
-
var cell_classes = '';
|
99
|
-
var cell_names = items_n_cells[this.id];
|
100
|
-
$.each(cell_names, function(i) {
|
101
|
-
cell_classes += '.' + this + '_cell' + ', ';
|
102
|
-
});
|
103
|
-
$(this).draggable({
|
104
|
-
helper: 'clone',
|
105
|
-
iframeFix: 'iframe#alchemyPreviewWindow',
|
106
|
-
connectToSortable: cell_classes.replace(/,.$/, ''),
|
107
|
-
start: function(event, ui) {
|
108
|
-
$(this).hide().addClass('dragged');
|
109
|
-
ui.helper.css({
|
110
|
-
width: '300px'
|
111
|
-
});
|
112
|
-
},
|
113
|
-
stop: function() {
|
114
|
-
$(this).show().removeClass('dragged');
|
115
|
-
}
|
116
|
-
});
|
117
|
-
});
|
118
|
-
}
|
119
|
-
|
120
|
-
});
|
121
|
-
|
122
|
-
})(jQuery);
|
@@ -1,3 +0,0 @@
|
|
1
|
-
<span class="page_status <%= page.public ? 'public' : 'not_public' %>" title="<%= page.status_title(:public) %>"></span>
|
2
|
-
<span class="page_status <%= page.visible ? 'visible' : 'not_visible' %>" title="<%= page.status_title(:visible) %>"></span>
|
3
|
-
<span class="page_status <%= page.restricted ? 'restricted' : 'not_restricted' %>" title="<%= page.status_title(:restricted) %>"></span>
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<% entries.each do |entry| %>
|
2
|
-
<% entry.stringify_keys! %>
|
3
|
-
<% permitted_to?(*navigate_module(entry)) do %>
|
4
|
-
<div class="subnavi_tab<%= admin_sub_navigation_entry_active?(entry) ? ' active' : nil %>">
|
5
|
-
<%= link_to _t(entry["name"]), url_for_module_sub_navigation(entry) %>
|
6
|
-
</div>
|
7
|
-
<% end %>
|
8
|
-
<% end %>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<%= @message.message %>
|
2
|
-
|
3
|
-
--
|
4
|
-
<%= Alchemy::I18n.t(:salutation, :scope => 'contactform.labels') %>: <%= Alchemy::I18n.t(@message.salutation, :scope => 'contactform.labels') %>
|
5
|
-
<%= Alchemy::I18n.t(:firstname, :scope => 'contactform.labels') %>: <%= @message.firstname %>
|
6
|
-
<%= Alchemy::I18n.t(:lastname, :scope => 'contactform.labels') %>: <%= @message.lastname %>
|
7
|
-
|
8
|
-
<%= Alchemy::I18n.t(:address, :scope => 'contactform.labels') %>: <%= @message.address %>
|
9
|
-
<%= Alchemy::I18n.t(:zip, :scope => 'contactform.labels') %>: <%= @message.zip %> <%= @message.city %>
|
10
|
-
|
11
|
-
<%= Alchemy::I18n.t(:phone, :scope => 'contactform.labels') %>: <%= @message.phone %>
|
12
|
-
<%= Alchemy::I18n.t(:email, :scope => 'contactform.labels') %>: <%= @message.email %>
|
@@ -1,21 +0,0 @@
|
|
1
|
-
class MigrateAttachmentsToDragonfly < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
change_table :alchemy_attachments do |t|
|
4
|
-
t.string :file_uid
|
5
|
-
t.index :file_uid
|
6
|
-
t.rename :filename, :file_name
|
7
|
-
t.rename :content_type, :file_mime_type
|
8
|
-
t.rename :size, :file_size
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def down
|
13
|
-
change_table :alchemy_attachments do |t|
|
14
|
-
t.remove :file_uid
|
15
|
-
t.rename :file_name, :filename
|
16
|
-
t.rename :file_mime_type, :content_type
|
17
|
-
t.rename :file_size, :size
|
18
|
-
t.remove_index :file_uid
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,11 +0,0 @@
|
|
1
|
-
class ChangeAlchemyUsersRoleToRoles < ActiveRecord::Migration
|
2
|
-
def up
|
3
|
-
rename_column :alchemy_users, :role, :roles
|
4
|
-
add_index :alchemy_users, :roles
|
5
|
-
end
|
6
|
-
|
7
|
-
def down
|
8
|
-
remove_index :alchemy_users, :roles
|
9
|
-
rename_column :alchemy_users, :roles, :role
|
10
|
-
end
|
11
|
-
end
|
data/lib/alchemy/auth_engine.rb
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
module Alchemy
|
2
|
-
# Provides full text search methods in your controller
|
3
|
-
#
|
4
|
-
# === Usage
|
5
|
-
#
|
6
|
-
# include Alchemy::FerretSearch
|
7
|
-
#
|
8
|
-
module FerretSearch
|
9
|
-
|
10
|
-
# Adds a +before_filter+ to your controller
|
11
|
-
#
|
12
|
-
def self.included(controller)
|
13
|
-
controller.send(:before_filter, :perform_search, :only => :show)
|
14
|
-
controller.send(:helper_method, :find_search_result_page)
|
15
|
-
end
|
16
|
-
|
17
|
-
# Performs a full text search with +Ferret+.
|
18
|
-
#
|
19
|
-
# Gets invoked everytime 'query' is given in params.
|
20
|
-
#
|
21
|
-
# This method only sets the +@search_results+ instance variable.
|
22
|
-
#
|
23
|
-
# You have to redirect to the search result page within a search form.
|
24
|
-
#
|
25
|
-
# === Alchemy provides a handy helper for rendering the search form:
|
26
|
-
#
|
27
|
-
# render_search_form
|
28
|
-
#
|
29
|
-
# === Note
|
30
|
-
#
|
31
|
-
# If in preview mode a fake search value "lorem" will be set.
|
32
|
-
#
|
33
|
-
# @see Alchemy::PagesHelper#render_search_form
|
34
|
-
#
|
35
|
-
def perform_search
|
36
|
-
if @preview_mode && params[:query].blank?
|
37
|
-
params[:query] = 'lorem'
|
38
|
-
end
|
39
|
-
return if params[:query].blank?
|
40
|
-
@search_results = get_search_results
|
41
|
-
end
|
42
|
-
|
43
|
-
# Finds what is provided in "query" param with Ferret on EssenceText and EssenceRichtext
|
44
|
-
#
|
45
|
-
# @return [Array]
|
46
|
-
#
|
47
|
-
def get_search_results
|
48
|
-
search_results = []
|
49
|
-
%w(Alchemy::EssenceText Alchemy::EssenceRichtext).each do |e|
|
50
|
-
search_results += e.constantize.includes(:contents => {:element => :page}).find_with_ferret(
|
51
|
-
"*#{params[:query]}*",
|
52
|
-
{:limit => :all},
|
53
|
-
{:conditions => [
|
54
|
-
'alchemy_pages.public = ? AND alchemy_pages.layoutpage = ? AND alchemy_pages.restricted = ? AND alchemy_pages.language_id = ?',
|
55
|
-
true, false, false, session[:language_id]
|
56
|
-
]}
|
57
|
-
)
|
58
|
-
end
|
59
|
-
if search_results.any?
|
60
|
-
search_results.sort { |y, x| x.ferret_score <=> y.ferret_score }
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
# A view helper that loads the search result page.
|
65
|
-
#
|
66
|
-
# === Raises a ActiveRecord::RecordNotFound error, if the page could not be found or is not published.
|
67
|
-
#
|
68
|
-
# @return [Alchemy::Page]
|
69
|
-
#
|
70
|
-
def find_search_result_page
|
71
|
-
if searchresult_page_layout = PageLayout.get_all_by_attributes(:searchresults => true).first
|
72
|
-
search_result_page = Page.published.where(
|
73
|
-
:page_layout => searchresult_page_layout["name"],
|
74
|
-
:language_id => session[:language_id]
|
75
|
-
).limit(1).first
|
76
|
-
end
|
77
|
-
if search_result_page.nil?
|
78
|
-
logger.warn "\n++++++\nNo published search result page found. Please create one or publish your search result page.\n++++++\n"
|
79
|
-
end
|
80
|
-
search_result_page
|
81
|
-
end
|
82
|
-
|
83
|
-
end
|
84
|
-
end
|
data/lib/extensions/array.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
Array.class_eval do
|
2
|
-
|
3
|
-
def stringify
|
4
|
-
map do |value|
|
5
|
-
if value.is_a?(Hash) || value.is_a?(Array)
|
6
|
-
value.stringify
|
7
|
-
else
|
8
|
-
value.to_s
|
9
|
-
end
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
def stringify!
|
14
|
-
a = []
|
15
|
-
each do |value|
|
16
|
-
if value.is_a?(Hash) || value.is_a?(Array)
|
17
|
-
a << value.stringify!
|
18
|
-
else
|
19
|
-
a << value.to_s
|
20
|
-
end
|
21
|
-
end
|
22
|
-
replace(a)
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
data/lib/extensions/hash.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
class Hash
|
2
|
-
|
3
|
-
#this method adds an key/value pair in the pattern of :<name> => [] to the hash
|
4
|
-
#only if the key <name> doesn't already exists. this function is provided
|
5
|
-
#due to http post's lack of providing the checkboxes field when no cb is
|
6
|
-
#selected. I'm pretty sure that this could be moved direcly into the model
|
7
|
-
#or even ActiveRecord.
|
8
|
-
def add_key_for_checkboxes name
|
9
|
-
self[name.to_s] = [] if self.stringify_keys[name.to_s].nil?
|
10
|
-
end
|
11
|
-
|
12
|
-
def stringify
|
13
|
-
inject({}) do |options, (key, value)|
|
14
|
-
if value.is_a?(Hash) || value.is_a?(Array)
|
15
|
-
options[key.to_s] = value.stringify
|
16
|
-
else
|
17
|
-
options[key.to_s] = value.to_s
|
18
|
-
end
|
19
|
-
options
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
def stringify!
|
24
|
-
each do |key, value|
|
25
|
-
delete(key)
|
26
|
-
if value.is_a?(Hash) || value.is_a?(Array)
|
27
|
-
store(key.to_s, value.stringify!)
|
28
|
-
else
|
29
|
-
store(key.to_s, value.to_s)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|