alchemy_cms 2.5.0.b5 → 2.5.0.b9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. data/README.md +1 -1
  2. data/alchemy_cms.gemspec +2 -2
  3. data/app/assets/javascripts/alchemy/alchemy.base.js +0 -24
  4. data/app/assets/javascripts/alchemy/alchemy.growler.js +2 -4
  5. data/app/assets/javascripts/alchemy/alchemy.gui.js.coffee +0 -1
  6. data/app/assets/javascripts/alchemy/alchemy.page_sorter.js +1 -1
  7. data/app/assets/stylesheets/alchemy/base.scss +4 -20
  8. data/app/assets/stylesheets/alchemy/elements.scss +19 -31
  9. data/app/assets/stylesheets/alchemy/flash.scss +11 -0
  10. data/app/assets/stylesheets/alchemy/form_elements.scss +2 -14
  11. data/app/assets/stylesheets/alchemy/menubar.css.scss +1 -0
  12. data/app/assets/stylesheets/alchemy/mixins.scss +37 -2
  13. data/app/assets/stylesheets/alchemy/notices.scss +1 -0
  14. data/app/assets/stylesheets/alchemy/sitemap.scss +30 -0
  15. data/app/assets/stylesheets/alchemy/tables.scss +20 -27
  16. data/app/controllers/alchemy/admin/attachments_controller.rb +3 -3
  17. data/app/controllers/alchemy/admin/base_controller.rb +1 -1
  18. data/app/controllers/alchemy/admin/contents_controller.rb +2 -2
  19. data/app/controllers/alchemy/admin/elements_controller.rb +3 -3
  20. data/app/controllers/alchemy/admin/essence_pictures_controller.rb +2 -2
  21. data/app/controllers/alchemy/admin/pages_controller.rb +16 -9
  22. data/app/controllers/alchemy/admin/pictures_controller.rb +8 -8
  23. data/app/controllers/alchemy/admin/resources_controller.rb +1 -1
  24. data/app/controllers/alchemy/admin/tags_controller.rb +4 -4
  25. data/app/controllers/alchemy/admin/users_controller.rb +3 -3
  26. data/app/controllers/alchemy/base_controller.rb +10 -12
  27. data/app/controllers/alchemy/messages_controller.rb +2 -2
  28. data/app/controllers/alchemy/pages_controller.rb +4 -1
  29. data/app/controllers/alchemy/pictures_controller.rb +1 -4
  30. data/app/controllers/alchemy/user_sessions_controller.rb +5 -5
  31. data/app/helpers/alchemy/admin/attachments_helper.rb +1 -1
  32. data/app/helpers/alchemy/admin/base_helper.rb +13 -13
  33. data/app/helpers/alchemy/admin/contents_helper.rb +6 -6
  34. data/app/helpers/alchemy/admin/elements_helper.rb +2 -2
  35. data/app/helpers/alchemy/admin/essences_helper.rb +8 -8
  36. data/app/helpers/alchemy/admin/pages_helper.rb +13 -7
  37. data/app/helpers/alchemy/base_helper.rb +20 -5
  38. data/app/helpers/alchemy/elements_helper.rb +2 -2
  39. data/app/helpers/alchemy/essences_helper.rb +2 -2
  40. data/app/helpers/alchemy/pages_helper.rb +2 -3
  41. data/app/models/alchemy/cell.rb +11 -3
  42. data/app/models/alchemy/content.rb +17 -17
  43. data/app/models/alchemy/element.rb +49 -26
  44. data/app/models/alchemy/legacy_page_url.rb +6 -0
  45. data/app/models/alchemy/page.rb +24 -45
  46. data/app/models/alchemy/picture.rb +1 -2
  47. data/app/views/alchemy/admin/attachments/_archive_overlay.html.erb +3 -3
  48. data/app/views/alchemy/admin/attachments/_attachment.html.erb +6 -6
  49. data/app/views/alchemy/admin/attachments/_files_list.html.erb +2 -2
  50. data/app/views/alchemy/admin/attachments/edit.html.erb +5 -3
  51. data/app/views/alchemy/admin/attachments/index.html.erb +3 -3
  52. data/app/views/alchemy/admin/attachments/new.html.erb +2 -2
  53. data/app/views/alchemy/admin/clipboard/clear.js.erb +1 -1
  54. data/app/views/alchemy/admin/clipboard/index.html.erb +3 -3
  55. data/app/views/alchemy/admin/clipboard/insert.js.erb +2 -2
  56. data/app/views/alchemy/admin/clipboard/remove.js.erb +4 -4
  57. data/app/views/alchemy/admin/contents/_missing.html.erb +2 -2
  58. data/app/views/alchemy/admin/contents/create.js.erb +1 -1
  59. data/app/views/alchemy/admin/contents/new.html.erb +3 -3
  60. data/app/views/alchemy/admin/dashboard/index.html.erb +12 -12
  61. data/app/views/alchemy/admin/elements/_add_picture.html.erb +1 -1
  62. data/app/views/alchemy/admin/elements/_element.html.erb +1 -1
  63. data/app/views/alchemy/admin/elements/_element_foot.html.erb +5 -5
  64. data/app/views/alchemy/admin/elements/_element_head.html.erb +6 -6
  65. data/app/views/alchemy/admin/elements/_elements_select.html.erb +2 -2
  66. data/app/views/alchemy/admin/elements/_new_element_form.html.erb +4 -4
  67. data/app/views/alchemy/admin/elements/_picture_gallery_editor.html.erb +1 -1
  68. data/app/views/alchemy/admin/elements/create.js.erb +2 -2
  69. data/app/views/alchemy/admin/elements/index.html.erb +2 -2
  70. data/app/views/alchemy/admin/elements/list.js.erb +1 -1
  71. data/app/views/alchemy/admin/elements/new.html.erb +4 -4
  72. data/app/views/alchemy/admin/elements/order.js.erb +1 -1
  73. data/app/views/alchemy/admin/elements/trash.js.erb +1 -1
  74. data/app/views/alchemy/admin/elements/update.js.erb +1 -1
  75. data/app/views/alchemy/admin/essence_files/edit.html.erb +5 -5
  76. data/app/views/alchemy/admin/essence_pictures/crop.html.erb +4 -4
  77. data/app/views/alchemy/admin/essence_pictures/edit.html.erb +4 -4
  78. data/app/views/alchemy/admin/languages/_form.html.erb +6 -10
  79. data/app/views/alchemy/admin/languages/_language.html.erb +4 -4
  80. data/app/views/alchemy/admin/languages/_table.html.erb +1 -1
  81. data/app/views/alchemy/admin/languages/index.html.erb +1 -1
  82. data/app/views/alchemy/admin/layoutpages/_layoutpage.html.erb +6 -6
  83. data/app/views/alchemy/admin/layoutpages/index.html.erb +8 -8
  84. data/app/views/alchemy/admin/pages/_contactform_links.html.erb +7 -7
  85. data/app/views/alchemy/admin/pages/_create_language_form.html.erb +10 -9
  86. data/app/views/alchemy/admin/pages/_external_link.html.erb +7 -7
  87. data/app/views/alchemy/admin/pages/_file_link.html.erb +6 -6
  88. data/app/views/alchemy/admin/pages/_internal_link.html.erb +5 -5
  89. data/app/views/alchemy/admin/pages/_new_page_form.html.erb +1 -1
  90. data/app/views/alchemy/admin/pages/_page.html.erb +28 -28
  91. data/app/views/alchemy/admin/pages/_page_for_links.html.erb +5 -5
  92. data/app/views/alchemy/admin/pages/_page_infos.html.erb +3 -3
  93. data/app/views/alchemy/admin/pages/_page_status.html.erb +3 -3
  94. data/app/views/alchemy/admin/pages/_sitemap.html.erb +1 -1
  95. data/app/views/alchemy/admin/pages/configure.html.erb +11 -11
  96. data/app/views/alchemy/admin/pages/configure_external.html.erb +4 -4
  97. data/app/views/alchemy/admin/pages/destroy.js.erb +0 -1
  98. data/app/views/alchemy/admin/pages/edit.html.erb +35 -35
  99. data/app/views/alchemy/admin/pages/flush.js.erb +1 -1
  100. data/app/views/alchemy/admin/pages/fold.js.erb +0 -1
  101. data/app/views/alchemy/admin/pages/index.html.erb +14 -14
  102. data/app/views/alchemy/admin/pages/link.html.erb +4 -4
  103. data/app/views/alchemy/admin/pages/locked.html.erb +1 -1
  104. data/app/views/alchemy/admin/pages/new.html.erb +4 -4
  105. data/app/views/alchemy/admin/pages/update.js.erb +2 -2
  106. data/app/views/alchemy/admin/partials/_autocomplete_tag_list.html.erb +1 -1
  107. data/app/views/alchemy/admin/partials/_flash_notices.html.erb +3 -3
  108. data/app/views/alchemy/admin/partials/_flash_upload.html.erb +8 -8
  109. data/app/views/alchemy/admin/partials/_language_tree_select.html.erb +1 -1
  110. data/app/views/alchemy/admin/partials/_main_navigation_entry.html.erb +1 -1
  111. data/app/views/alchemy/admin/partials/_remote_search_form.html.erb +2 -2
  112. data/app/views/alchemy/admin/partials/_search_form.html.erb +2 -2
  113. data/app/views/alchemy/admin/partials/_sub_navigation_tab.html.erb +1 -1
  114. data/app/views/alchemy/admin/partials/_upload_form.html.erb +11 -11
  115. data/app/views/alchemy/admin/pictures/_archive.html.erb +13 -13
  116. data/app/views/alchemy/admin/pictures/_filter_and_size_bar.html.erb +7 -7
  117. data/app/views/alchemy/admin/pictures/_filter_bar.html.erb +4 -4
  118. data/app/views/alchemy/admin/pictures/_overlay_picture_list.html.erb +1 -1
  119. data/app/views/alchemy/admin/pictures/_picture.html.erb +7 -7
  120. data/app/views/alchemy/admin/pictures/_picture_to_assign.html.erb +1 -1
  121. data/app/views/alchemy/admin/pictures/_tag_list.html.erb +2 -2
  122. data/app/views/alchemy/admin/pictures/edit.html.erb +2 -2
  123. data/app/views/alchemy/admin/pictures/edit_multiple.html.erb +6 -6
  124. data/app/views/alchemy/admin/pictures/index.html.erb +10 -10
  125. data/app/views/alchemy/admin/pictures/info.html.erb +2 -2
  126. data/app/views/alchemy/admin/pictures/new.html.erb +2 -2
  127. data/app/views/alchemy/admin/resources/_boolean.html.erb +5 -0
  128. data/app/views/alchemy/admin/resources/_datetime.html.erb +2 -0
  129. data/app/views/alchemy/admin/resources/_form.html.erb +17 -28
  130. data/app/views/alchemy/admin/resources/_resource.html.erb +4 -4
  131. data/app/views/alchemy/admin/resources/_string.html.erb +5 -0
  132. data/app/views/alchemy/admin/resources/_table.html.erb +1 -1
  133. data/app/views/alchemy/admin/resources/_text.html.erb +5 -0
  134. data/app/views/alchemy/admin/resources/index.html.erb +1 -1
  135. data/app/views/alchemy/admin/tags/_tag.html.erb +4 -4
  136. data/app/views/alchemy/admin/tags/edit.html.erb +4 -4
  137. data/app/views/alchemy/admin/tags/index.html.erb +5 -5
  138. data/app/views/alchemy/admin/tags/new.html.erb +2 -2
  139. data/app/views/alchemy/admin/trash/clear.js.coffee +1 -1
  140. data/app/views/alchemy/admin/trash/index.html.erb +3 -3
  141. data/app/views/alchemy/admin/users/_table.html.erb +3 -3
  142. data/app/views/alchemy/admin/users/_user.html.erb +6 -6
  143. data/app/views/alchemy/admin/users/index.html.erb +4 -4
  144. data/app/views/alchemy/base/error_notice.html.erb +1 -4
  145. data/app/views/alchemy/elements/_editor_not_found.html.erb +2 -2
  146. data/app/views/alchemy/essences/_essence_boolean_view.html.erb +1 -1
  147. data/app/views/alchemy/essences/_essence_file_editor.html.erb +7 -7
  148. data/app/views/alchemy/essences/_essence_picture_editor.html.erb +5 -5
  149. data/app/views/alchemy/essences/_essence_picture_tools.html.erb +8 -8
  150. data/app/views/alchemy/essences/_linkable_essence_tools.html.erb +2 -2
  151. data/app/views/alchemy/search/_form.html.erb +2 -2
  152. data/app/views/alchemy/search/_result.html.erb +1 -1
  153. data/app/views/alchemy/search/_results.html.erb +3 -3
  154. data/app/views/alchemy/user_sessions/leave.html.erb +5 -5
  155. data/app/views/alchemy/user_sessions/login.html.erb +1 -1
  156. data/app/views/alchemy/user_sessions/signup.html.erb +2 -2
  157. data/app/views/kaminari/_gap.html.erb +1 -1
  158. data/app/views/kaminari/_next_page.html.erb +2 -2
  159. data/app/views/kaminari/_prev_page.html.erb +2 -2
  160. data/app/views/layouts/alchemy/admin.html.erb +7 -7
  161. data/bin/alchemy +1 -1
  162. data/config/authorization_rules.rb +1 -3
  163. data/config/locales/alchemy.de.yml +33 -23
  164. data/config/locales/alchemy.en.yml +31 -6
  165. data/db/migrate/{20121026100815_alchemy_two_point_three.rb → 20121118000000_alchemy_two_point_four.rb} +51 -28
  166. data/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +11 -0
  167. data/lib/alchemy/capistrano.rb +22 -30
  168. data/lib/alchemy/errors.rb +45 -0
  169. data/lib/alchemy/i18n.rb +7 -5
  170. data/lib/alchemy/logger.rb +16 -0
  171. data/lib/alchemy/page_layout.rb +3 -3
  172. data/lib/alchemy/resource.rb +17 -1
  173. data/lib/alchemy/resources_helper.rb +8 -1
  174. data/lib/alchemy/upgrader.rb +9 -0
  175. data/lib/alchemy/version.rb +1 -1
  176. data/lib/alchemy_cms.rb +1 -6
  177. data/lib/rails/generators/alchemy/scaffold/files/elements.yml +41 -19
  178. data/lib/rails/generators/alchemy/scaffold/scaffold_generator.rb +13 -0
  179. data/lib/tasks/alchemy/db.rake +5 -11
  180. data/lib/tasks/alchemy/install.rake +7 -7
  181. data/spec/controllers/admin/pages_controller_spec.rb +14 -2
  182. data/spec/controllers/pages_controller_spec.rb +50 -17
  183. data/spec/dummy/config/application.rb +1 -1
  184. data/spec/dummy/db/migrate/{20121026100815_alchemy_two_point_three.rb → 20121118000000_alchemy_two_point_four.rb} +51 -28
  185. data/spec/dummy/db/migrate/20130110212411_create_alchemy_legacy_page_urls.rb +11 -0
  186. data/spec/dummy/db/schema.rb +10 -1
  187. data/spec/factories.rb +1 -0
  188. data/spec/integration/admin/picture_library_integration_spec.rb +8 -2
  189. data/spec/integration/security_spec.rb +2 -2
  190. data/spec/integration/translation_integration_spec.rb +20 -4
  191. data/spec/libraries/resources_helper_spec.rb +1 -1
  192. data/spec/models/cell_spec.rb +45 -0
  193. data/spec/models/page_spec.rb +19 -2
  194. data/spec/models/picture_spec.rb +12 -0
  195. data/spec/routing_spec.rb +115 -115
  196. data/spec/spec_helper.rb +3 -0
  197. data/spec/support/alchemy/specs_helpers.rb +6 -2
  198. data/spec/support/image.png +0 -0
  199. data/spec/support/image2.PNG +0 -0
  200. data/spec/support/image3.jpeg +0 -0
  201. metadata +27 -23
  202. data/db/migrate/20121113115120_create_alchemy_essence_links.rb +0 -13
  203. data/db/migrate/20121115100736_add_cached_tag_list_to_elements_pages_and_users.rb +0 -7
  204. data/db/migrate/20121116140636_add_cached_tag_list_to_alchemy_attachments.rb +0 -5
  205. data/db/migrate/20121116141016_change_alchemy_pictures_tag_list_column.rb +0 -9
  206. data/spec/dummy/db/migrate/20121113115120_create_alchemy_essence_links.rb +0 -13
  207. data/spec/dummy/db/migrate/20121115100736_add_cached_tag_list_to_elements_pages_and_users.rb +0 -7
  208. data/spec/dummy/db/migrate/20121116140636_add_cached_tag_list_to_alchemy_attachments.rb +0 -5
  209. data/spec/dummy/db/migrate/20121116141016_change_alchemy_pictures_tag_list_column.rb +0 -9
