spina 0.6.16 → 0.6.17
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.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spina/admin/pages.js.coffee +6 -3
- data/app/helpers/spina/admin/pages_helper.rb +13 -13
- data/app/views/spina/admin/page_partables/_structure_form.html.haml +7 -6
- data/app/views/spina/admin/pages/_structure_item_fields.html.haml +1 -1
- data/config/locales/nl.yml +1 -0
- data/lib/spina/version.rb +1 -1
- data/test/dummy/log/development.log +4626 -0
- data/test/dummy/tmp/cache/assets/development/sass/3c1320efc01ac76742f2cfe4d0d1941254fef6d2/_forms.css.sassc +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/0d8dc83fbc4822297afed832d1acfc2c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/23d1782b57e5df2f230a1eac777e3c99 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/25a4b7a4b7ad0dfc9888b73a00f18ab8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/309fcc297b557ebae6b04bf4eae23c7c +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/44db26e0845a7d58dbfe13c2272d5a52 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/60800955d627731b6d59826931a25178 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/6eee9514a8e446f3eff24ab163bf71b8 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/729b77e341373159707a68d330ecc995 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/975819cc7ffe5dc44b5c76f912e84345 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/c0ff3d7073a6b91f8b516fb04bbfde69 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/d9a07e6b8d250381d868b86ea1bfd814 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e48966fdc8da48f5d9eda54dbfcfd0f3 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/e863847a0653c4bf014139e1b19cc9ef +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f2e09c0c6daffc7a138d18e5732f0505 +0 -0
- data/test/dummy/tmp/cache/assets/development/sprockets/f7630e8dea4a43596bf0f3305e75dc88 +0 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93a9f66ee903d30b1b01331c77e9d613641e0e2a
|
4
|
+
data.tar.gz: 01215c66d9fb6bdda7244a6c097e0713f242c4b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c2e69c22f452d07b824a6934921db792d3714d3b45629202d4809695d2da70762aa436816ddde8cc14cfc60476ab53403a1b8706717c160ff73567220d6b2aae
|
7
|
+
data.tar.gz: 3182392e3123bfff9f7335e9cbc3f1ae37d041460f07bc31b2bbb3590515a6904d09c77a62276536b5daed9d1e23e011cf7864205b962ddffd8029652978eb78
|
@@ -45,7 +45,7 @@ $(document).on 'click', 'form .add_structure', (event) ->
|
|
45
45
|
time = new Date().getTime()
|
46
46
|
regexp = new RegExp($(this).data('id'), 'g')
|
47
47
|
$fields = $($(this).data('fields').replace(regexp, time))
|
48
|
-
$(
|
48
|
+
$structureForm.find('.structure-form-content').append($fields)
|
49
49
|
|
50
50
|
$link = $("<li><a href='#structure_form_pane_#{time}'><i data-icon='7'></i> </a></li>")
|
51
51
|
|
@@ -59,8 +59,11 @@ $(document).on 'click', 'form .add_structure', (event) ->
|
|
59
59
|
$(document).on 'click', 'form .remove-structure-item-fields', (event) ->
|
60
60
|
$(this).prev('input[type=hidden]').val('1')
|
61
61
|
$pane = $(this).closest('.structure-form-pane')
|
62
|
-
|
63
|
-
$
|
62
|
+
$link = $("a[href='##{$pane.attr('id')}']").parents('li')
|
63
|
+
$previousLink = $link.siblings('li:visible')
|
64
|
+
|
65
|
+
$previousLink.find('a').trigger('click')
|
66
|
+
$link.hide()
|
64
67
|
$pane.hide()
|
65
68
|
event.preventDefault()
|
66
69
|
|
@@ -5,26 +5,26 @@ module Spina
|
|
5
5
|
new_object = f.object.send(association).klass.new
|
6
6
|
id = new_object.object_id
|
7
7
|
fields = f.fields_for(association, new_object, child_index: id) do |builder|
|
8
|
+
build_structure_parts(f.object.page_part.name, new_object) if structure_item?(new_object)
|
8
9
|
render(association.to_s.singularize + "_fields", f: builder)
|
9
10
|
end
|
10
|
-
link_to '#', class: "
|
11
|
+
link_to '#', class: "#{add_fields_class(new_object)} button button-link", data: {id: id, fields: fields.gsub("\n", "")} do
|
11
12
|
block.yield
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
15
|
-
def
|
16
|
-
|
17
|
-
|
18
|
-
fields = f.fields_for(association, new_object, child_index: id) do |builder|
|
19
|
-
current_theme.config.structures[f.object.page_part.name].each do |structure_part|
|
20
|
-
structure_part = new_object.structure_parts.build(structure_part)
|
21
|
-
structure_part.structure_partable = structure_part.structure_partable_type.constantize.new
|
22
|
-
end
|
16
|
+
def add_fields_class(object)
|
17
|
+
structure_item?(object) ? 'add_structure' : 'add_fields'
|
18
|
+
end
|
23
19
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
def structure_item?(object)
|
21
|
+
object.class.name.demodulize == "StructureItem"
|
22
|
+
end
|
23
|
+
|
24
|
+
def build_structure_parts(name, item)
|
25
|
+
current_theme.config.structures[name].each do |part|
|
26
|
+
part = item.structure_parts.build(part)
|
27
|
+
part.structure_partable = part.structure_partable_type.constantize.new
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -9,18 +9,19 @@
|
|
9
9
|
%label= structure_form.object.title
|
10
10
|
|
11
11
|
%ul
|
12
|
-
- structure_form.object.page_partable.structure_items.sorted_by_structure.
|
13
|
-
%li{data: {structure_item_id: structure_item.id}}
|
12
|
+
- structure_form.object.page_partable.structure_items.sorted_by_structure.each_with_index do |structure_item, index|
|
13
|
+
%li{class: ('active' if index == 0), data: {structure_item_id: structure_item.id}}
|
14
14
|
= link_to "#structure_form_pane_#{structure_item.id}" do
|
15
15
|
%i.sortable-handle{data: {icon: '7'}}
|
16
16
|
= structure_item.structure_parts.first.try(:structure_partable).try(:content)
|
17
17
|
|
18
|
-
|
18
|
+
|
19
19
|
= structure_form.fields_for :page_partable do |form|
|
20
20
|
- form.object.page_part = structure_form.object
|
21
|
+
= link_to_add_fields form, :structure_items do
|
22
|
+
%i{data: {icon: 't'}}
|
21
23
|
|
24
|
+
.structure-form-content
|
25
|
+
= structure_form.fields_for :page_partable do |form|
|
22
26
|
= form.fields_for :structure_items, form.object.structure_items.sorted_by_structure do |structure_item_form|
|
23
27
|
= render 'structure_item_fields', f: structure_item_form
|
24
|
-
|
25
|
-
= link_to_add_structure form, :structure_items do
|
26
|
-
%i{data: {icon: 't'}}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
.structure-form-pane{id: "structure_form_pane_#{f.object.id}"}
|
1
|
+
.structure-form-pane{class: ('active' if f.options[:child_index] == 0), id: "structure_form_pane_#{f.object.id}"}
|
2
2
|
/ Hidden field
|
3
3
|
= f.hidden_field :position, placeholder: "Position", class: "structure_form_pane_#{f.object.id}_position"
|
4
4
|
|
data/config/locales/nl.yml
CHANGED
@@ -54,6 +54,7 @@ nl:
|
|
54
54
|
photos_picker: Foto's kiezen
|
55
55
|
photo_picker: Foto kiezen
|
56
56
|
delete_confirmation: "Weet je zeker dat je de pagina <strong>%{subject}</strong> wilt verwijderen?"
|
57
|
+
delete_structure_item_confirmation: "Weet je zeker dat je dit item wilt verwijderen?"
|
57
58
|
save: Pagina opslaan
|
58
59
|
concept: concept
|
59
60
|
show_in_menu: onzichtbaar
|
data/lib/spina/version.rb
CHANGED