alchemy_cms 3.0.0.rc5 → 3.0.0.rc6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -5
  3. data/README.md +32 -5
  4. data/alchemy_cms.gemspec +1 -1
  5. data/app/assets/javascripts/alchemy/alchemy.buttons.js.coffee +3 -3
  6. data/app/assets/javascripts/alchemy/alchemy.char_counter.js.coffee +19 -0
  7. data/app/assets/javascripts/alchemy/alchemy.confirm_dialog.js.coffee +5 -0
  8. data/app/assets/javascripts/alchemy/alchemy.dialog.js.coffee +3 -2
  9. data/app/assets/javascripts/alchemy/alchemy.dragndrop.js.coffee +2 -0
  10. data/app/assets/javascripts/alchemy/alchemy.element_editors.js.coffee +1 -1
  11. data/app/assets/javascripts/alchemy/alchemy.elements_window.js.coffee +2 -26
  12. data/app/assets/javascripts/alchemy/alchemy.file_progress.js.coffee +1 -1
  13. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +2 -0
  14. data/app/assets/javascripts/alchemy/alchemy.i18n.js.coffee +12 -7
  15. data/app/assets/javascripts/alchemy/alchemy.js +1 -1
  16. data/app/assets/javascripts/alchemy/alchemy.link_dialog.js.coffee +33 -4
  17. data/app/assets/javascripts/alchemy/alchemy.preview_window.js.coffee +1 -1
  18. data/app/assets/javascripts/alchemy/alchemy.sitemap.js.coffee +2 -13
  19. data/app/assets/javascripts/alchemy/{alchemy.tinymce.js.coffee.erb → alchemy.tinymce.js.coffee} +1 -25
  20. data/app/assets/javascripts/alchemy/alchemy.translations.js.coffee +63 -105
  21. data/app/assets/javascripts/alchemy/alchemy.uploader.js.coffee +3 -3
  22. data/app/assets/stylesheets/alchemy/_extends.scss +2 -8
  23. data/app/assets/stylesheets/alchemy/_mixins.scss +4 -9
  24. data/app/assets/stylesheets/alchemy/base.scss +6 -6
  25. data/app/assets/stylesheets/alchemy/buttons.scss +56 -29
  26. data/app/assets/stylesheets/alchemy/elements.scss +66 -14
  27. data/app/assets/stylesheets/alchemy/form_fields.scss +39 -6
  28. data/app/assets/stylesheets/alchemy/forms.scss +32 -0
  29. data/app/assets/stylesheets/alchemy/frame.scss +44 -44
  30. data/app/assets/stylesheets/alchemy/icons.scss +2 -2
  31. data/app/assets/stylesheets/alchemy/jquery-ui.scss +2 -0
  32. data/app/assets/stylesheets/alchemy/notices.scss +6 -0
  33. data/app/assets/stylesheets/alchemy/selects.scss +10 -0
  34. data/app/assets/stylesheets/alchemy/sitemap.scss +8 -10
  35. data/app/assets/stylesheets/alchemy/toolbar.scss +40 -31
  36. data/app/assets/stylesheets/tinymce/skins/alchemy/skin.min.css.scss +11 -22
  37. data/app/controllers/alchemy/admin/base_controller.rb +14 -1
  38. data/app/controllers/alchemy/admin/elements_controller.rb +4 -2
  39. data/app/controllers/alchemy/admin/layoutpages_controller.rb +5 -0
  40. data/app/controllers/alchemy/admin/legacy_page_urls_controller.rb +39 -0
  41. data/app/controllers/alchemy/admin/pages_controller.rb +0 -3
  42. data/app/controllers/alchemy/base_controller.rb +7 -4
  43. data/app/helpers/alchemy/admin/base_helper.rb +33 -3
  44. data/app/helpers/alchemy/pages_helper.rb +1 -1
  45. data/app/models/alchemy/element.rb +6 -4
  46. data/app/models/alchemy/legacy_page_url.rb +5 -1
  47. data/app/models/alchemy/message.rb +2 -2
  48. data/app/models/alchemy/page.rb +8 -9
  49. data/app/models/alchemy/page/{cells.rb → page_cells.rb} +1 -1
  50. data/app/models/alchemy/page/{elements.rb → page_elements.rb} +1 -1
  51. data/app/models/alchemy/page/{naming.rb → page_naming.rb} +33 -18
  52. data/app/models/alchemy/page/{natures.rb → page_natures.rb} +1 -1
  53. data/app/models/alchemy/page/{scopes.rb → page_scopes.rb} +1 -1
  54. data/app/models/alchemy/page/{users.rb → page_users.rb} +13 -1
  55. data/app/views/alchemy/admin/elements/_add_element_button.html.erb +18 -0
  56. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  57. data/app/views/alchemy/admin/elements/_element.html.erb +12 -11
  58. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +3 -0
  59. data/app/views/alchemy/admin/elements/create.js.erb +3 -3
  60. data/app/views/alchemy/admin/elements/index.html.erb +19 -4
  61. data/app/views/alchemy/admin/elements/new.html.erb +3 -0
  62. data/app/views/alchemy/admin/elements/trash.js.erb +16 -12
  63. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +1 -1
  64. data/app/views/alchemy/admin/layoutpages/edit.html.erb +11 -0
  65. data/app/views/alchemy/admin/layoutpages/index.html.erb +4 -16
  66. data/app/views/alchemy/admin/legacy_page_urls/_form.html.erb +5 -0
  67. data/app/views/alchemy/admin/legacy_page_urls/_label.html.erb +1 -0
  68. data/app/views/alchemy/admin/legacy_page_urls/_legacy_page_url.html.erb +13 -0
  69. data/app/views/alchemy/admin/legacy_page_urls/_new.html.erb +20 -0
  70. data/app/views/alchemy/admin/legacy_page_urls/create.js.erb +10 -0
  71. data/app/views/alchemy/admin/legacy_page_urls/destroy.js.erb +6 -0
  72. data/app/views/alchemy/admin/legacy_page_urls/update.js.erb +2 -0
  73. data/app/views/alchemy/admin/pages/_form.html.erb +58 -0
  74. data/app/views/alchemy/admin/pages/_internal_link.html.erb +9 -4
  75. data/app/views/alchemy/admin/pages/_legacy_urls.html.erb +23 -0
  76. data/app/views/alchemy/admin/pages/_locked_page.html.erb +21 -0
  77. data/app/views/alchemy/admin/pages/_page.html.erb +2 -2
  78. data/app/views/alchemy/admin/pages/_page_status.html.erb +11 -9
  79. data/app/views/alchemy/admin/pages/_tinymce_custom_config.html.erb +13 -0
  80. data/app/views/alchemy/admin/pages/configure.html.erb +16 -57
  81. data/app/views/alchemy/admin/pages/edit.html.erb +64 -66
  82. data/app/views/alchemy/admin/pages/index.html.erb +9 -19
  83. data/app/views/alchemy/admin/pages/update.js.erb +1 -1
  84. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +7 -12
  85. data/app/views/alchemy/admin/partials/_routes.html.erb +25 -0
  86. data/app/views/alchemy/admin/partials/_search_form.html.erb +10 -12
  87. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +53 -47
  88. data/app/views/alchemy/admin/pictures/index.html.erb +34 -29
  89. data/app/views/alchemy/essences/shared/_essence_picture_tools.html.erb +1 -1
  90. data/app/views/alchemy/navigation/_link.html.erb +9 -9
  91. data/app/views/alchemy/pages/show.rss.builder +2 -2
  92. data/app/views/layouts/alchemy/admin.html.erb +20 -9
  93. data/bin/alchemy +1 -1
  94. data/config/alchemy/config.yml +1 -0
  95. data/config/locales/alchemy.de.yml +15 -1
  96. data/config/locales/alchemy.en.yml +29 -19
  97. data/config/locales/alchemy.nl.yml +11 -1
  98. data/config/routes.rb +2 -1
  99. data/lib/alchemy/errors.rb +2 -2
  100. data/lib/alchemy/permissions.rb +2 -0
  101. data/lib/alchemy/resource.rb +22 -9
  102. data/lib/alchemy/tinymce.rb +13 -7
  103. data/lib/alchemy/version.rb +1 -1
  104. data/spec/controllers/admin/base_controller_spec.rb +39 -0
  105. data/spec/controllers/admin/elements_controller_spec.rb +17 -14
  106. data/spec/controllers/admin/pages_controller_spec.rb +1 -2
  107. data/spec/controllers/pages_controller_spec.rb +7 -3
  108. data/spec/dummy/app/models/dummy_user.rb +12 -2
  109. data/spec/features/admin/dashboard_spec.rb +45 -0
  110. data/spec/features/admin/legacy_page_url_management_spec.rb +62 -0
  111. data/spec/features/admin/page_editing_feature_spec.rb +66 -6
  112. data/spec/features/page_feature_spec.rb +13 -0
  113. data/spec/helpers/admin/base_helper_spec.rb +36 -0
  114. data/spec/libraries/resource_spec.rb +168 -84
  115. data/spec/libraries/tinymce_spec.rb +10 -0
  116. data/spec/models/element_spec.rb +16 -0
  117. data/spec/models/legacy_page_url_spec.rb +21 -0
  118. data/spec/models/message_spec.rb +23 -7
  119. data/spec/models/page_spec.rb +89 -12
  120. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.min.js +1 -0
  121. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.min.js +1 -0
  122. metadata +96 -75
  123. data/app/assets/javascripts/alchemy/alchemy.routes.js.erb +0 -38
  124. data/spec/models/resource_spec.rb +0 -159