@@ -11,21 +11,21 @@
11
11
 
12
12
  <div class="info">
13
13
  <%= render_icon :info %>
14
- <p><%= t("You are about to edit %{length} pictures at once") % {:length => @pictures.length} %></p>
14
+ <p><%= _t("You are about to edit %{length} pictures at once") % {:length => @pictures.length} %></p>
15
15
  </div>
16
16
 
17
17
  <table>
18
18
  <tr>
19
- <td class="label"><%= label_tag :pictures_name, t('Name') %></td>
19
+ <td class="label"><%= label_tag :pictures_name, _t('Name') %></td>
20
20
  <td class="input">
21
21
  <%= text_field_tag :pictures_name, nil, :class => "thin_border long" %>
22
22
  </td>
23
23
  </tr>
24
24
  <tr>
25
- <td class="label"><%= label_tag :pictures_tag_list, t('Tags') + '*' %></td>
25
+ <td class="label"><%= label_tag :pictures_tag_list, _t('Tags') + '*' %></td>
26
26
  <td class="input">
27
27
  <div class="autocomplete_tag_list">
28
- <%= label_tag :tag_list, render_icon(:tag_label), :for => "autocomplete_tag_list", :title => t(:tag_list) %>
28
+ <%= label_tag :tag_list, render_icon(:tag_label), :for => "autocomplete_tag_list", :title => _t(:tag_list) %>
29
29
  <%= autocomplete_field_tag(
30
30
  :pictures_tag_list,
31
31
  @pictures.collect(&:tag_list).flatten.uniq.join(', '),
@@ -38,11 +38,11 @@
38
38
  </tr>
39
39
  <tr>
40
40
  <td class="submit" colspan="2">
41
- <%= button_tag t(:save), :name => nil, :class => 'button' %>
41
+ <%= button_tag _t(:save), :name => nil, :class => 'button' %>
42
42
  </td>
43
43
  </tr>
44
44
  </table>
45
45
 
46
- <p class="foot_note"><%= t('Please seperate the tags with commata') %></p>
46
+ <p class="foot_note"><%= _t('Please seperate the tags with commata') %></p>
47
47
 
48
48
  <% end %>
@@ -2,14 +2,14 @@
2
2
  <div id="toolbar_buttons">
3
3
  <%= toolbar_button(
4
4
  :icon => 'upload',
5
- :label => t('upload_image'),
5
+ :label => _t('upload_image'),
6
6
  :url => alchemy.new_admin_picture_path(:size => @size),
7
7
  :overlay_options => {
8
- :title => t('upload_image'),
8
+ :title => _t('upload_image'),
9
9
  :size => '540x590'
10
10
  },
11
11
  :class => 'icon_button',
12
- :title => t('upload_image'),
12
+ :title => _t('upload_image'),
13
13
  :if_permitted_to => [:new, :alchemy_admin_pictures]
14
14
  ) %>
15
15
  <div class="toolbar_spacer"></div>
@@ -20,7 +20,7 @@
20
20
  :size => "small",
21
21
  :query => params[:query]
22
22
  }),
