activeadmin-selleo-cms 0.0.36 → 0.0.37

Sign up to get free protection for your applications and to get access to all the features.
@@ -85,11 +85,11 @@ module ActiveadminSelleoCms
85
85
  end
86
86
 
87
87
  def section_names
88
- @section_names ||= layout.section_names
88
+ layout.section_names
89
89
  end
90
90
 
91
91
  def layout
92
- @layout ||= Layout.find(layout_name)
92
+ Layout.find(layout_name)
93
93
  end
94
94
 
95
95
  def to_param
@@ -3,7 +3,7 @@
3
3
  %input{name: "_change_layout", type: "hidden"}
4
4
  - @page.new_record? ? @page.initialize_missing_translations : @page.create_missing_translations
5
5
  - current_locale = ActiveadminSelleoCms::Locale.find_by_code(I18n.default_locale)
6
- - @page.create_missing_sections unless @page.new_record?
6
+ - @page.new_record? ? @page.initialize_missing_sections : @page.create_missing_sections
7
7
  - @section_forms = []
8
8
  -#= @page.errors.full_messages
9
9
 
@@ -1,5 +1,5 @@
1
1
  - @page.sections.each do |section|
2
- - section.create_missing_translations unless @page.new_record?
2
+ - @page.new_record? ? section.initialize_missing_translations : section.create_missing_translations
3
3
  = form.inputs "#{locale.name} translation" do
4
4
  %ol
5
5
  = form.input :title
@@ -23,35 +23,36 @@
23
23
  - if section.text?
24
24
  = section_form_translated.input :body, as: section.type, label: "Content", input_html: { toolbar: section.toolbar }
25
25
 
26
- - elsif section.image?
27
- %li.input
28
- %label Image
29
- %ol{ :style => "padding-left: 275px;" }
30
- %li= button_to_function t("active_admin.cms.file_manager.edit_image"), "fileManager('#{section_form_translated.object.image ? edit_admin_image_path(section_form_translated.object.image.id) : new_admin_image_path(image: { assetable_type: section_form_translated.object.class.name, assetable_id: section_form_translated.object.id })}')", style: "padding: 5px;"
31
-
32
- - elsif section.images?
33
- %li.input
34
- %label Attachments
35
- %ol{ :style => "padding-left: 275px;" }
36
- %li= button_to_function t("active_admin.cms.manage_images"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
37
-
38
- - elsif section.attachment?
39
- %li.input
40
- %label Attachment
41
- %ol{ :style => "padding-left: 275px;" }
42
- %li= button_to_function t("active_admin.cms.file_manager.edit_attachment"), "fileManager('#{section_form_translated.object.attachment ? edit_admin_attachment_path(section_form_translated.object.attachment.id): new_admin_attachment_path(image: { assetable_type: section_form_translated.object.class.name, assetable_id: section_form_translated.object.id }) }')", style: "padding: 5px;"
43
-
44
26
  = section_form_translated.input :locale, :as => :hidden, :label => false
45
27
 
46
- - if section.attachments?
47
- %li.input
48
- %ol{ :style => "padding-left: 275px;" }
49
- %li= button_to_function t("active_admin.cms.manage_attachments"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
50
-
51
- - if section.related?
52
- %li.input
53
- %ol{ :style => "padding-left: 275px;" }
54
- %li= button_to_function t("active_admin.cms.manage_related"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
28
+ - unless @page.new_record?
29
+ - if section.attachments?
30
+ %li.input
31
+ %ol{ :style => "padding-left: 275px;" }
32
+ %li= button_to_function t("active_admin.cms.manage_attachments"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
33
+
34
+ - if section.image?
35
+ %li.input
36
+ %label Image
37
+ %ol{ :style => "padding-left: 275px;" }
38
+ %li= button_to_function t("active_admin.cms.file_manager.edit_image"), "fileManager('#{section_form_translated.object.image ? edit_admin_image_path(section_form_translated.object.image.id) : new_admin_image_path(image: { assetable_type: section_form_translated.object.class.name, assetable_id: section_form_translated.object.id })}')", style: "padding: 5px;"
39
+
40
+ - if section.images?
41
+ %li.input
42
+ %label Attachments
43
+ %ol{ :style => "padding-left: 275px;" }
44
+ %li= button_to_function t("active_admin.cms.manage_images"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
45
+
46
+ - if section.attachment?
47
+ %li.input
48
+ %label Attachment
49
+ %ol{ :style => "padding-left: 275px;" }
50
+ %li= button_to_function t("active_admin.cms.file_manager.edit_attachment"), "fileManager('#{section_form_translated.object.attachment ? edit_admin_attachment_path(section_form_translated.object.attachment.id): new_admin_attachment_path(image: { assetable_type: section_form_translated.object.class.name, assetable_id: section_form_translated.object.id }) }')", style: "padding: 5px;"
51
+
52
+ - if section.related?
53
+ %li.input
54
+ %ol{ :style => "padding-left: 275px;" }
55
+ %li= button_to_function t("active_admin.cms.manage_related"), "fileManager('#{edit_admin_section_translation_path(section_form_translated.object.id)}')", style: "padding: 5px;"
55
56
 
56
57
  - else
57
58
  = ""
@@ -1,3 +1,3 @@
1
1
  module ActiveadminSelleoCms
2
- VERSION = "0.0.36"
2
+ VERSION = "0.0.37"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activeadmin-selleo-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.36
4
+ version: 0.0.37
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-06-03 00:00:00.000000000 Z
12
+ date: 2013-06-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -402,19 +402,6 @@ files:
402
402
  - app/admin/activeadmin_selleo_cms/related_item.rb
403
403
  - app/helpers/pages_helper.rb
404
404
  - app/assets/stylesheets/activeadmin-selleo-cms/jquery-ui.css
405
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-icons_cd0a0a_256x240.png
406
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-icons_222222_256x240.png
407
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-icons_454545_256x240.png
408
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_glass_75_e6e6e6_1x400.png
409
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_highlight-soft_75_cccccc_1x100.png
410
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_flat_0_aaaaaa_40x100.png
411
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-icons_2e83ff_256x240.png
412
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_glass_55_fbf9ee_1x400.png
413
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_flat_75_ffffff_40x100.png
414
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_glass_95_fef1ec_1x400.png
415
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_glass_75_dadada_1x400.png
416
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-icons_888888_256x240.png
417
- - app/assets/stylesheets/activeadmin-selleo-cms/images/ui-bg_glass_65_ffffff_1x400.png
418
405
  - app/assets/stylesheets/activeadmin-selleo-cms/application.css
419
406
  - app/assets/stylesheets/activeadmin-selleo-cms/custom.css
420
407
  - app/assets/stylesheets/activeadmin-selleo-cms/jquery-ui-timepicker-addon.css