@@ -1,26 +1,14 @@
1
- <% content_for(:subnav_additions) do %>
2
- <% unless @locked_pages.blank? %>
3
- <label><%= _t('Active Pages') %> &raquo;</label>
4
- <% @locked_pages.each do |page| %>
5
- <div class="subnavi_tab wide" id="locked_page_<%= page.id %>">
6
- <%= link_to alchemy.edit_admin_page_path(page) do %>
7
- <span class="page_name" title="<%= page.name %>">
8
- <%= truncate page.name, :length => 15 %>
9
- </span>
1
+ <% if @locked_pages.present? %>
2
+ <% content_for(:subnav_additions) do %>
3
+ <label><%= _t('Active Pages') %> &raquo;</label>
4
+ <%= render partial: 'locked_page', collection: @locked_pages %>
10
5
  <% end %>
11
- <%= form_tag(alchemy.unlock_admin_page_path(page), :remote => true) do %>
12
- <button class="icon_button small" title="<%= _t(:explain_unlocking) %>">
13
- <%= render_icon('close small') %>
14
- </button>
15
- <% end %>
16
- </div>
17
- <% end %>
18
- <% end %>
19
6
  <% end %>
20
7
 
21
8
  <% content_for :toolbar do %>
22
9
  <div class="toolbar_buttons">