23
- :title => t("small_thumbnails"),
23
+ :title => _t("small_thumbnails"),
24
24
  :class => "icon_button please_wait"
25
25
  ) %>
26
26
  <%= link_to(
@@ -29,7 +29,7 @@
29
29
  :size => "medium",
30
30
  :query => params[:query]
31
31
  }),
32
- :title => t("medium_thumbnails"),
32
+ :title => _t("medium_thumbnails"),
33
33
  :class => "icon_button please_wait"
34
34
  ) %>
35
35
  <%= link_to(
@@ -38,10 +38,10 @@
38
38
  :size => "large",
39
39
  :query => params[:query]
40
40
  }),
41
- :title => t("big_thumbnails"),
41
+ :title => _t("big_thumbnails"),
42
42
  :class => "icon_button please_wait"
43
43
  ) %>
44
- <label><%= t('Image size') %></label>
44
+ <label><%= _t('Image size') %></label>
45
45
  <%= hidden_field_tag('size', @size, :id => 'overlay_thumbnails_size') %>
46
46
  </div>
47
47
 
@@ -55,16 +55,16 @@
55
55
  :remote => true,
56
56
  :method => :post
57
57
  },
58
- :label => t('Flush picture cache'),
58
+ :label => _t('Flush picture cache'),
59
59
  :class => 'icon_button please_wait',
