spina 1.2.0 → 2.0.0.alpha

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spina might be problematic. Click here for more details.

Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/spina/favicon.png +0 -0
  3. data/app/assets/javascripts/spina/admin/application.js +1 -2
  4. data/app/assets/javascripts/spina/admin/controllers/attachment_picker_controller.js +15 -0
  5. data/app/assets/javascripts/spina/admin/controllers/image_form_controller.js +5 -4
  6. data/app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js +20 -22
  7. data/app/assets/javascripts/spina/admin/controllers/media_picker_controller.js +171 -0
  8. data/app/assets/javascripts/spina/admin/controllers/modal_controller.js +18 -0
  9. data/app/assets/javascripts/spina/admin/controllers/repeater_form_controller.js +38 -0
  10. data/app/assets/javascripts/spina/admin/media_gallery.coffee +0 -3
  11. data/app/assets/javascripts/spina/admin/notifications.coffee +1 -1
  12. data/app/assets/javascripts/spina/admin/pages.coffee.erb +3 -20
  13. data/app/assets/javascripts/spina/admin/scaffold.coffee +0 -3
  14. data/app/assets/javascripts/spina/admin/trix.coffee.erb +14 -18
  15. data/app/assets/stylesheets/spina.sass +10 -8
  16. data/app/assets/stylesheets/spina/_buttons.sass +57 -31
  17. data/app/assets/stylesheets/spina/_forms.sass +59 -73
  18. data/app/assets/stylesheets/spina/_gallery.sass +18 -2
  19. data/app/assets/stylesheets/spina/_media_picker.sass +133 -0
  20. data/app/assets/stylesheets/spina/_modal.sass +35 -2
  21. data/app/assets/stylesheets/spina/_notifications.sass +20 -14
  22. data/app/assets/stylesheets/spina/_pages.sass +131 -0
  23. data/app/assets/stylesheets/spina/_sortable_lists.sass +14 -8
  24. data/app/assets/stylesheets/spina/_trix_custom.sass +1 -1
  25. data/app/controllers/concerns/spina/frontend.rb +9 -0
  26. data/app/controllers/spina/admin/accounts_controller.rb +9 -13
  27. data/app/controllers/spina/admin/attachments_controller.rb +0 -22
  28. data/app/controllers/spina/admin/images_controller.rb +1 -1
  29. data/app/controllers/spina/admin/media_picker_controller.rb +18 -19
  30. data/app/controllers/spina/admin/pages_controller.rb +1 -5
  31. data/app/controllers/spina/admin/resources_controller.rb +9 -4
  32. data/app/controllers/spina/application_controller.rb +1 -1
  33. data/app/helpers/spina/admin/pages_helper.rb +22 -20
  34. data/app/helpers/spina/{files_helper.rb → attachments_helper.rb} +1 -1
  35. data/app/helpers/spina/images_helper.rb +6 -0
  36. data/app/helpers/spina/pages_helper.rb +23 -4
  37. data/app/models/concerns/spina/partable.rb +19 -7
  38. data/app/models/concerns/spina/translated_content.rb +19 -0
  39. data/app/models/spina/account.rb +3 -10
  40. data/app/models/spina/attachment.rb +0 -4
  41. data/app/models/spina/current.rb +1 -0
  42. data/app/models/spina/image.rb +0 -4
  43. data/app/models/spina/page.rb +7 -15
  44. data/app/models/spina/parts/attachment.rb +17 -0
  45. data/app/models/spina/parts/base.rb +12 -0
  46. data/app/models/spina/parts/image.rb +30 -0
  47. data/app/models/spina/parts/image_collection.rb +23 -0
  48. data/app/models/spina/parts/line.rb +7 -0
  49. data/app/models/spina/parts/option.rb +13 -0
  50. data/app/models/spina/parts/repeater.rb +10 -0
  51. data/app/models/spina/parts/repeater_content.rb +15 -0
  52. data/app/models/spina/parts/text.rb +7 -0
  53. data/app/models/spina/resource.rb +4 -0
  54. data/app/presenters/spina/content_presenter.rb +58 -0
  55. data/app/presenters/spina/menu_presenter.rb +2 -1
  56. data/app/views/layouts/spina/admin/admin.html.haml +3 -4
  57. data/app/views/layouts/spina/admin/pages.html.haml +5 -4
  58. data/app/views/spina/admin/accounts/_form.html.haml +13 -7
  59. data/app/views/spina/admin/accounts/analytics.html.haml +5 -3
  60. data/app/views/spina/admin/accounts/style.html.haml +26 -21
  61. data/app/views/spina/admin/images/index.html.haml +7 -5
  62. data/app/views/spina/admin/media_folders/show.html.haml +2 -2
  63. data/app/views/spina/admin/media_picker/_image.html.haml +3 -0
  64. data/app/views/spina/admin/media_picker/_media_picker.html.haml +32 -0
  65. data/app/views/spina/admin/media_picker/_media_picker_grid.html.haml +25 -0
  66. data/app/views/spina/admin/media_picker/infinite_scroll.js.erb +4 -4
  67. data/app/views/spina/admin/media_picker/select.js.erb +2 -0
  68. data/app/views/spina/admin/media_picker/show.html.haml +1 -0
  69. data/app/views/spina/admin/media_picker/show.js.erb +1 -1
  70. data/app/views/spina/admin/pages/_form.html.haml +9 -7
  71. data/app/views/spina/admin/pages/_form_advanced.html.haml +5 -5
  72. data/app/views/spina/admin/pages/_form_page_content.html.haml +14 -13
  73. data/app/views/spina/admin/pages/_form_page_seo.html.haml +9 -5
  74. data/app/views/spina/admin/pages/_page.html.haml +5 -3
  75. data/app/views/spina/admin/pages/_page_nested_list.html.haml +2 -3
  76. data/app/views/spina/admin/pages/index.html.haml +5 -4
  77. data/app/views/spina/admin/parts/attachments/_form.html.haml +6 -0
  78. data/app/views/spina/admin/parts/image_collections/_fields.html.haml +7 -0
  79. data/app/views/spina/admin/parts/image_collections/_form.html.haml +12 -0
  80. data/app/views/spina/admin/parts/images/_form.html.haml +18 -0
  81. data/app/views/spina/admin/parts/lines/_form.html.haml +2 -0
  82. data/app/views/spina/admin/parts/options/_form.html.haml +3 -0
  83. data/app/views/spina/admin/parts/repeaters/_fields.html.haml +15 -0
  84. data/app/views/spina/admin/parts/repeaters/_form.html.haml +18 -0
  85. data/app/views/spina/admin/parts/texts/_form.html.haml +6 -0
  86. data/app/views/spina/admin/resources/edit.html.haml +28 -5
  87. data/app/views/spina/admin/resources/show.html.haml +5 -2
  88. data/app/views/spina/admin/shared/_notifications.html.haml +4 -4
  89. data/db/migrate/12_add_url_title_to_spina_page_translations.rb +1 -1
  90. data/db/migrate/13_add_json_attributes_to_spina_accounts.rb +5 -0
  91. data/db/migrate/14_add_json_attributes_to_spina_pages.rb +5 -0
  92. data/db/migrate/15_add_slug_to_spina_resources.rb +5 -0
  93. data/lib/generators/spina/templates/app/views/demo/pages/demo.html.haml +13 -21
  94. data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +1 -1
  95. data/lib/generators/spina/templates/config/initializers/themes/default.rb +4 -4
  96. data/lib/generators/spina/templates/config/initializers/themes/demo.rb +32 -44
  97. data/lib/spina.rb +2 -0
  98. data/lib/spina/attr_json_spina_parts_model.rb +29 -0
  99. data/lib/spina/engine.rb +13 -2
  100. data/lib/spina/part.rb +19 -0
  101. data/lib/spina/theme.rb +1 -1
  102. data/lib/spina/version.rb +1 -1
  103. data/vendor/assets/javascripts/spina/sortable.js +2 -2
  104. metadata +54 -42
  105. data/app/assets/javascripts/spina/admin/account.coffee +0 -16
  106. data/app/models/concerns/spina/image_collectable.rb +0 -23
  107. data/app/models/concerns/spina/optionable.rb +0 -12
  108. data/app/models/concerns/spina/part.rb +0 -38
  109. data/app/models/spina/attachment_collection.rb +0 -20
  110. data/app/models/spina/image_collection.rb +0 -23
  111. data/app/models/spina/image_collections_image.rb +0 -6
  112. data/app/models/spina/layout_part.rb +0 -22
  113. data/app/models/spina/line.rb +0 -10
  114. data/app/models/spina/option.rb +0 -17
  115. data/app/models/spina/page_part.rb +0 -22
  116. data/app/models/spina/structure.rb +0 -14
  117. data/app/models/spina/structure_item.rb +0 -22
  118. data/app/models/spina/structure_part.rb +0 -20
  119. data/app/models/spina/text.rb +0 -10
  120. data/app/views/dummy/show.html.haml +0 -1
  121. data/app/views/spina/admin/attachments/_attachment_collection.html.haml +0 -2
  122. data/app/views/spina/admin/attachments/_select.html.haml +0 -17
  123. data/app/views/spina/admin/attachments/_select_collection.html.haml +0 -18
  124. data/app/views/spina/admin/attachments/insert.js.erb +0 -5
  125. data/app/views/spina/admin/attachments/insert_collection.js.coffee +0 -7
  126. data/app/views/spina/admin/attachments/select.js.erb +0 -2
  127. data/app/views/spina/admin/attachments/select_collection.js.erb +0 -2
  128. data/app/views/spina/admin/image_collections/_image_collection.html.haml +0 -5
  129. data/app/views/spina/admin/layout_partables/lines/_form.html.haml +0 -2
  130. data/app/views/spina/admin/partables/attachment_collections/_form.html.haml +0 -14
  131. data/app/views/spina/admin/partables/attachments/_form.html.haml +0 -13
  132. data/app/views/spina/admin/partables/image_collections/_form.html.haml +0 -16
  133. data/app/views/spina/admin/partables/images/_form.html.haml +0 -21
  134. data/app/views/spina/admin/partables/lines/_form.html.haml +0 -5
  135. data/app/views/spina/admin/partables/options/_form.html.haml +0 -7
  136. data/app/views/spina/admin/partables/photo_collections/_form.html.haml +0 -4
  137. data/app/views/spina/admin/partables/photos/_form.html.haml +0 -4
  138. data/app/views/spina/admin/partables/structures/_form.html.haml +0 -21
  139. data/app/views/spina/admin/partables/texts/_form.html.haml +0 -8
  140. data/app/views/spina/admin/structure_items/_fields.html.haml +0 -15
  141. data/app/views/spina/admin/structure_partables/attachment_collections/_form.html.haml +0 -14
  142. data/app/views/spina/admin/structure_partables/attachments/_form.html.haml +0 -13