23
10
  <%= render :partial => 'alchemy/admin/partials/language_tree_select' %>
11
+ <div class="toolbar_spacer"></div>
24
12
  <% if can?(:flush, Alchemy::Page) %>
25
13
  <div class="button_with_label">
26
14
  <%= link_to(
@@ -63,13 +51,15 @@
63
51
  </div>
64
52
  </div>
65
53
  <div class="js_filter_field_box">
66
- <input name="filter" id="search_field" class="thin_border js_filter_field">
54
+ <%= text_field_tag 'filter', '',
55
+ class: 'thin_border js_filter_field',
56
+ id: 'search_field',
57
+ placeholder: _t(:search) %>
67
58
  <%= render_icon :search %>
68
59
  <%= link_to('', '#', {
69
60
  class: "js_filter_field_clear",
70
61
  title: _t(:click_to_show_all)
71
62
  }) %>
72
- <label><%= _t :search %></label>
73
63
  </div>
74
64
  <% end %>
75
65
 
@@ -26,7 +26,7 @@
26
26
  <% if @page.restricted? -%>
27
27
  $('.page_status:nth-child(3)', $page).addClass('restricted', 'not_restricted').removeClass('not_restricted');
28
28
  <% elsif @page.redirects_to_external? -%>
29
- $('span.redirect_url', $page).html('&raquo; <%= _t("Redirects to") %>: <%= h @page.urlname %>');
29
+ $('span.redirect_url', $page).html('&raquo; <%= _t("Redirects to") %>: <%= h @page.external_urlname %>');
30
30
  <% else -%>
31
31
  $('.page_status:nth-child(3)', $page).addClass('not_restricted').removeClass('restricted');
32
32
  <% end -%>
@@ -11,18 +11,15 @@
11
11
  <%= hidden_field_tag("content_id", @content.blank? ? "" : @content.id) %>
12
12
  <div class="search_field">
13
13
  <%= render_icon('search') %>
14
- <%= text_field_tag(
15
- :query,
14
+ <%= text_field_tag :query,
16
15
  params['query'],
17
16
  class: 'thin_border',
18
- id: "search_input_field"
19
- ) %>
20
- <%= link_to(
21
- "",
22
- url_for({
17
+ id: 'search_input_field',
18
+ placeholder: _t(:search) %>
19
+ <%= link_to '', url_for({
23
20
  action: 'index',
24
- element_id: @element.blank? ? "" : @element.id,
25
- content_id: @content.blank? ? "" : @content.id,
21
+ element_id: @element.blank? ? '' : @element.id,
22
+ content_id: @content.blank? ? '' : @content.id,
26
23
  options: @options.to_json,
27
24
  size: @size,
28
25
  overlay: true
@@ -31,8 +28,6 @@
31
28
  class: 'search_field_clear',
32
29
  id: 'search_field_clear',
33
30
  title: _t(:click_to_show_all),
34
- style: (params[:query].nil? ? 'display: none' : 'display: block')
35
- ) %>
31
+ style: params[:query].nil? ? 'display: none' : 'display: block' %>
36
32
  </div>
37
- <%= submit_tag _t(:search), name: nil, class: 'button' %>
38
33
  <% end %>
@@ -0,0 +1,25 @@
1
+ <script>
2
+ Alchemy.routes = {
3
+
4
+ admin_picture_path: function(id) {
5
+ return '<%= alchemy.admin_picture_path(id: 1) %>'.replace(/1/, id);
6
+ },
7
+
8
+ admin_trash_path: function(page_id) {
9
+ var url = '<%= alchemy.admin_trash_path %>';
10
+ if (page_id) url += '?page_id=' + page_id;
11
+ return url;
12
+ },
13
+
14
+ fold_admin_element_path: function(id) {
15
+ return '<%= alchemy.fold_admin_element_path(id: 1) %>'.replace(/1/, id);
16
+ },
17
+
18
+ list_admin_elements_path: '<%= alchemy.list_admin_elements_path %>',
19
+ order_admin_contents_path: '<%= alchemy.order_admin_contents_path %>',
20
+ order_admin_elements_path: '<%= alchemy.order_admin_elements_path %>',
21
+ order_admin_pages_path: '<%= alchemy.order_admin_pages_path %>',
22
+ link_admin_pages_path: '<%= alchemy.link_admin_pages_path %>'
23
+
24
+ };
25
+ </script>
@@ -4,19 +4,17 @@
4
4
  rescue NameError
5
5
  self
6
6
  end -%>
7
- <%- url ||= url_scope.url_for(:action => 'index') -%>
8
- <%= form_tag(url, :method => :get, class: 'search_form') do %>
7
+ <%- url ||= url_scope.url_for(action: 'index') -%>
8
+ <%= form_tag(url, method: 'get', class: 'search_form') do %>
9
9
  <div class="search_field">
10
10
  <%= render_icon('search') %>
11
- <%= text_field_tag("query", params['query'], :class => 'thin_border', :id => "search_input_field") %>
12
- <%= link_to(
13
- "",
14
- url,
15
- :class => "search_field_clear",
16
- :id => "search_field_clear",
17
- :title => _t(:click_to_show_all),
18
- :style => (params[:query].nil? ? "display: none" : "display: block")
19
- ) %>
11
+ <%= text_field_tag 'query', params['query'],
12
+ class: 'thin_border', id: 'search_input_field',
13
+ placeholder: _t(:search) %>
14
+ <%= link_to '', url,
15
+ class: 'search_field_clear',
16
+ id: 'search_field_clear',
17
+ title: _t(:click_to_show_all),
18
+ style: params[:query].nil? ? 'display: none' : 'display: block' %>
20
19
  </div>
21
- <label><%= _t(:search) %></label>
22
20
  <% end %>
@@ -1,51 +1,4 @@
1
1
  <div id="image_assign_filter_and_image_sizing">
2
- <div class="button_with_label">
3
- <%= link_to(
4
- render_icon('zoom-out'),
5
- alchemy.admin_pictures_path({
6
- size: "small",
7
- content_id: @content,
8
- element_id: @element,
9
- swap: @swap,
10
- query: params[:query],
11
- options: @options.to_json
12
- }),
13
- remote: true,
14
- title: _t(:small_thumbnails),
15
- class: "icon_button"
16
- ) %>
17
- <%= link_to(
18
- render_icon('zoom-equal'),
19
- alchemy.admin_pictures_path({
20
- size: "medium",
21
- content_id: @content,
22
- element_id: @element,
23
- swap: @swap,
24
- query: params[:query],
25
- options: @options.to_json
26
- }),
27
- remote: true,
28
- title: _t(:medium_thumbnails),
29
- class: "icon_button"
30
- ) %>
31
- <%= link_to(
32
- render_icon('zoom-in'),
33
- alchemy.admin_pictures_path({
34
- size: "large",
35
- content_id: @content,
36
- element_id: @element,
37
- swap: @swap,
38
- query: params[:query],
39
- options: @options.to_json
40
- }),
41
- remote: true,
42
- title: _t(:big_thumbnails),
43
- class: "icon_button"
44
- ) %>
45
- <label><%= _t('Image size') %></label>
46
- <%= hidden_field_tag('size', @size, id: 'overlay_thumbnails_size') %>
47
- </div>
48
- <div class="toolbar_spacer"></div>
49
2
  <div class="button_with_label">
50
3
  <%= link_to_dialog(
51
4
  render_icon('upload'),
@@ -68,5 +21,58 @@
68
21
  ) %>
69
22
  <label><%= _t(:upload_image) %></label>
70
23
  </div>
24
+ <div class="toolbar_spacer"></div>
25
+ <div class="button_group">
26
+ <div class="button_with_label">
27
+ <%= link_to(
28
+ render_icon('zoom-out'),
29
+ alchemy.admin_pictures_path({
30
+ size: "small",
31
+ content_id: @content,
32
+ element_id: @element,
33
+ swap: @swap,
34
+ query: params[:query],
35
+ options: @options.to_json
36
+ }),
37
+ remote: true,
38
+ title: _t(:small_thumbnails),
39
+ class: "icon_button"
40
+ ) %>
41
+ </div>
42
+ <div class="button_with_label">
43
+ <%= link_to(
44
+ render_icon('zoom-equal'),
45
+ alchemy.admin_pictures_path({
46
+ size: "medium",
47
+ content_id: @content,
48
+ element_id: @element,
49
+ swap: @swap,
50
+ query: params[:query],
51
+ options: @options.to_json
52
+ }),
53
+ remote: true,
54
+ title: _t(:medium_thumbnails),
55
+ class: "icon_button"
56
+ ) %>
57
+ </div>
58
+ <div class="button_with_label">
59
+ <%= link_to(
60
+ render_icon('zoom-in'),
61
+ alchemy.admin_pictures_path({
62
+ size: "large",
63
+ content_id: @content,
64
+ element_id: @element,
65
+ swap: @swap,
66
+ query: params[:query],
67
+ options: @options.to_json
68
+ }),
69
+ remote: true,
70
+ title: _t(:big_thumbnails),
71
+ class: "icon_button"
72
+ ) %>
73
+ </div>
74
+ <label><%= _t('Image size') %></label>
75
+ <%= hidden_field_tag('size', @size, id: 'overlay_thumbnails_size') %>
76
+ </div>
71
77
  <%= render partial: 'alchemy/admin/partials/remote_search_form' %>
72
78
  </div>
@@ -16,38 +16,43 @@
16
16
  <% if can? :create, Alchemy::Picture %>
17
17
  <div class="toolbar_spacer"></div>
18
18
  <% end %>
19
- <div class="button_with_label">
20
- <%= link_to(
21
- render_icon('zoom-out'),
22
- alchemy.admin_pictures_path({
23
- size: "small",
24
- query: params[:query]
25
- }),
26
- title: _t(:small_thumbnails),
27
- class: "icon_button please_wait"
28
- ) %>
29
- <%= link_to(
30
- render_icon('zoom-equal'),
31
- alchemy.admin_pictures_path({
32
- size: "medium",
33
- query: params[:query]
34
- }),
35
- title: _t(:medium_thumbnails),
36
- class: "icon_button please_wait"
37
- ) %>
38
- <%= link_to(
39
- render_icon('zoom-in'),
40
- alchemy.admin_pictures_path({
41
- size: "large",
42
- query: params[:query]
43
- }),
44
- title: _t(:big_thumbnails),
45
- class: "icon_button please_wait"
46
- ) %>
19
+ <div class="button_group">
20
+ <div class="button_with_label">
21
+ <%= link_to(
22
+ render_icon('zoom-out'),
23
+ alchemy.admin_pictures_path({
24
+ size: "small",
25
+ query: params[:query]
26
+ }),
27
+ title: _t(:small_thumbnails),
28
+ class: "icon_button please_wait"
29
+ ) %>
30
+ </div>
31
+ <div class="button_with_label">
32
+ <%= link_to(
33
+ render_icon('zoom-equal'),
34
+ alchemy.admin_pictures_path({
35
+ size: "medium",
36
+ query: params[:query]
37
+ }),
38
+ title: _t(:medium_thumbnails),
39
+ class: "icon_button please_wait"
40
+ ) %>
41
+ </div>
42
+ <div class="button_with_label">
43
+ <%= link_to(
44
+ render_icon('zoom-in'),
45
+ alchemy.admin_pictures_path({
46
+ size: "large",
47
+ query: params[:query]
48
+ }),
49
+ title: _t(:big_thumbnails),
50
+ class: "icon_button please_wait"
51
+ ) %>
52
+ </div>
47
53
  <label><%= _t('Image size') %></label>
48
54
  <%= hidden_field_tag('size', @size, id: 'overlay_thumbnails_size') %>
49
55
  </div>
50
-
51
56
  <% if can?(:flush, Alchemy::Picture) %>
52
57
  <div class="toolbar_spacer"></div>
53
58
  <%= toolbar_button(
@@ -26,7 +26,7 @@
26
26
  ),
27
27
  {
28
28
  title: (content.ingredient ? _t(:swap_image) : _t(:insert_image)),
29
- size: '780x585',
29
+ size: '780x580',
30
30
  padding: false
31
31
  },
32
32
  title: (content.ingredient ? _t(:swap_image) : _t(:insert_image))
@@ -1,20 +1,20 @@
1
1
  <% if page.redirects_to_external? %>
2
2
  <%= link_to(
3
3
  h(page.name),
4
- page.urlname,
5
- :title => options[:show_title] == true ? page.title : nil,
6
- :target => configuration(:open_external_links_in_new_tab) ? '_blank' : nil,
7
- :class => external_page_css_class(page)
4
+ page.external_urlname,
5
+ title: options[:show_title] == true ? page.title : nil,
6
+ target: configuration(:open_external_links_in_new_tab) ? '_blank' : nil,
7
+ class: external_page_css_class(page)
8
8
  ) %>
9
9
  <% else %>
10
10
  <%= link_to(
11
11
  h(page.name),
12
12
  @preview_mode ? 'javascript: void(0)' : show_alchemy_page_path(page),
13
13
  {
14
- :class => (page_active?(page) ? 'active' : nil),
15
- :title => (options[:show_title] ? page.title : nil),
16
- :lang => page.language_code,
17
- :data => {'page-id' => page.id}
14
+ class: (page_active?(page) ? 'active' : nil),
15
+ title: (options[:show_title] ? page.title : nil),
16
+ lang: page.language_code,
17
+ data: {'page-id' => page.id}
18
18
  }
19
19
  ) %>
20
- <% end %>
20
+ <% end %>
@@ -9,8 +9,8 @@ xml.rss :version => "2.0" do
9
9
 
10
10
  @page.feed_elements.each do |element|
11
11
  xml.item do
12
- xml.title element.content_for_rss_title.ingredient
13
- xml.description element.content_for_rss_description.ingredient
12
+ xml.title element.content_for_rss_title.try(:ingredient)
13
+ xml.description element.content_for_rss_description.try(:ingredient)
14
14
  xml.pubDate element.ingredient('date').to_s(:rfc822) if element.has_ingredient?('date')
15
15
  xml.link show_page_url(:urlname => @page.urlname, :anchor => element_dom_id(element), :lang => multi_language? ? @page.language_code : nil)
16
16
  xml.guid show_page_url(:urlname => @page.urlname, :anchor => element_dom_id(element), :lang => multi_language? ? @page.language_code : nil)
@@ -9,19 +9,27 @@
9
9
  <%= stylesheet_link_tag('alchemy/admin', :media => 'screen', "data-turbolinks-track" => true) %>
10
10
  <%= stylesheet_link_tag('alchemy/print', :media => 'print', "data-turbolinks-track" => true) %>
11
11
  <%= yield :stylesheets %>
12
- <script type="text/javascript" charset="utf-8">
13
-
12
+ <script>
13
+ // Global Alchemy JavaScript object.
14
+ var Alchemy = {};
14
15
  // Setting TinyMCE path.
15
16
  var tinyMCEPreInit = {
16
17
  base: '<%= Rails.application.config.assets.prefix %>/tinymce',
17
18
  suffix: '.min'
18
19
  };
19
-
20
- // Initialize Alchemys JavaScript framework.
21
- var Alchemy = {};
22
- Alchemy.locale = '<%= ::I18n.locale %>';
23
-
20
+ // Store regular expression for external link url matching.
21
+ Alchemy.link_url_regexp = <%= link_url_regexp.inspect %>;
22
+ // Holds the default Alchemy TinyMCE configuration
23
+ Alchemy.Tinymce = {
24
+ defaults: {
25
+ plugins: '<%= Alchemy::Tinymce.plugins.join(',') %>',
26
+ <% Alchemy::Tinymce.init.each do |k, v| %>
27
+ <%= k %>: <%== v.to_json %>,
28
+ <% end %>
29
+ }
30
+ };
24
31
  </script>
32
+ <%= render 'alchemy/admin/partials/routes' %>
25
33
  <%= javascript_include_tag('alchemy/alchemy', "data-turbolinks-track" => true) %>
26
34
  <%= yield :javascript_includes %>
27
35
  </head>
@@ -70,11 +78,10 @@
70
78
  <%= yield(:toolbar) %>
71
79
  </div>
72
80
  <div id="user_info">
81
+ <%= current_alchemy_user_name %>
73
82
  <%= select_tag 'change_locale',
74
83
  options_for_select(translations_for_select, ::I18n.locale),
75
84
  class: 'alchemy_selectbox tiny' %>
76
- <%= _t('Logged in as') %>
77
- <%= current_alchemy_user.try(:name) %>
78
85
  </div>
79
86
  </div>
80
87
  <% end %>
@@ -82,6 +89,10 @@
82
89
  <div id="main_content">
83
90
  <%= yield %>
84
91
  </div>
92
+ <script>
93
+ // Store current locale for javascript translations.
94
+ Alchemy.locale = '<%= ::I18n.locale %>';
95
+ </script>
85
96
  <%= yield(:javascripts) %>
86
97
  </body>
87
98
  </html>
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # encoding: UTF-8
3
- gem 'rails', '~> 4.0.2'
3
+ gem 'rails', '~> 4.0'
4
4
 
5
5
  require 'rails/version'
6
6
  require "thor"