alchemy_cms 2.0.7 → 2.1.beta1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -4
- data/.travis.yml +1 -1
- data/Gemfile +7 -2
- data/README.md +6 -6
- data/Rakefile +26 -18
- data/alchemy_cms.gemspec +14 -14
- data/{assets/stylesheets → app/assets/images/alchemy}/Jcrop.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/ajax_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/alchemy-logo.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/flags.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/navi-tab.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/shading_90.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/gui/toggle.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/icons.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/image_loader.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/jquery-sb/select_arrow_bg_hover.gif +0 -0
- data/{assets/images → app/assets/images/alchemy}/placeholder.png +0 -0
- data/{assets/images/gui → app/assets/images/alchemy}/shading.png +0 -0
- data/{assets/images → app/assets/images/alchemy}/swfupload/browse_button.png +0 -0
- data/{assets/stylesheets/default/img → app/assets/images/alchemy}/tabs.gif +0 -0
- data/{assets/images/jquery-ui → app/assets/images/alchemy}/ui-icons_666666_256x240.png +0 -0
- data/app/assets/javascripts/alchemy/alchemy.base.js +212 -0
- data/app/assets/javascripts/alchemy/alchemy.buttons.js +36 -0
- data/app/assets/javascripts/alchemy/alchemy.dirty.js +91 -0
- data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +114 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.element_editor_selector.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.growler.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.image_cropper.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.js +26 -0
- data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +17 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.link_overlay.js +1 -1
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.page_sorter.js +0 -0
- data/{assets/javascripts → app/assets/javascripts/alchemy}/alchemy.preview.js +0 -0
- data/app/assets/javascripts/alchemy/alchemy.windows.js +438 -0
- data/app/assets/stylesheets/alchemy/_defaults.scss +160 -0
- data/app/assets/stylesheets/alchemy/alchemy.css +9 -0
- data/{assets/stylesheets/alchemy.css → app/assets/stylesheets/alchemy/base.css.scss} +216 -353
- data/{assets/stylesheets/elements.css → app/assets/stylesheets/alchemy/elements.css.scss} +41 -70
- data/{assets/stylesheets/flags.css → app/assets/stylesheets/alchemy/flags.css.scss} +1 -1
- data/{assets/stylesheets/jquery-ui-1.8.7.alchemy.css → app/assets/stylesheets/alchemy/jquery-ui.alchemy.css} +15 -15
- data/{assets/stylesheets/jquery.Jcrop.css → app/assets/stylesheets/alchemy/jquery.Jcrop.css.scss} +3 -3
- data/{assets/stylesheets/jquery.sb.css → app/assets/stylesheets/alchemy/jquery.sb.css.scss} +19 -29
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/print.css +6 -1
- data/{assets/stylesheets → app/assets/stylesheets/alchemy}/standard_set.css +0 -0
- data/{assets/stylesheets/alchemy_tinymce_content.css → app/assets/stylesheets/alchemy/tinymce_content.css} +0 -0
- data/{assets/stylesheets/alchemy_tinymce_dialog.css → app/assets/stylesheets/alchemy/tinymce_dialog.css} +2 -2
- data/app/controllers/admin/attachments_controller.rb +2 -8
- data/app/controllers/admin/clipboard_controller.rb +2 -2
- data/app/controllers/admin/contents_controller.rb +4 -16
- data/app/controllers/admin/elements_controller.rb +2 -2
- data/app/controllers/admin/essence_audios_controller.rb +0 -3
- data/app/controllers/admin/essence_files_controller.rb +0 -11
- data/app/controllers/admin/essence_flashes_controller.rb +0 -3
- data/app/controllers/admin/essence_pictures_controller.rb +2 -7
- data/app/controllers/admin/essence_videos_controller.rb +0 -3
- data/app/controllers/admin/languages_controller.rb +4 -10
- data/app/controllers/admin/pages_controller.rb +6 -4
- data/app/controllers/admin/pictures_controller.rb +13 -18
- data/app/controllers/admin/trash_controller.rb +0 -5
- data/app/controllers/admin/users_controller.rb +2 -3
- data/app/controllers/alchemy_controller.rb +18 -30
- data/app/controllers/pages_controller.rb +21 -24
- data/app/helpers/admin/elements_helper.rb +5 -0
- data/app/helpers/admin/pages_helper.rb +36 -1
- data/app/helpers/alchemy_helper.rb +39 -17
- data/app/models/attachment.rb +2 -2
- data/app/models/essence_file.rb +1 -1
- data/app/models/page.rb +1 -1
- data/app/sweepers/pages_sweeper.rb +10 -0
- data/app/views/admin/attachments/destroy.js.erb +4 -0
- data/app/views/admin/clipboard/insert.js.erb +12 -19
- data/app/views/admin/contents/create.js.erb +1 -1
- data/app/views/admin/contents/destroy.js.erb +7 -0
- data/app/views/admin/contents/order.js.erb +6 -0
- data/app/views/admin/elements/_element.html.erb +4 -2
- data/app/views/admin/elements/create.js.erb +19 -26
- data/app/views/admin/elements/fold.js.erb +1 -1
- data/app/views/admin/elements/index.html.erb +1 -1
- data/app/views/admin/essence_files/assign.js.erb +8 -0
- data/app/views/admin/essence_pictures/save_link.js.erb +3 -0
- data/app/views/admin/index.html.erb +37 -27
- data/app/views/admin/languages/destroy.js.erb +1 -0
- data/app/views/admin/pages/_page.html.erb +1 -1
- data/app/views/admin/pages/_sitemap.html.erb +1 -1
- data/app/views/admin/pages/edit.html.erb +2 -2
- data/app/views/admin/pages/update.js.erb +1 -1
- data/app/views/admin/partials/_upload_form.html.erb +11 -11
- data/app/views/admin/pictures/archive_overlay.js.erb +1 -0
- data/app/views/admin/pictures/flush.js.erb +2 -0
- data/app/views/admin/pictures/update.js.erb +1 -0
- data/app/views/admin/trash/clear.js.erb +3 -0
- data/app/views/alchemy/error_notice.js.erb +1 -0
- data/app/views/alchemy/permission_denied.js.erb +2 -0
- data/app/views/alchemy/redirect.js.erb +1 -0
- data/app/views/alchemy/remote_errors.js.erb +3 -0
- data/app/views/alchemy/update.js.erb +5 -0
- data/app/views/essences/_essence_file_editor.html.erb +0 -1
- data/app/views/essences/_essence_file_view.html.erb +1 -5
- data/app/views/essences/_essence_picture_tools.html.erb +1 -1
- data/app/views/layouts/alchemy.html.erb +22 -9
- data/app/views/pages/show.rss.builder +1 -1
- data/config/alchemy/elements.yml +0 -5
- data/config/alchemy/page_layouts.yml +1 -1
- data/config/asset_packages.yml +17 -19
- data/config/authorization_rules.rb +1 -0
- data/config/locales/de.yml +0 -1
- data/config/routes.rb +1 -1
- data/lib/alchemy/tinymce.rb +51 -0
- data/lib/alchemy/version.rb +3 -3
- data/lib/alchemy_cms.rb +4 -2
- data/script/rails +6 -0
- data/spec/controllers/admin/clipboard_controller_spec.rb +15 -13
- data/spec/controllers/admin/contents_controller_spec.rb +4 -4
- data/spec/controllers/admin/trash_controller_spec.rb +6 -9
- data/spec/controllers/pages_controller_spec.rb +9 -8
- data/spec/dummy/Rakefile +1 -1
- data/spec/dummy/app/assets/javascripts/application.js +9 -0
- data/spec/dummy/app/assets/stylesheets/application.css +7 -0
- data/spec/dummy/app/mailers/.gitkeep +0 -0
- data/spec/dummy/app/models/.gitkeep +0 -0
- data/spec/dummy/app/views/layouts/application.html.erb +3 -3
- data/spec/dummy/config/application.rb +12 -6
- data/spec/dummy/config/database.yml +3 -0
- data/spec/dummy/config/environments/development.rb +7 -3
- data/spec/dummy/config/environments/production.rb +23 -12
- data/spec/dummy/config/environments/test.rb +5 -1
- data/spec/dummy/config/initializers/secret_token.rb +1 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +1 -1
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/lib/assets/.gitkeep +0 -0
- data/spec/factories.rb +8 -8
- data/spec/helpers/admin/elements_helper_spec.rb +2 -2
- data/spec/helpers/contents_helper_spec.rb +1 -1
- data/spec/helpers/elements_helper_spec.rb +6 -6
- data/spec/helpers/essences_helper_spec.rb +1 -1
- data/spec/helpers/pages_helper_spec.rb +37 -37
- data/spec/integration/pages_controller_spec.rb +29 -26
- data/spec/integration/security_spec.rb +2 -1
- data/spec/models/content_spec.rb +1 -1
- data/spec/models/element_spec.rb +11 -11
- data/spec/models/language_spec.rb +5 -5
- data/spec/models/page_spec.rb +54 -54
- data/spec/models/user_spec.rb +2 -1
- data/spec/routing_spec.rb +1 -1
- data/{assets/javascripts/jquery.js → vendor/assets/javascripts/jquery-1.6.2.min.js} +0 -0
- data/{assets/javascripts/jquery-ui.js → vendor/assets/javascripts/jquery-ui-custom-1.8.16.min.js} +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.Jcrop.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.dialogextend.min.js +7 -7
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.in-place-edit.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.sb.min.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.scrollTo-1.4.2-min.js +10 -10
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.nestedSortable.js +0 -0
- data/{assets/javascripts → vendor/assets/javascripts/jquery_plugins}/jquery.ui.tabspaging.js +0 -0
- data/{assets → vendor/assets}/javascripts/swfupload/fileprogress.js +202 -202
- data/{assets → vendor/assets}/javascripts/swfupload/handlers.js +171 -171
- data/{assets → vendor/assets}/javascripts/swfupload/queue.js +97 -97
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.js +980 -980
- data/{assets → vendor/assets}/javascripts/swfupload/swfupload.swf +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/jquery.tinymce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/license.txt +504 -504
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/alchemy_link/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/fullscreen/fullscreen.htm +110 -110
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/editor_plugin.js +0 -0
- data/{assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css → vendor/assets/javascripts/tiny_mce/plugins/inlinepopups/skins/alchemy/window.css.erb} +8 -8
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/inlinepopups/template.htm +387 -387
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pastetext.js +36 -36
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/js/pasteword.js +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pastetext.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/paste/pasteword.htm +21 -21
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/cell.htm +180 -180
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/cell.css +16 -16
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/row.css +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/css/table.css +13 -13
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/editor_plugin.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/cell.js +319 -319
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/merge_cells.js +27 -27
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/row.js +237 -237
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/js/table.js +450 -450
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/merge_cells.htm +32 -32
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/row.htm +158 -158
- data/{assets → vendor/assets}/javascripts/tiny_mce/plugins/table/table.htm +188 -188
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/about.htm +52 -52
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/anchor.htm +26 -26
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/charmap.htm +51 -51
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/color_picker.htm +74 -74
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/editor_template.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/image.htm +80 -80
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/colorpicker.jpg +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/flash.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/icons.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/iframe.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/pagebreak.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/quicktime.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/realmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/shockwave.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/trans.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/video.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/img/windowsmedia.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/about.js +73 -73
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/anchor.js +43 -43
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/charmap.js +355 -355
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/color_picker.js +329 -329
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/image.js +251 -251
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/link.js +153 -153
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/js/source_editor.js +56 -56
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/de_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/langs/en_dlg.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/link.htm +57 -57
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/shortcuts.htm +47 -47
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/content.css +50 -50
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/buttons.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/items.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_arrow.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/menu_check.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/progress.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/img/tabs.gif +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/default/ui.css +214 -214
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/content.css +48 -48
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/dialog.css +117 -117
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_black.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/img/button_bg_silver.png +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui.css +217 -217
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_black.css +7 -7
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css +5 -5
- data/{assets → vendor/assets}/javascripts/tiny_mce/themes/advanced/source_editor.htm +25 -25
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/tiny_mce_popup.js +0 -0
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/editable_selects.js +70 -70
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/form_utils.js +210 -210
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/mctabs.js +161 -161
- data/{assets → vendor/assets}/javascripts/tiny_mce/utils/validate.js +252 -252
- metadata +338 -369
- data/app/views/elements/_download_editor.html.erb +0 -1
- data/app/views/elements/_download_view.html.erb +0 -3
- data/assets/javascripts/alchemy.js +0 -903
- data/assets/javascripts/jquery.rails.js +0 -315
- data/assets/stylesheets/ie6.css +0 -18
- data/config/initializers/tinymce_hammer.rb +0 -31
File without changes
|
File without changes
|
@@ -96,7 +96,7 @@ input.checkbox {
|
|
96
96
|
padding-right: 8px;
|
97
97
|
padding-bottom: 2px;
|
98
98
|
margin: 0;
|
99
|
-
background: #eaeaea url(/
|
99
|
+
background: #eaeaea url('/assets/alchemy/shading.png') repeat-x 0 -75px;
|
100
100
|
-webkit-border-radius: 2px;
|
101
101
|
-moz-border-radius: 2px;
|
102
102
|
border-radius: 2px;
|
@@ -234,7 +234,7 @@ td.charmap, #charmap a {
|
|
234
234
|
|
235
235
|
.tabs li {
|
236
236
|
float: left;
|
237
|
-
background: url(/
|
237
|
+
background: url('/assets/alchemy/shading.png') repeat-x 0 0;
|
238
238
|
margin: 0 2px 0 0;
|
239
239
|
padding: 0 0 0 10px;
|
240
240
|
line-height: 17px;
|
@@ -58,10 +58,7 @@ class Admin::AttachmentsController < AlchemyController
|
|
58
58
|
redirect_to :action => :index
|
59
59
|
end
|
60
60
|
rescue Exception => e
|
61
|
-
|
62
|
-
render :update, :status => 500 do |page|
|
63
|
-
page.call('Alchemy.growl', _('File upload error: %{error}') % {:error => e}, :error)
|
64
|
-
end
|
61
|
+
exception_handler(e)
|
65
62
|
end
|
66
63
|
|
67
64
|
def edit
|
@@ -88,10 +85,7 @@ class Admin::AttachmentsController < AlchemyController
|
|
88
85
|
@attachment = Attachment.find(params[:id])
|
89
86
|
name = @attachment.name
|
90
87
|
@attachment.destroy
|
91
|
-
|
92
|
-
flash[:notice] = ( _("File: '%{name}' deleted successfully") % {:name => name} )
|
93
|
-
page.redirect_to admin_attachments_path(:per_page => params[:per_page], :page => params[:page], :query => params[:query])
|
94
|
-
end
|
88
|
+
flash[:notice] = ( _("File: '%{name}' deleted successfully") % {:name => name} )
|
95
89
|
end
|
96
90
|
|
97
91
|
def show
|
@@ -15,7 +15,7 @@ class Admin::ClipboardController < AlchemyController
|
|
15
15
|
def insert
|
16
16
|
@clipboard = get_clipboard(params[:remarkable_type].tableize)
|
17
17
|
@item = params[:remarkable_type].classify.constantize.find(params[:remarkable_id])
|
18
|
-
unless @clipboard.collect { |i| i[:id] }.include?(params[:remarkable_id])
|
18
|
+
unless @clipboard.collect { |i| i[:id].to_s }.include?(params[:remarkable_id])
|
19
19
|
@clipboard.push({:id => params[:remarkable_id], :action => params[:remove] ? 'cut' : 'copy'})
|
20
20
|
end
|
21
21
|
respond_to do |format|
|
@@ -28,7 +28,7 @@ class Admin::ClipboardController < AlchemyController
|
|
28
28
|
def remove
|
29
29
|
@clipboard = get_clipboard(params[:remarkable_type].tableize)
|
30
30
|
@item = params[:remarkable_type].classify.constantize.find(params[:remarkable_id])
|
31
|
-
@clipboard.delete_if { |i| i[:id] == params[:remarkable_id] }
|
31
|
+
@clipboard.delete_if { |i| i[:id].to_s == params[:remarkable_id] }
|
32
32
|
respond_to do |format|
|
33
33
|
format.js
|
34
34
|
end
|
@@ -34,9 +34,6 @@ class Admin::ContentsController < AlchemyController
|
|
34
34
|
def update
|
35
35
|
content = Content.find(params[:id])
|
36
36
|
content.essence.update_attributes(params[:content])
|
37
|
-
render :update do |page|
|
38
|
-
page << "Alchemy.closeCurrentWindow();Alchemy.reloadPreview()"
|
39
|
-
end
|
40
37
|
end
|
41
38
|
|
42
39
|
def order
|
@@ -44,11 +41,7 @@ class Admin::ContentsController < AlchemyController
|
|
44
41
|
content = Content.find(id)
|
45
42
|
content.move_to_bottom
|
46
43
|
end
|
47
|
-
|
48
|
-
page.call('Alchemy.growl', _("Successfully saved content position"))
|
49
|
-
page.call("Alchemy.SortableContents", '#element_area .picture_gallery_images', form_authenticity_token)
|
50
|
-
page.call('Alchemy.reloadPreview')
|
51
|
-
end
|
44
|
+
@notice = _("Successfully saved content position")
|
52
45
|
rescue
|
53
46
|
exception_handler($!)
|
54
47
|
end
|
@@ -57,14 +50,9 @@ class Admin::ContentsController < AlchemyController
|
|
57
50
|
content = Content.find(params[:id])
|
58
51
|
element = content.element
|
59
52
|
content_name = content.name
|
60
|
-
content_dom_id = "#{content.essence_type.underscore}_#{content.id}"
|
61
|
-
|
62
|
-
|
63
|
-
page.call("jQuery('#{content_dom_id}').remove")
|
64
|
-
page.call('Alchemy.growl', _("Successfully deleted %{content}") % {:content => content_name})
|
65
|
-
page.call('Alchemy.reloadPreview')
|
66
|
-
end
|
67
|
-
end
|
53
|
+
@content_dom_id = "#{content.essence_type.underscore}_#{content.id}"
|
54
|
+
@notice = _("Successfully deleted %{content}") % {:content => content_name}
|
55
|
+
content.destroy
|
68
56
|
rescue
|
69
57
|
exception_handler($!)
|
70
58
|
end
|
@@ -45,7 +45,6 @@ class Admin::ElementsController < AlchemyController
|
|
45
45
|
@element = Element.copy(source_element, {:page_id => @page.id})
|
46
46
|
if element_from_clipboard[:action] == 'cut'
|
47
47
|
source_element.destroy
|
48
|
-
@cutted_element_id = source_element.id
|
49
48
|
@clipboard.delete_if { |i| i[:id].to_i == source_element.id }
|
50
49
|
end
|
51
50
|
else
|
@@ -70,7 +69,8 @@ class Admin::ElementsController < AlchemyController
|
|
70
69
|
if @element.save_contents(params)
|
71
70
|
@page = @element.page
|
72
71
|
@element.public = !params[:public].nil?
|
73
|
-
@
|
72
|
+
@element.save
|
73
|
+
@element_validated = true
|
74
74
|
else
|
75
75
|
@element_validated = false
|
76
76
|
@notice = _('Validation failed.')
|
@@ -5,9 +5,6 @@ class Admin::EssenceAudiosController < AlchemyController
|
|
5
5
|
def update
|
6
6
|
@essence_audio = EssenceAudio.find(params[:id])
|
7
7
|
@essence_audio.update_attributes(params[:essence_audio])
|
8
|
-
render :update do |page|
|
9
|
-
page << "Alchemy.closeCurrentWindow(); Alchemy.reloadPreview()"
|
10
|
-
end
|
11
8
|
end
|
12
9
|
|
13
10
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
class Admin::EssenceFilesController < AlchemyController
|
2
2
|
|
3
3
|
filter_access_to :all
|
4
|
-
helper :contents
|
5
4
|
|
6
5
|
def edit
|
7
6
|
@content = Content.find(params[:id])
|
@@ -12,10 +11,6 @@ class Admin::EssenceFilesController < AlchemyController
|
|
12
11
|
def update
|
13
12
|
@essence_file = EssenceFile.find(params[:id])
|
14
13
|
@essence_file.update_attributes(params[:essence_file])
|
15
|
-
render :update do |page|
|
16
|
-
page.call "Alchemy.closeCurrentWindow"
|
17
|
-
page.call "Alchemy.reloadPreview"
|
18
|
-
end
|
19
14
|
end
|
20
15
|
|
21
16
|
def assign
|
@@ -25,12 +20,6 @@ class Admin::EssenceFilesController < AlchemyController
|
|
25
20
|
@content.essence.save
|
26
21
|
@content.save
|
27
22
|
@options = params[:options]
|
28
|
-
render :update do |page|
|
29
|
-
page << "jQuery('##{@content.essence_type.underscore}_#{@content.id}').replaceWith('#{escape_javascript(render(:partial => "essences/essence_file_editor.html.erb", :locals => {:content => @content, :options => @options}))}')"
|
30
|
-
page.call "Alchemy.closeCurrentWindow"
|
31
|
-
page.call "Alchemy.reloadPreview"
|
32
|
-
page.call "Alchemy.setElementDirty", "#element_#{@content.element.id}"
|
33
|
-
end
|
34
23
|
end
|
35
24
|
|
36
25
|
end
|
@@ -5,9 +5,6 @@ class Admin::EssenceFlashesController < AlchemyController
|
|
5
5
|
def update
|
6
6
|
@essence_flash = EssenceFlash.find(params[:id])
|
7
7
|
@essence_flash.update_attributes(params[:essence_flash])
|
8
|
-
render :update do |page|
|
9
|
-
page << "Alchemy.closeCurrentWindow(); Alchemy.reloadPreview()"
|
10
|
-
end
|
11
8
|
end
|
12
9
|
|
13
10
|
end
|
@@ -68,13 +68,8 @@ class Admin::EssencePicturesController < AlchemyController
|
|
68
68
|
@picture_essence.link = params[:link]
|
69
69
|
@picture_essence.link_title = params[:title]
|
70
70
|
@picture_essence.open_link_in_new_window = params[:blank]
|
71
|
-
|
72
|
-
|
73
|
-
page << "Alchemy.closeCurrentWindow()"
|
74
|
-
page << "Alchemy.reloadPreview()"
|
75
|
-
page.call('Alchemy.growl', _("saved_link"))
|
76
|
-
end
|
77
|
-
end
|
71
|
+
@notice = _("saved_link")
|
72
|
+
@picture_essence.save
|
78
73
|
end
|
79
74
|
|
80
75
|
def destroy
|
@@ -5,9 +5,6 @@ class Admin::EssenceVideosController < AlchemyController
|
|
5
5
|
def update
|
6
6
|
@essence_video = EssenceVideo.find(params[:id])
|
7
7
|
@essence_video.update_attributes(params[:essence_video])
|
8
|
-
render :update do |page|
|
9
|
-
page << "Alchemy.closeCurrentWindow(); Alchemy.reloadPreview()"
|
10
|
-
end
|
11
8
|
end
|
12
9
|
|
13
10
|
end
|
@@ -48,17 +48,11 @@ class Admin::LanguagesController < AlchemyController
|
|
48
48
|
|
49
49
|
def destroy
|
50
50
|
name = @language.name
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
end
|
55
|
-
render(:update) { |page| page.redirect_to(admin_languages_url) }
|
51
|
+
@language.destroy
|
52
|
+
flash[:notice] = ( _("Language '%{name}' destroyed") % {:name => name} )
|
53
|
+
set_language_to_default
|
56
54
|
rescue Exception => e
|
57
|
-
|
58
|
-
page << "confirm.close();"
|
59
|
-
page.call('Alchemy.growl', e, :error)
|
60
|
-
end
|
61
|
-
logger.error("++++++++++++++ #{e}")
|
55
|
+
exception_handler(e)
|
62
56
|
end
|
63
57
|
|
64
58
|
private
|
@@ -49,6 +49,7 @@ class Admin::PagesController < AlchemyController
|
|
49
49
|
render_errors_or_redirect(page, parent.layoutpage? ? admin_layoutpages_path : admin_pages_path, _("page '%{name}' created.") % {:name => page.name}, 'form#new_page_form button.button')
|
50
50
|
rescue Exception => e
|
51
51
|
exception_handler(e)
|
52
|
+
redirect_to admin_pages_path
|
52
53
|
end
|
53
54
|
|
54
55
|
# Edit the content of the page and all its elements and contents.
|
@@ -77,6 +78,7 @@ class Admin::PagesController < AlchemyController
|
|
77
78
|
# fetching page via before filter
|
78
79
|
if @page.update_attributes(params[:page])
|
79
80
|
@notice = _("Page %{name} saved") % {:name => @page.name}
|
81
|
+
@while_page_edit = request.referer.include?('edit')
|
80
82
|
else
|
81
83
|
render_remote_errors(@page, "form#edit_page_#{@page.id} button.button")
|
82
84
|
end
|
@@ -198,7 +200,8 @@ class Admin::PagesController < AlchemyController
|
|
198
200
|
page.move_to_child_of(parent)
|
199
201
|
end
|
200
202
|
flash[:notice] = _("Pages order saved")
|
201
|
-
|
203
|
+
@redirect_url = admin_pages_path
|
204
|
+
render :action => :redirect
|
202
205
|
rescue Exception => e
|
203
206
|
exception_handler(e)
|
204
207
|
end
|
@@ -209,9 +212,8 @@ class Admin::PagesController < AlchemyController
|
|
209
212
|
session[:language_id] = params[:language_id]
|
210
213
|
redirect_path = params[:layoutpages] ? admin_layoutpages_path : admin_pages_path
|
211
214
|
if request.xhr?
|
212
|
-
|
213
|
-
|
214
|
-
end
|
215
|
+
@redirect_url = redirect_path
|
216
|
+
render :action => :redirect
|
215
217
|
else
|
216
218
|
redirect_to redirect_path
|
217
219
|
end
|
@@ -7,6 +7,8 @@ class Admin::PicturesController < AlchemyController
|
|
7
7
|
|
8
8
|
cache_sweeper :pictures_sweeper, :only => [:update, :destroy]
|
9
9
|
|
10
|
+
respond_to :html, :js
|
11
|
+
|
10
12
|
def index
|
11
13
|
@size = params[:size] || 'medium'
|
12
14
|
if params[:per_page] == 'all'
|
@@ -64,7 +66,9 @@ class Admin::PicturesController < AlchemyController
|
|
64
66
|
# Are we using the Flash uploader? Or the plain html file uploader?
|
65
67
|
if params[Rails.application.config.session_options[:key]].blank?
|
66
68
|
flash[:notice] = @message
|
67
|
-
redirect_to :back
|
69
|
+
#redirect_to :back
|
70
|
+
#TODO temporary workaround; has to be fixed.
|
71
|
+
redirect_to admin_pictures_path
|
68
72
|
end
|
69
73
|
rescue Exception => e
|
70
74
|
exception_handler(e)
|
@@ -77,21 +81,17 @@ class Admin::PicturesController < AlchemyController
|
|
77
81
|
@picture.name = params[:name]
|
78
82
|
@picture.save
|
79
83
|
@message = _("Image renamed successfully from: '%{from}' to '%{to}'") % {:from => oldname, :to => @picture.name}
|
80
|
-
render :update do |page|
|
81
|
-
page.call 'Alchemy.growl', @message
|
82
|
-
end
|
83
84
|
rescue Exception => e
|
84
85
|
exception_handler(e)
|
85
86
|
end
|
86
87
|
|
87
88
|
def destroy
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
end
|
89
|
+
@picture = Picture.find(params[:id])
|
90
|
+
name = @picture.name
|
91
|
+
@picture.destroy
|
92
|
+
flash[:notice] = ( _("Image: '%{name}' deleted successfully") % {:name => name} )
|
93
|
+
@redirect_url = admin_pictures_path(:per_page => params[:per_page], :page => params[:page], :query => params[:query])
|
94
|
+
render :action => :redirect
|
95
95
|
end
|
96
96
|
|
97
97
|
def flush
|
@@ -100,10 +100,7 @@ class Admin::PicturesController < AlchemyController
|
|
100
100
|
FileUtils.rm_rf("#{Rails.root}/public/pictures/thumbnails/#{picture.id}")
|
101
101
|
expire_page(:controller => '/pictures', :action => 'zoom', :id => picture.id)
|
102
102
|
end
|
103
|
-
|
104
|
-
page.call 'Alchemy.growl', _('Picture cache flushed')
|
105
|
-
page.call "Alchemy.pleaseWaitOverlay", false
|
106
|
-
end
|
103
|
+
@notice = _('Picture cache flushed')
|
107
104
|
end
|
108
105
|
|
109
106
|
def show_in_window
|
@@ -138,9 +135,7 @@ private
|
|
138
135
|
render :partial => 'archive_overlay'
|
139
136
|
}
|
140
137
|
format.js {
|
141
|
-
render :
|
142
|
-
page << "jQuery('#alchemy_window_body').replaceWith('#{escape_javascript(render(:partial => 'archive_overlay'))}')"
|
143
|
-
end
|
138
|
+
render :action => :archive_overlay
|
144
139
|
}
|
145
140
|
end
|
146
141
|
end
|
@@ -21,11 +21,6 @@ class Admin::TrashController < AlchemyController
|
|
21
21
|
@page = Page.find_by_id(params[:page_id])
|
22
22
|
@elements = Element.trashed
|
23
23
|
@elements.map(&:destroy)
|
24
|
-
render :update do |page|
|
25
|
-
page.call('Alchemy.growl', _("Cleared trash"))
|
26
|
-
page << "Alchemy.refreshTrashWindow(#{@page.id})"
|
27
|
-
page << "jQuery('#element_trash_button .icon').removeClass('full')"
|
28
|
-
end
|
29
24
|
rescue Exception => e
|
30
25
|
exception_handler(e)
|
31
26
|
end
|
@@ -66,9 +66,8 @@ class Admin::UsersController < AlchemyController
|
|
66
66
|
if @user.destroy
|
67
67
|
flash[:notice] = ( _("User: '%{name}' deleted") % {:name => name} )
|
68
68
|
end
|
69
|
-
|
70
|
-
|
71
|
-
end
|
69
|
+
@redirect_url = admin_users_path
|
70
|
+
render :action => :redirect
|
72
71
|
end
|
73
72
|
|
74
73
|
end
|
@@ -21,22 +21,21 @@ class AlchemyController < ApplicationController
|
|
21
21
|
current_user.admin?
|
22
22
|
end
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
def render_errors_or_redirect(object, redirect_url, flash_notice, button = nil)
|
25
|
+
if object.errors.empty?
|
26
|
+
@redirect_url = redirect_url
|
27
|
+
flash[:notice] = _(flash_notice)
|
28
|
+
render :action => :redirect
|
29
|
+
else
|
30
|
+
render_remote_errors(object, button)
|
31
|
+
end
|
32
|
+
end
|
32
33
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
34
|
+
def render_remote_errors(object, button = nil)
|
35
|
+
@button = button
|
36
|
+
@errors = ("<ul>" + object.errors.sum { |a, b| "<li>" + _(b) + "</li>" } + "</ul>").html_safe
|
37
|
+
render :action => :remote_errors
|
38
|
+
end
|
40
39
|
|
41
40
|
# Returns a host string with the domain the app is running on.
|
42
41
|
def current_server
|
@@ -106,9 +105,9 @@ private
|
|
106
105
|
|
107
106
|
# Displays an error notice in the Alchemy backend.
|
108
107
|
def show_error_notice(e)
|
109
|
-
notice = "Error: #{e}"
|
108
|
+
@notice = "Error: #{e}"
|
110
109
|
if request.xhr?
|
111
|
-
render
|
110
|
+
render :action => "error_notice"
|
112
111
|
else
|
113
112
|
flash[:error] = notice
|
114
113
|
end
|
@@ -198,10 +197,7 @@ protected
|
|
198
197
|
else
|
199
198
|
flash[:info] = _('Please log in')
|
200
199
|
if request.xhr?
|
201
|
-
render :
|
202
|
-
page.call "Alchemy.closeCurrentWindow"
|
203
|
-
page.redirect_to login_path
|
204
|
-
end
|
200
|
+
render :action => :permission_denied
|
205
201
|
else
|
206
202
|
store_location
|
207
203
|
redirect_to login_path
|
@@ -245,13 +241,5 @@ protected
|
|
245
241
|
def trash_empty?(category)
|
246
242
|
category.singularize.classify.constantize.trashed.blank?
|
247
243
|
end
|
248
|
-
|
249
|
-
def layout_for_page
|
250
|
-
if !params[:layout].blank? && params[:layout] != 'none'
|
251
|
-
params[:layout]
|
252
|
-
else
|
253
|
-
'pages'
|
254
|
-
end
|
255
|
-
end
|
256
|
-
|
244
|
+
|
257
245
|
end
|