60
- :title => t('Flush picture cache'),
60
+ :title => _t('Flush picture cache'),
61
61
  :skip_permission_check => true
62
62
  ) %>
63
63
  <% end %>
64
64
  <div class="toolbar_spacer"></div>
65
65
  <div class="button_with_label">
66
66
  <%= link_to render_icon('select_all'), '', :id => 'select_all_pictures', :class => 'icon_button' %>
67
- <label><%= t("Select all") %></label>
67
+ <label><%= _t("Select all") %></label>
68
68
  </div>
69
69
  </div>
70
70
 
@@ -20,9 +20,9 @@
20
20
  </div>
21
21
  <div id="pictures_page_list">
22
22
  <% if @picture.deletable? %>
23
- <h2><%= t :this_picture_is_not_used_on_any_page %></h2>
23
+ <h2><%= _t(:this_picture_is_not_used_on_any_page) %></h2>
24
24
  <% else %>
25
- <h2><%= t :this_picture_is_used_on_these_pages %>:</h2>
25
+ <h2><%= _t(:this_picture_is_used_on_these_pages) %>:</h2>
26
26
  <ul class="list">
27
27
  <% @picture.essence_pictures.group_by(&:page).each do |page, essence_pictures| %>
28
28
  <li>
@@ -3,9 +3,9 @@
3
3
  :partial => "alchemy/admin/partials/upload_form",