@@ -1,22 +0,0 @@
1
- module Spina
2
- class PagePart < ApplicationRecord
3
- include Part
4
- include Optionable
5
-
6
- belongs_to :page, inverse_of: :page_parts
7
- belongs_to :page_partable, polymorphic: true, optional: true
8
-
9
- accepts_nested_attributes_for :page_partable, allow_destroy: true
10
-
11
- validates :name, uniqueness: {scope: :page_id}
12
-
13
- alias_attribute :partable, :page_partable
14
- alias_attribute :partable_id, :page_partable_id
15
- alias_attribute :partable_type, :page_partable_type
16
- alias_method :page_partable_attributes=, :partable_attributes=
17
-
18
- def position(theme)
19
- page.view_template_config(theme)[:page_parts].index { |page_part| page_part == self.name }.to_i
20
- end
21
- end
22
- end
@@ -1,14 +0,0 @@
1
- module Spina
2
- class Structure < ApplicationRecord
3
- has_one :page_part, as: :page_partable
4
- has_many :structure_items
5
-
6
- after_save -> { structure_items.each(&:save) }
7
-
8
- accepts_nested_attributes_for :structure_items, allow_destroy: true
9
-
10
- def content
11
- self
12
- end
13
- end
14
- end
@@ -1,22 +0,0 @@
1
- module Spina
2
- class StructureItem < ApplicationRecord
3
- include Partable
4
-
5
- before_validation :ensure_position
6
- belongs_to :structure, optional: true
7
- has_many :structure_parts, dependent: :destroy
8
-
9
- scope :sorted_by_structure, -> { order(:position) }
10
-
11
- after_save -> { structure_parts.each(&:save) }
12
-
13
- validates_presence_of :position
14
- accepts_nested_attributes_for :structure_parts, allow_destroy: true
15
-
16
- alias_attribute :parts, :structure_parts
17
-
18
- def ensure_position
19
- self.position ||= Time.now.to_i
20
- end
21
- end
22
- end
@@ -1,20 +0,0 @@
1
- module Spina
2
- class StructurePart < ApplicationRecord
3
- include Part
4
- include ImageCollectable
5
- include Optionable
6
-
7
- belongs_to :structure_item, optional: true
8
- belongs_to :structure_partable, polymorphic: true, optional: true
9
-
10
- accepts_nested_attributes_for :structure_partable, allow_destroy: true
11
-
12
- validates :structure_partable_type, presence: true
13
- validates :name, uniqueness: {scope: :structure_item_id}
14
-
15
- alias_attribute :partable, :structure_partable
16
- alias_attribute :partable_id, :structure_partable_id
17
- alias_attribute :partable_type, :structure_partable_type
18
- alias_method :structure_partable_attributes=, :partable_attributes=
19
- end
20
- end
@@ -1,10 +0,0 @@
1
- module Spina
2
- class Text < ApplicationRecord
3
- extend Mobility
4
- translates :content, fallbacks: true
5
-
6
- has_many :page_parts, as: :page_partable
7
- has_many :layout_parts, as: :layout_partable
8
- has_many :structure_parts, as: :structure_partable
9
- end
10
- end
@@ -1 +0,0 @@
1
- hoi
@@ -1,2 +0,0 @@
1
- - attachments.each do |attachment|
2
- .attachment= attachment.name
@@ -1,17 +0,0 @@
1
- .modal.modal-large
2
- %header
3
- = link_to "", "#", class: 'close_modal', data: {dismiss: 'modal', icon: 'm'}
4
- %h3= t('spina.attachments.insert')
5
-
6
- %section
7
- = form_tag spina.insert_admin_attachments_path(params[:page_part_id]), remote: true, class: 'document-select' do
8
- = hidden_field_tag :hidden_field_id, @hidden_field_id
9
-
10
- %ul
11
- - @attachments.each do |attachment|
12
- %li.item
13
- = radio_button_tag :attachment_id, attachment.id, attachment.id == @selected_attachment_id
14
- = label_tag "attachment_id_#{attachment.id}", attachment.name
15
- %footer
16
- = link_to t('spina.cancel'), "#", data: {dismiss: 'modal'}
17
- = button_tag t('spina.attachments.insert'), type: 'submit', class: 'primary', data: {icon: 't '}
@@ -1,18 +0,0 @@
1
- .modal.modal-large
2
- %header
3
- = link_to "", "#", class: 'close_modal', data: {dismiss: 'modal', icon: 'm'}
4
- %h3= t('spina.attachments.insert_multiple')
5
-
6
- %section
7
- = form_tag spina.insert_collection_admin_attachments_path(params[:page_part_id]), remote: true, class: 'document-select' do
8
- .table-container
9
- %table.table.table-clickable-tr{style: 'margin-top: 0'}
10
- - @attachments.each do |attachment|
11
- %tr
12
- %td
13
- .form-checkbox
14
- = check_box_tag 'attachment_ids[]', attachment.id, attachment.id.in?(@selected_attachment_ids), id: "attachment_id_#{attachment.id}"
15
- = label_tag "attachment_id_#{attachment.id}", attachment.name
16
- %footer
17
- = link_to t('spina.cancel'), "#", data: {dismiss: 'modal'}
18
- = button_tag t('spina.attachments.insert_multiple'), type: 'submit', class: 'primary', data: {icon: 't '}
@@ -1,5 +0,0 @@
1
- var hidden_input = $("input[name='<%= j params[:page_part_id] %>[partable_id]'], input[name='<%= j params[:page_part_id] %>[structure_partable_id]'], input[data-hidden-field-id='<%= j params[:hidden_field_id] %>']");
2
- hidden_input.parents('.media_picker').find('.attachment').remove();
3
- hidden_input.parents('.media_picker').append("<div class='attachment'><%= @attachment.name %></div>");
4
- hidden_input.val("<%= @attachment.id %>");
5
- $.hideModal();
@@ -1,7 +0,0 @@
1
- hidden_input = $("input[name='<%= j params[:page_part_id] %>[attachment_tokens]']")
2
- attachment_collection = $("<%= j render partial: 'attachment_collection', locals: {attachments: @attachments} %>")
3
-
4
- hidden_input.parents('.media_picker').find('.attachment').remove()
5
- hidden_input.parents('.media_picker').append(attachment_collection)
6
- hidden_input.val("<%= @attachments.map(&:id).join(',') %>")
7
- $.hideModal()
@@ -1,2 +0,0 @@
1
- var modal = $("<%= j render 'select' %>");
2
- modal.modal();
@@ -1,2 +0,0 @@
1
- var modal = $("<%= j render 'select_collection' %>");
2
- modal.modal();
@@ -1,5 +0,0 @@
1
- - if images.present?
2
- %ul.sortable-grid
3
- - images.each do |image|
4
- %li.image{data: {image_id: image.id}}
5
- = image_tag variant(image.file, resize: '300x300^', crop: "300x300+0+0")
@@ -1,2 +0,0 @@
1
- = f.fields_for :layout_partable, f.object.layout_partable do |ff|
2
- = ff.text_field :content, placeholder: f.object.title
@@ -1,14 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = link_to select_collection_admin_attachments_path(ff.object_name, selected_attachment_ids: ff.object.attachment_ids), remote: true, class: 'media_picker clearfix' do
6
- .placeholder
7
- %span.button.button-small.button-round
8
- %i.icon.icon-dots
9
- = t('spina.choose_from_library')
10
- - if ff.object.attachments.any?
11
- - ff.object.attachments.each do |attachment|
12
- .attachment= attachment.name
13
-
14
- = ff.hidden_field :attachment_tokens, value: ff.object.attachment_ids.join(",")
@@ -1,13 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = link_to select_admin_attachments_path(f.object_name, selected_attachment_id: f.object.partable.try(:id)), remote: true, class: 'media_picker clearfix' do
5
- .placeholder
6
- %span.button.button-small.button-round
7
- %i.icon.icon-dots
8
- = t('spina.choose_from_library')
9
-
10
- - if f.object.partable && f.object.partable.file.attached?
11
- .attachment= f.object.partable.name
12
-
13
- = f.hidden_field :partable_id
@@ -1,16 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = link_to admin_media_picker_path(selected_ids: ff.object.image_ids, hidden_field_id: "media_picker_#{ff.object.object_id}", multiple: true), remote: true, class: 'media_picker clearfix' do
6
- .placeholder
7
- %span.button.button-small.button-round
8
- %i.icon.icon-dots
9
- =t 'spina.images.choose_images'
10
-
11
- .image-collection
12
- - if ff.object.images.any?
13
- = render 'spina/admin/image_collections/image_collection', images: ff.object.images.sorted_by_image_collection
14
-
15
- = ff.hidden_field :image_tokens, value: ff.object.image_ids.join(","), data: {hidden_field_id: "media_picker_#{ff.object.object_id}"}
16
- = ff.hidden_field :image_positions, value: ff.object.images.sorted_by_image_collection.pluck(:image_id).join(","), class: 'image-positions'
@@ -1,21 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content{data: {controller: "image-form"}}
4
- = link_to admin_media_picker_path(selected_ids: [f.object.partable_id], hidden_field_id: "media_picker_#{f.object.object_id}"), remote: true, class: 'media_picker clearfix' do
5
- .placeholder
6
- %span.button.button-small.button-round
7
- %i.icon.icon-dots
8
- =t 'spina.images.choose_image'
9
-
10
- - if f.object.partable.file.attached?
11
- %br/
12
-
13
- %span.button.button-small.button-round{data: {action: "click->image-form#remove", target: "image-form.button"}}
14
- %i.icon.icon-trash
15
- =t 'spina.images.remove_image'
16
-
17
- - if f.object.partable.file.attached?
18
- .image{data: {target: 'image-form.image'}}
19
- = image_tag variant(f.object.partable.file, resize: "300x300^", crop: "300x300+0+0")
20
-
21
- = f.hidden_field :partable_id, data: {hidden_field_id: "media_picker_#{f.object.object_id}", target: 'image-form.field'}
@@ -1,5 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- = ff.text_field :content, value: ff.object.content(fallback: false, default: nil)
@@ -1,7 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- .select-dropdown
6
- = ff.label :value, f.object.title
7
- = ff.select :value, f.object.options[:values].map{|o| [option_label(f.object, o), o]}, prompt: true
@@ -1,4 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- %em{style: 'line-height: 28px; color: #333'} Spina::PhotoCollection is deprecated. Please change this PagePart to Spina::ImageCollection using <span style="background: #f1f1f1; border-radius: 3px; padding: 2px 8px; white-space: nowrap">rails spina:photo_to_image</span>
@@ -1,4 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- %em{style: 'line-height: 28px; color: #333'} Spina::Photo is deprecated. Please change this PagePart to Spina::Image using <span style="background: #f1f1f1; border-radius: 3px; padding: 2px 8px; white-space: nowrap">rails spina:photo_to_image</span>
@@ -1,21 +0,0 @@
1
- .horizontal-form-content
2
- .structure-form
3
- .structure-form-menu
4
- %label= f.object.title
5
-
6
- %ul
7
- - f.object.page_partable.structure_items.sort_by{|item|item.position.to_i}.each_with_index do |structure_item, index|
8
- %li{class: ('active' if index == 0), data: {structure_item_id: structure_item.object_id}}
9
- = link_to "#structure_form_pane_#{structure_item.object_id}" do
10
- %i.icon.icon-bars.sortable-handle
11
- = structure_item.structure_parts.first.try(:structure_partable).try(:content)
12
-
13
- = f.fields_for :partable do |ff|
14
- - ff.object.page_part = f.object
15
- = link_to_add_structure_item_fields ff do
16
- = icon('plus')
17
-
18
- .structure-form-content
19
- = f.fields_for :page_partable do |ff|
20
- = ff.fields_for :structure_items, ff.object.structure_items.sort_by{|item|item.position.to_i} do |fff|
21
- = render 'spina/admin/structure_items/fields', f: fff
@@ -1,8 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :partable, f.object.partable do |ff|
5
- - object_id = (ff.object.persisted? ? ff.object.object_id : "new_association_#{ff.object.object_id}").to_s + "_content"
6
- = ff.hidden_field :content, id: "#{object_id}_input", value: ff.object.content(fallback: false, default: nil)
7
- %trix-editor.text-input.trix-content{ input: "#{object_id}_input" }
8
-
@@ -1,15 +0,0 @@
1
- .structure-form-pane{class: ('active' if f.options[:child_index] == 0), id: "structure_form_pane_#{f.object.object_id}"}
2
- / Structure parts
3
- = f.fields_for :structure_parts, build_structure_parts(f.object.structure.try(:page_part).try(:name), f.object) do |ff|
4
- .structure-form-part
5
- = render "spina/admin/partables/#{partable_type_partial_namespace(ff.object.structure_partable_type)}/form", f: ff
6
-
7
- = ff.hidden_field :id
8
- = ff.hidden_field :title
9
- = ff.hidden_field :structure_partable_type
10
- = ff.hidden_field :name
11
-
12
- / Hidden field
13
- = f.hidden_field :position, placeholder: "Position", class: "structure_form_pane_#{f.object.object_id}_position"
14
- = f.hidden_field :_destroy
15
- = link_to t('spina.delete'), '#', class: 'remove_structure_item_fields button button-mini button-link pull-right'
@@ -1,14 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = f.fields_for :structure_partable, f.object.structure_partable do |ff|
5
- = link_to spina.select_collection_admin_attachments_path(ff.object_name, selected_attachment_ids: ff.object.attachment_ids), remote: true, class: 'media_picker clearfix' do
6
- .placeholder
7
- %span.button.button-small.button-round
8
- %i.icon.icon-dots
9
- = t('spina.choose_from_library')
10
-
11
- - if ff.object.attachments.any?
12
- - ff.object.attachments.each do |attachment|
13
- .attachment= attachment.name
14
- = ff.hidden_field :attachment_tokens, value: ff.object.attachment_ids.join(",")
@@ -1,13 +0,0 @@
1
- .horizontal-form-label
2
- = f.object.title
3
- .horizontal-form-content
4
- = link_to spina.select_admin_attachments_path(f.object_name, selected_attachment_id: f.object.structure_partable.try(:id)), remote: true, class: "media_picker" do
5
- .placeholder
6
- %span.button.button-small.button-round
7
- %i.icon.icon-dots
8
- = t('spina.choose_from_library')
9
-
10
- - if f.object.structure_partable && f.object.structure_partable.file.present?
11
- .attachment= f.object.structure_partable.name
12
-
13
- = f.hidden_field :structure_partable_id