alchemy_cms 2.2.rc13 → 2.2.rc14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. data/Rakefile +3 -0
  2. data/alchemy_cms.gemspec +1 -0
  3. data/app/assets/javascripts/alchemy/alchemy.base.js +95 -94
  4. data/app/assets/javascripts/alchemy/alchemy.buttons.js +15 -11
  5. data/app/assets/javascripts/alchemy/alchemy.datepicker.js +18 -18
  6. data/app/assets/javascripts/alchemy/alchemy.dirty.js +20 -20
  7. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js +50 -44
  8. data/app/assets/javascripts/alchemy/alchemy.element_editor_selector.js +15 -12
  9. data/app/assets/javascripts/alchemy/alchemy.elements_window.js +47 -43
  10. data/app/assets/javascripts/alchemy/alchemy.file_progress.js +27 -17
  11. data/app/assets/javascripts/alchemy/alchemy.growler.js +19 -15
  12. data/app/assets/javascripts/alchemy/alchemy.html5.js +1 -2
  13. data/app/assets/javascripts/alchemy/alchemy.image_cropper.js +10 -11
  14. data/app/assets/javascripts/alchemy/alchemy.jquery_loader.js +6 -6
  15. data/app/assets/javascripts/alchemy/alchemy.js_extensions.js +4 -6
  16. data/app/assets/javascripts/alchemy/alchemy.menubar.js +16 -20
  17. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +18 -16
  18. data/app/assets/javascripts/alchemy/alchemy.preview.js +30 -30
  19. data/app/assets/javascripts/alchemy/alchemy.preview_window.js +50 -42
  20. data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +11 -11
  21. data/app/assets/javascripts/alchemy/alchemy.swf_upload.js +83 -86
  22. data/app/assets/javascripts/alchemy/alchemy.uploader.js +106 -112
  23. data/app/assets/javascripts/alchemy/alchemy.windows.js +158 -130
  24. data/app/assets/stylesheets/alchemy/base.css.scss +7 -1
  25. data/app/assets/stylesheets/alchemy/buttons.css.scss +31 -25
  26. data/app/assets/stylesheets/alchemy/elements.css.scss +4 -0
  27. data/app/controllers/alchemy/admin/base_controller.rb +5 -1
  28. data/app/helpers/alchemy/admin/base_helper.rb +21 -13
  29. data/app/helpers/alchemy/admin/contents_helper.rb +52 -11
  30. data/app/helpers/alchemy/admin/elements_helper.rb +0 -1
  31. data/app/helpers/alchemy/admin/essences_helper.rb +5 -5
  32. data/app/helpers/alchemy/essences_helper.rb +1 -0
  33. data/app/models/alchemy/content.rb +102 -91
  34. data/app/models/alchemy/essence_boolean.rb +8 -0
  35. data/app/models/alchemy/essence_select.rb +7 -0
  36. data/app/sweepers/alchemy/content_sweeper.rb +2 -4
  37. data/app/views/alchemy/admin/clipboard/clear.js.erb +3 -2
  38. data/app/views/alchemy/admin/clipboard/index.html.erb +2 -2
  39. data/app/views/alchemy/admin/contents/create.js.erb +2 -0
  40. data/app/views/alchemy/admin/contents/destroy.js.coffee +4 -0
  41. data/app/views/alchemy/admin/contents/new.html.erb +1 -1
  42. data/app/views/alchemy/admin/elements/_element_foot.html.erb +3 -2
  43. data/app/views/alchemy/admin/elements/create.js.coffee +31 -0
  44. data/app/views/alchemy/admin/elements/fold.js.coffee +37 -0
  45. data/app/views/alchemy/admin/essence_pictures/assign.js.coffee +15 -0
  46. data/app/views/alchemy/admin/essence_pictures/destroy.js.coffee +19 -0
  47. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +12 -2
  48. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
  49. data/app/views/alchemy/admin/pages/_page.html.erb +1 -1
  50. data/app/views/alchemy/admin/pages/destroy.js.coffee +19 -0
  51. data/app/views/alchemy/admin/pages/edit.html.erb +5 -5
  52. data/app/views/alchemy/admin/pages/update.js.coffee +36 -0
  53. data/app/views/alchemy/admin/resources/_form.html.erb +12 -1
  54. data/app/views/alchemy/admin/resources/_resource.html.erb +6 -3
  55. data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
  56. data/app/views/alchemy/admin/trash/clear.js.coffee +4 -0
  57. data/app/views/alchemy/admin/trash/index.html.erb +4 -4
  58. data/app/views/alchemy/elements/_article_editor.html.erb +4 -2
  59. data/app/views/alchemy/elements/_article_view.html.erb +7 -7
  60. data/app/views/alchemy/elements/_download_editor.html.erb +4 -1
  61. data/app/views/alchemy/elements/_download_view.html.erb +7 -3
  62. data/app/views/alchemy/elements/_image_mosaic_editor.html.erb +1 -0
  63. data/app/views/alchemy/elements/_image_mosaic_view.html.erb +11 -9
  64. data/app/views/alchemy/essences/_essence_boolean_editor.html.erb +14 -0
  65. data/app/views/alchemy/essences/_essence_boolean_view.html.erb +1 -0
  66. data/app/views/alchemy/essences/_essence_date_editor.html.erb +1 -1
  67. data/app/views/alchemy/essences/_essence_file_editor.html.erb +1 -0
  68. data/app/views/alchemy/essences/_essence_html_editor.html.erb +1 -1
  69. data/app/views/alchemy/essences/_essence_richtext_editor.html.erb +1 -1
  70. data/app/views/alchemy/essences/_essence_select_editor.html.erb +35 -0
  71. data/app/views/alchemy/essences/_essence_select_view.html.erb +1 -0
  72. data/app/views/alchemy/essences/_essence_text_editor.html.erb +29 -77
  73. data/app/views/alchemy/essences/_essence_text_view.html.erb +2 -2
  74. data/config/alchemy/elements.yml +72 -44
  75. data/config/locales/alchemy.de.yml +46 -45
  76. data/config/locales/alchemy.en.yml +90 -89
  77. data/db/migrate/20120608085509_create_alchemy_essence_selects.rb +11 -0
  78. data/db/migrate/20120611221734_create_alchemy_essence_booleans.rb +11 -0
  79. data/lib/alchemy/authentication_helpers.rb +3 -7
  80. data/lib/alchemy/engine.rb +3 -4
  81. data/lib/alchemy/essence.rb +24 -16
  82. data/lib/alchemy/resource.rb +22 -3
  83. data/lib/alchemy/resources_helper.rb +8 -0
  84. data/lib/alchemy/seeder.rb +26 -1
  85. data/lib/alchemy/upgrader.rb +70 -1
  86. data/lib/alchemy/version.rb +1 -1
  87. data/lib/alchemy_cms.rb +1 -0
  88. data/spec/controllers/admin/clipboard_controller_spec.rb +16 -4
  89. data/spec/controllers/admin/contents_controller_spec.rb +21 -4
  90. data/spec/dummy/app/models/event.rb +1 -1
  91. data/spec/dummy/db/schema.rb +18 -1
  92. data/spec/helpers/admin/contents_helper_spec.rb +3 -2
  93. data/spec/models/clipboard_spec.rb +14 -3
  94. data/spec/models/essence_boolean_spec.rb +15 -0
  95. data/spec/models/essence_select_spec.rb +15 -0
  96. data/spec/models/resource_spec.rb +113 -0
  97. metadata +40 -12
  98. data/app/views/alchemy/admin/contents/destroy.js.erb +0 -7
  99. data/app/views/alchemy/admin/elements/create.js.erb +0 -36
  100. data/app/views/alchemy/admin/elements/fold.js.erb +0 -41
  101. data/app/views/alchemy/admin/essence_pictures/assign.js.erb +0 -16
  102. data/app/views/alchemy/admin/essence_pictures/destroy.js.erb +0 -20
  103. data/app/views/alchemy/admin/pages/destroy.js.erb +0 -12
  104. data/app/views/alchemy/admin/pages/update.js.erb +0 -40
  105. data/app/views/alchemy/admin/trash/clear.js.erb +0 -3
  106. data/spec/dummy/app/models/.gitkeep +0 -0