4
4
  :locals => {
5
5
  :file_types => configuration(:uploader)['allowed_filetypes']['pictures'],
6
- :file_types_description => t('images'),
6
+ :file_types_description => _t('images'),
7
7
  :model_name => 'picture',
8
- :item_type => t('images')
8
+ :item_type => _t('images')
9
9
  }
10
10
  ) %>
11
11
  <%= f.submit :upload, :style => 'display: none' %>
@@ -0,0 +1,5 @@
1
+ <td></td>
2
+ <td class="checkbox">
3
+ <%= f.send :check_box, attribute[:name] -%>
4
+ <%= f.send :label, attribute[:name] %>
5
+ </td>
@@ -0,0 +1,2 @@
1
+ <td class="label"><%= f.send :label, attribute[:name] %></td>
2
+ <td class="input"><%= f.send :text_field, attribute[:name], :type => :date -%></td>
@@ -7,40 +7,29 @@
7
7
  </ul>
8
8
  </div>
9
9
  <table>
10
- <%- resource_handler.attributes.each do |attribute| -%>
10
+ <% resource_handler.attributes.each do |attribute| %>
11
11
  <tr>
12
- <%- if attribute[:type] == :boolean -%>
13
- <td></td>
14
- <td class="checkbox">
15
- <%= f.send :check_box, attribute[:name] -%>
16
- <%= f.send :label, attribute[:name] %>
17
- </td>
18
- <%- elsif attribute[:type] == :text -%>
19
- <td class="label"><%= f.send :label, attribute[:name] %></td>
20
- <td class="input"><%= f.send :text_area, attribute[:name], :rows => 4 -%></td>
21
- <%- elsif attribute[:type] == :datetime -%>
22
- <td class="label"><%= f.send :label, attribute[:name] %></td>
23
- <td class="input"><%= f.send :text_field, attribute[:name], :type => :date -%></td>
24
- <%- else -%>
25
- <td class="label"><%= f.send :label, attribute[:name] %></td>
26
-
27
- <% attr_array = attribute[:name].split('.') %>
28
- <% if attr_array.length > 1 %>
29
- <td class="select">
30
- <%= f.send :select, "#{attr_array[0]}_id", attr_array[0].classify.constantize.all.collect {|r| [r.send(attr_array[1]), r.id] }, {:prompt => t("Please choose")}, {:class => "alchemy_selectbox"} %>
31
- </td>
32
- <% else %>
33
- <td class="input">
34
- <%= f.send :text_field, attribute[:name], :class => 'thin_border' -%>
12
+ <% attr_array = attribute[:name].split('.') %>
13
+ <% if attr_array.length > 1 %>
14
+ <td class="select">
15
+ <%= f.send(:select,
16
+ "#{attr_array[0]}_id",
17
+ attr_array[0].classify.constantize.all.collect {|r| [r.send(attr_array[1]), r.id] },
18
+ { :prompt => _t("Please choose") }, { :class => "alchemy_selectbox" }
19
+ ) %>
35
20
  </td>
21
+ <% else %>
22
+ <% begin %>
23
+ <%= render attribute[:type].to_s, attribute: attribute, f: f %>
24
+ <% rescue ActionView::MissingTemplate %>
25
+ <%= render 'string', attribute: attribute, f: f %>
36
26
  <% end %>
37
-
38
- <%- end -%>
27
+ <% end %>
39
28
  </tr>
40
- <%- end -%>
29
+ <% end %>
41
30
  <tr>
42
31
  <td class="submit" colspan="2">
43
- <%= f.button t('save'), :class => 'button' %>
32
+ <%= f.button _t('save'), :class => 'button' %>
44
33
  </td>
45
34
  </tr>
46
35
  </table>
@@ -18,9 +18,9 @@
18
18
  <%- permitted_to?(:destroy, resource_permission_scope) do -%>
19
19
  <%= link_to_confirmation_window(
20
20
  '',
21
- t("Are you sure?"),
21
+ _t("Are you sure?"),
22
22
  resource_path(resource),
23
- :title => t("Delete"),
23
+ :title => _t("Delete"),
24
24
  :class => "icon destroy",
25
25
  :id => "delete_#{resource_handler.model_name}_#{resource.id}"
26
26
  ) -%>
@@ -30,12 +30,12 @@
30
30
  '',
31
31
  edit_resource_path(resource),
32
32
  {
33
- :title => t("Edit"),
33
+ :title => _t("Edit"),
34
34
  :size => resource_window_size
35
35
  },
36
36
  {
37
37
  :class => "icon edit",
38
- :title => t("Edit")
38
+ :title => _t("Edit")
39
39
  }
40
40
  ) -%>
41
41
  <%- end -%>
@@ -0,0 +1,5 @@
1
+ <td class="label"><%= f.send :label, attribute[:name] %></td>
2
+ <td class="input">
3
+ <%= f.send :text_field, attribute[:name], :class => 'thin_border' %>
4
+ <%= resource_help_text attribute %>
5
+ </td>
@@ -17,7 +17,7 @@
17
17
  <%= render_resources %>
18
18
  </table>
19
19
  <%- elsif params[:query] -%>
20
- <p><%= t('Nothing found') %></p>
20
+ <p><%= _t('Nothing found') %></p>
21
21
  <%- end -%>
22
22
 
23
23
  <%= render 'alchemy/admin/partials/pagination_links', :items => resources_instance_variable, :scope => resource_url_proxy %>
@@ -0,0 +1,5 @@
1
+ <td class="label"><%= f.send :label, attribute[:name] %></td>
2
+ <td class="input">
3
+ <%= f.send :text_area, attribute[:name], :rows => 4 %>
4
+ <%= resource_help_text attribute %>
5
+ </td>
@@ -1,4 +1,4 @@
1
- <%- label_title = t("Create #{resource_model_name}", :default => t('Create')) -%>
1
+ <%- label_title = _t("Create #{resource_model_name}", :default => _t('Create')) -%>
2
2
 