@@ -1,41 +0,0 @@
1
- (function($) {
2
-
3
- var $el = $('.element_editor[data-element-id="<%= @element.id %>"]');
4
-
5
- <%- if @error -%>
6
-
7
- $("#element_<%= @element.id -%>_folder_spinner").replaceWith("<span class='error_icon' title='<%= @error -%>'>!</span>");
8
-
9
- <%- else -%>
10
-
11
- $el = $el.replaceWith('<%= escape_javascript render(:partial => "element", :object => @element) -%>');
12
- $('#element_area .sortable_cell').sortable('refresh');
13
- Alchemy.ElementEditorSelector.reinit('.element_editor[data-element-id="<%= @element.id %>"]');
14
-
15
- <%- if @element.folded -%>
16
-
17
- <%- @element.rtf_contents.each do |content| -%>
18
- rtf_<%= content.id -%> = tinymce.get('<%= content.form_field_id -%>');
19
- if (rtf_<%= content.id -%>) {
20
- rtf_<%= content.id -%>.remove();
21
- };
22
- delete rtf_<%= content.id -%>;
23
- <%- end -%>
24
-
25
- <%- else -%>
26
-
27
- $el.trigger('Alchemy.SelectElementEditor');
28
- Alchemy.SelectBox('select', $el);
29
-
30
- <%- @element.rtf_contents.each do |content| -%>
31
- Alchemy.Tinymce.addEditor('<%= content.form_field_id -%>');
32
- <%- end -%>
33
-
34
- Alchemy.ElementDirtyObserver($el);
35
- Alchemy.Datepicker('input[type="date"]', $el);
36
- Alchemy.ButtonObserver('button.button', $el);
37
- <%- end -%>
38
-
39
- <%- end -%>
40
-
41
- })(jQuery);
@@ -1,16 +0,0 @@
1
- (function($) {
2
-
3
- $('#picture_to_assign_<%= @picture.id %> a').attr('href', '#').off('click');
4
- $('#<%= content_dom_id(@content) -%>').replaceWith('<%= escape_javascript(
5
- render(
6
- :partial => "alchemy/essences/essence_picture_editor",
7
- :locals => {:content => @content, :options => @options}
8
- )
9
- ) -%>');
10
- <%- if @content.siblings.essence_pictures.count > 1 -%>
11
- Alchemy.SortableContents('#<%= @content.element.id -%>_contents', '<%= form_authenticity_token -%>');
12
- <%- end -%>
13
- Alchemy.closeCurrentWindow();
14
- Alchemy.setElementDirty('#element_<%= @content.element.id -%>');
15
-
16
- })(jQuery);
@@ -1,20 +0,0 @@
1
- (function($) {
2
-
3
- $('#essence_picture_<%= @content_id -%>').remove();
4
- Alchemy.SortableContents('#element_<%= @element.id -%>_contents', '<%= form_authenticity_token -%>');
5
-
6
- <%- if max_image_count.blank? || (@essence_pictures.length < max_image_count) -%>
7
- $('#element_<%= @element.id -%>_contents').append('<%= escape_javascript(
8
- render(
9
- :partial => "alchemy/admin/elements/add_content",
10
- :locals => {
11
- :element => @element,
12
- :options => @options
13
- }
14
- )
15
- ) -%>');
16
- <%- end -%>
17
-
18
- Alchemy.reloadPreview();
19
-
20
- })(jQuery);
@@ -1,12 +0,0 @@
1
- (function($) {
2
- $('#locked_page_<%= @page_id -%>').remove();
3
- <%- if @layoutpage -%>
4
- window.location.replace('<%= alchemy.admin_layoutpages_path -%>')
5
- <%- elsif @page_root -%>
6
- $('#sitemap').replaceWith('<%= escape_javascript(render(:partial => "sitemap")) -%>');
7
- Alchemy.growl('<%= @message -%>');
8
- Alchemy.Tooltips();
9
- <%- else -%>
10
- window.location.replace('<%= alchemy.admin_pages_path -%>');
11
- <%- end -%>
12
- })(jQuery);
@@ -1,40 +0,0 @@
1
- (function($) {
2
-
3
- Alchemy.closeCurrentWindow();
4
-
5
- <%- if @while_page_edit -%>
6
-
7
- Alchemy.reloadPreview();
8
- $('#page_<%= @page.id -%>_status').replaceWith('<%= escape_javascript(render(:partial => "page_status")) -%>');
9
-
10
- <%- else -%>
11
-
12
- $('#page_<%= @page.id -%> > .sitemap_page > .sitemap_sitename .sitemap_pagename_link').text('<%= @page.name -%>');
13
-
14
- <%- if @page.locked? && @page.locker == current_user -%>
15
-
16
- $('#locked_page_<%= @page.id -%> > a').text('<%= @page.name -%>');
17
-
18
- <%- end -%>
19
-
20
- $('#page_<%= @page.id -%>_infos').html('<%= escape_javascript(render(:partial => "page_infos", :locals => {:page => @page})) -%>');
21
-
22
- <%- if @page.restricted? -%>
23
-
24
- $('#page_<%= @page.id -%> .page_status:nth-child(3)').addClass('restricted', 'not_restricted').removeClass('not_restricted');
25
-
26
- <%- elsif @page.redirects_to_external? -%>
27
-
28
- $('#page_<%= @page.id -%> span.redirect_url').html('&raquo; <%= t("Redirects to") %>: <%= h @page.urlname %>');
29
-
30
- <%- else -%>
31
-
32
- $('#page_<%= @page.id -%> .page_status:nth-child(3)').addClass('not_restricted').removeClass('restricted');
33
-
34
- <%- end -%>
35
-
36
- <%- end -%>
37
-
38
- Alchemy.growl("<%= @notice -%>");
39
-
40
- })(jQuery);
@@ -1,3 +0,0 @@
1
- Alchemy.growl('<%= t("Cleared trash") %>');
2
- Alchemy.refreshTrashWindow(<%= @page.id %>);
3
- jQuery('#element_trash_button .icon').removeClass('full');
File without changes