3
3
  <%- toolbar(
4
4
  :buttons => [
@@ -10,19 +10,19 @@
10
10
  "",
11
11
  edit_admin_tag_path(tag),
12
12
  {
13
- :title => t(:edit_tag),
13
+ :title => _t(:edit_tag),
14
14
  :size => '360x385'
15
15
  },
16
16
  {
17
- :title => t(:edit_tag),
17
+ :title => _t(:edit_tag),
18
18
  :class => 'icon tag_edit'
19
19
  }
20
20
  ) %>
21
21
  <%= link_to_confirmation_window(
22
22
  '',
23
- t(:do_you_really_want_to_delete_this_tag?),
23
+ _t(:do_you_really_want_to_delete_this_tag?),
24
24
  admin_tag_path(tag),
25
- :title => t(:delete_tag),
25
+ :title => _t(:delete_tag),
26
26
  :class => "icon tag_delete"
27
27
  ) %>
28
28
  </td>
@@ -1,4 +1,4 @@
1
- <h2 class="with_padding"><%= t(:you_can_rename_this_tag) %></h2>
1
+ <h2 class="with_padding"><%= _t(:you_can_rename_this_tag) %></h2>
2
2
  <%= form_for @tag, :as => :tag, :url => {:controller => :tags, :action => "update", :id => @tag.id}, :html => {:method => :put}, :remote => true do |f| %>
3
3
  <table border="0" cellspacing="4" cellpadding="4" style="width: 100%">
4
4
  <tr>
@@ -11,13 +11,13 @@
11
11
  </tr>
12
12
  <tr>
13
13
  <td colspan="2" class="submit">
14
- <%= f.button t(:rename), :class => "button" %>
14
+ <%= f.button _t(:rename), :class => "button" %>
15
15
  </td>
16
16
  </tr>
17
17
  </table>
18
18
  <% end %>
19
19
  <% if @tags.any? -%>
20
- <h2 class="with_padding"><%= t(:or_replace_it_with_an_existing_tag) %>:</h2>
20
+ <h2 class="with_padding"><%= _t(:or_replace_it_with_an_existing_tag) %>:</h2>
21
21
  <%= form_for @tag, :as => :tag, :url => {:controller => :tags, :action => "update", :id => @tag.id, :replace => true}, :html => {:method => :put, :style => "clear: both"}, :remote => true do |f| %>
22
22
  <table border="0" cellspacing="4" cellpadding="4" style="width: 100%">
23
23
  <tr>
@@ -33,7 +33,7 @@
33
33
  </tr>
34
34
  <tr>
35
35
  <td colspan="2" class="submit">
36
- <%= f.button t(:replace), :class => "button", :id => "tag_replace_button" %>
36
+ <%= f.button _t(:replace), :class => "button", :id => "tag_replace_button" %>
37
37
  </td>
38
38
  </tr>
39
39
  </table>
@@ -5,13 +5,13 @@
5
5
  content_tag('span', '', :class => 'icon tag_add'),
6
6
  new_admin_tag_path,
7
7
  {
8
- :title => t('New Tag'),
8
+ :title => _t('New Tag'),
9
9
  :size => '310x210'
10
10
  },
11
- :title => t('New Tag'),
11
+ :title => _t('New Tag'),
12
12
  :class => 'icon_button'
13
13
  ) %><br />
14
- <label><%= t('New Tag') %></label>
14
+ <label><%= _t('New Tag') %></label>
15
15
  </div>
16
16
  </div>
17
17
  <%= render :partial => 'alchemy/admin/partials/search_form' %>
@@ -36,9 +36,9 @@
36
36
  <% else %>
37
37
 
38
38
  <%= render_message do %>
39
- <h2><%= t('No Tags found') %></h2>
39
+ <h2><%= _t('No Tags found') %></h2>
40
40
  <% if params[:query].blank? %>
41
- <p><%= t(:tags_get_created_if_used_the_first_time) %></p>
41
+ <p><%= _t(:tags_get_created_if_used_the_first_time) %></p>
42
42
  <% end %>
43
43
  <% end %>
44
44
 
@@ -1,7 +1,7 @@
1
1
  <%= form_for [:admin, @tag], :as => :tag, :url => admin_tags_path, :html => {:id => 'new_tag'}, :remote => true do |form| %>
2
2
  <div class="info">
3
3
  <%= render_icon('info') %>
4
- <%= t(:tags_get_created_if_used_the_first_time) %>
4
+ <%= _t(:tags_get_created_if_used_the_first_time) %>
5
5
  </div>
6
6
  <div id="errors" style="display: none"></div>
7
7
  <table>
@@ -10,7 +10,7 @@
10
10
  <td class="input"><%= form.text_field :name, :class => 'input_field' %></td>
11
11
  </tr>
12
12
  <tr>
13
- <td colspan="2" class="submit"><%= form.button t('save'), :name => nil, :class => 'button' %></td>
13
+ <td colspan="2" class="submit"><%= form.button _t('save'), :name => nil, :class => 'button' %></td>
14
14
  </tr>
15
15
  </table>
16
16
  <% end %>
@@ -1,4 +1,4 @@
1
- Alchemy.growl '<%= t("Cleared trash") %>'
1
+ Alchemy.growl '<%= _t("Cleared trash") %>'
2
2
  Alchemy.refreshTrashWindow <%= @page.id %>
3
3
  jQuery('#element_trash_button .icon').removeClass 'full'
4
4
  Alchemy.pleaseWaitOverlay false
@@ -2,12 +2,12 @@
2
2
  <%- if @elements.blank? -%>
3
3
  <div id="trash_empty_notice" <%= @elements.blank? ? '' : 'style="display: none"' %> class="info">
4
4
  <%= render_icon('info') %>
5
- <%= t('Your trash is empty') %>
5
+ <%= _t('Your trash is empty') %>
6
6
  </div>
7
7
  <%- else -%>
8
8
  <div class="info">
9
9
  <%= render_icon('info') %>
10
- <%= t('Drag an element over to the element window to restore it') %>
10
+ <%= _t('Drag an element over to the element window to restore it') %>
11
11
  </div>
12
12
  <div id="trash_items">
13
13
  <%- @elements.each do |element| -%>
@@ -15,7 +15,7 @@
15
15
  <%- end -%>
16
16
  </div>
17
17
  <p>
18
- <%= link_to_confirmation_window(t('clear trash'), t('Do you really want to clear the trash?'), alchemy.clear_admin_trash_path(:page_id => @page.id), :class => 'button') %>
18
+ <%= link_to_confirmation_window(_t('clear trash'), _t('Do you really want to clear the trash?'), alchemy.clear_admin_trash_path(:page_id => @page.id), :class => 'button') %>
19
19
  </p>
20
20
  <%- end -%>
21
21
  </div>
@@ -1,7 +1,7 @@
1
1
  <table>
2
2
  <tr>
3
3
  <td class="label"><%= f.label 'gender' %></td>
4
- <td class="select"><%= f.select 'gender', options_for_select(@user_genders, @user.gender), {:prompt => t('Please choose')}, :class => 'alchemy_selectbox long', :autofocus => true -%></td>
4
+ <td class="select"><%= f.select 'gender', options_for_select(@user_genders, @user.gender), {:prompt => _t('Please choose')}, :class => 'alchemy_selectbox long', :autofocus => true -%></td>
5
5
  </tr>
6
6
  <tr>
7
7
  <td class="label"><%= f.label 'firstname' %></td>
@@ -51,12 +51,12 @@
51
51
  <td>&nbsp;</td>
52
52
  <td class="checkbox long">
53
53
  <%= check_box_tag('send_credentials', true, @user.new_record?) %>
54
- <%= label_tag('send_credentials', t('Send email with credentials')) %>
54
+ <%= label_tag('send_credentials', _t('Send email with credentials')) %>
55
55
  </td>
56
56
  </tr>
57
57
  <tr>
58
58
  <td class="submit" colspan="2">
59
- <%= f.button t('save'), :class => 'button' %>
59
+ <%= f.button _t('save'), :class => 'button' %>
60
60
  </td>
61
61
  </tr>
62
62
  </table>
@@ -7,16 +7,16 @@
7
7
  <td class="name"><%= user.firstname -%></td>
8
8
  <td><%= user.lastname -%></td>
9
9
  <td class="email"><%= user.email %></td>
10
- <td><%= t(user.language, :scope => 'translations') %></td>
11
- <td><%= user.last_login_at.present? ? l(user.last_login_at, :format => :default) : t(:unknown) %></td>
10
+ <td><%= _t(user.language, :scope => 'translations') %></td>
11
+ <td><%= user.last_login_at.present? ? l(user.last_login_at, :format => :default) : _t(:unknown) %></td>
12
12
  <td class="role"><%= user.human_role_name %></td>
13
13
  <td class="tools">
14
14
  <%- permitted_to?(:destroy, :alchemy_admin_users) do -%>
15
15
  <%= link_to_confirmation_window(
16
16
  '',
17
- t("confirm_to_delete_user"),
17
+ _t("confirm_to_delete_user"),
18
18
  alchemy.admin_user_path(user),
19
- :title => t('delete_user'),
19
+ :title => _t('delete_user'),
20
20
  :class => "icon user_delete#{user.gender == 'female' ? ' female' : ' male'}"
21
21
  ) -%>
22
22
  <%- end -%>
@@ -25,13 +25,13 @@
25
25
  '',
26
26
  alchemy.edit_admin_user_path(user),
27
27
  {
28
- :title => t('edit_user'),
28
+ :title => _t('edit_user'),
29
29
  :overflow => true,
30
30
  :size => '420x560'
31
31
  },
32
32
  {
33
33
  :class => "icon user_edit#{user.gender == 'female' ? ' female' : ' male'}",
34
- :title => t('edit_user')
34
+ :title => _t('edit_user')
35
35
  }
36
36
  ) -%>
37
37
  <%- end -%>