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.
- checksums.yaml +4 -4
- data/app/assets/images/spina/favicon.png +0 -0
- data/app/assets/javascripts/spina/admin/application.js +1 -2
- data/app/assets/javascripts/spina/admin/controllers/attachment_picker_controller.js +15 -0
- data/app/assets/javascripts/spina/admin/controllers/image_form_controller.js +5 -4
- data/app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js +20 -22
- data/app/assets/javascripts/spina/admin/controllers/media_picker_controller.js +171 -0
- data/app/assets/javascripts/spina/admin/controllers/modal_controller.js +18 -0
- data/app/assets/javascripts/spina/admin/controllers/repeater_form_controller.js +38 -0
- data/app/assets/javascripts/spina/admin/media_gallery.coffee +0 -3
- data/app/assets/javascripts/spina/admin/notifications.coffee +1 -1
- data/app/assets/javascripts/spina/admin/pages.coffee.erb +3 -20
- data/app/assets/javascripts/spina/admin/scaffold.coffee +0 -3
- data/app/assets/javascripts/spina/admin/trix.coffee.erb +14 -18
- data/app/assets/stylesheets/spina.sass +10 -8
- data/app/assets/stylesheets/spina/_buttons.sass +57 -31
- data/app/assets/stylesheets/spina/_forms.sass +59 -73
- data/app/assets/stylesheets/spina/_gallery.sass +18 -2
- data/app/assets/stylesheets/spina/_media_picker.sass +133 -0
- data/app/assets/stylesheets/spina/_modal.sass +35 -2
- data/app/assets/stylesheets/spina/_notifications.sass +20 -14
- data/app/assets/stylesheets/spina/_pages.sass +131 -0
- data/app/assets/stylesheets/spina/_sortable_lists.sass +14 -8
- data/app/assets/stylesheets/spina/_trix_custom.sass +1 -1
- data/app/controllers/concerns/spina/frontend.rb +9 -0
- data/app/controllers/spina/admin/accounts_controller.rb +9 -13
- data/app/controllers/spina/admin/attachments_controller.rb +0 -22
- data/app/controllers/spina/admin/images_controller.rb +1 -1
- data/app/controllers/spina/admin/media_picker_controller.rb +18 -19
- data/app/controllers/spina/admin/pages_controller.rb +1 -5
- data/app/controllers/spina/admin/resources_controller.rb +9 -4
- data/app/controllers/spina/application_controller.rb +1 -1
- data/app/helpers/spina/admin/pages_helper.rb +22 -20
- data/app/helpers/spina/{files_helper.rb → attachments_helper.rb} +1 -1
- data/app/helpers/spina/images_helper.rb +6 -0
- data/app/helpers/spina/pages_helper.rb +23 -4
- data/app/models/concerns/spina/partable.rb +19 -7
- data/app/models/concerns/spina/translated_content.rb +19 -0
- data/app/models/spina/account.rb +3 -10
- data/app/models/spina/attachment.rb +0 -4
- data/app/models/spina/current.rb +1 -0
- data/app/models/spina/image.rb +0 -4
- data/app/models/spina/page.rb +7 -15
- data/app/models/spina/parts/attachment.rb +17 -0
- data/app/models/spina/parts/base.rb +12 -0
- data/app/models/spina/parts/image.rb +30 -0
- data/app/models/spina/parts/image_collection.rb +23 -0
- data/app/models/spina/parts/line.rb +7 -0
- data/app/models/spina/parts/option.rb +13 -0
- data/app/models/spina/parts/repeater.rb +10 -0
- data/app/models/spina/parts/repeater_content.rb +15 -0
- data/app/models/spina/parts/text.rb +7 -0
- data/app/models/spina/resource.rb +4 -0
- data/app/presenters/spina/content_presenter.rb +58 -0
- data/app/presenters/spina/menu_presenter.rb +2 -1
- data/app/views/layouts/spina/admin/admin.html.haml +3 -4
- data/app/views/layouts/spina/admin/pages.html.haml +5 -4
- data/app/views/spina/admin/accounts/_form.html.haml +13 -7
- data/app/views/spina/admin/accounts/analytics.html.haml +5 -3
- data/app/views/spina/admin/accounts/style.html.haml +26 -21
- data/app/views/spina/admin/images/index.html.haml +7 -5
- data/app/views/spina/admin/media_folders/show.html.haml +2 -2
- data/app/views/spina/admin/media_picker/_image.html.haml +3 -0
- data/app/views/spina/admin/media_picker/_media_picker.html.haml +32 -0
- data/app/views/spina/admin/media_picker/_media_picker_grid.html.haml +25 -0
- data/app/views/spina/admin/media_picker/infinite_scroll.js.erb +4 -4
- data/app/views/spina/admin/media_picker/select.js.erb +2 -0
- data/app/views/spina/admin/media_picker/show.html.haml +1 -0
- data/app/views/spina/admin/media_picker/show.js.erb +1 -1
- data/app/views/spina/admin/pages/_form.html.haml +9 -7
- data/app/views/spina/admin/pages/_form_advanced.html.haml +5 -5
- data/app/views/spina/admin/pages/_form_page_content.html.haml +14 -13
- data/app/views/spina/admin/pages/_form_page_seo.html.haml +9 -5
- data/app/views/spina/admin/pages/_page.html.haml +5 -3
- data/app/views/spina/admin/pages/_page_nested_list.html.haml +2 -3
- data/app/views/spina/admin/pages/index.html.haml +5 -4
- data/app/views/spina/admin/parts/attachments/_form.html.haml +6 -0
- data/app/views/spina/admin/parts/image_collections/_fields.html.haml +7 -0
- data/app/views/spina/admin/parts/image_collections/_form.html.haml +12 -0
- data/app/views/spina/admin/parts/images/_form.html.haml +18 -0
- data/app/views/spina/admin/parts/lines/_form.html.haml +2 -0
- data/app/views/spina/admin/parts/options/_form.html.haml +3 -0
- data/app/views/spina/admin/parts/repeaters/_fields.html.haml +15 -0
- data/app/views/spina/admin/parts/repeaters/_form.html.haml +18 -0
- data/app/views/spina/admin/parts/texts/_form.html.haml +6 -0
- data/app/views/spina/admin/resources/edit.html.haml +28 -5
- data/app/views/spina/admin/resources/show.html.haml +5 -2
- data/app/views/spina/admin/shared/_notifications.html.haml +4 -4
- data/db/migrate/12_add_url_title_to_spina_page_translations.rb +1 -1
- data/db/migrate/13_add_json_attributes_to_spina_accounts.rb +5 -0
- data/db/migrate/14_add_json_attributes_to_spina_pages.rb +5 -0
- data/db/migrate/15_add_slug_to_spina_resources.rb +5 -0
- data/lib/generators/spina/templates/app/views/demo/pages/demo.html.haml +13 -21
- data/lib/generators/spina/templates/app/views/demo/pages/homepage.html.haml +1 -1
- data/lib/generators/spina/templates/config/initializers/themes/default.rb +4 -4
- data/lib/generators/spina/templates/config/initializers/themes/demo.rb +32 -44
- data/lib/spina.rb +2 -0
- data/lib/spina/attr_json_spina_parts_model.rb +29 -0
- data/lib/spina/engine.rb +13 -2
- data/lib/spina/part.rb +19 -0
- data/lib/spina/theme.rb +1 -1
- data/lib/spina/version.rb +1 -1
- data/vendor/assets/javascripts/spina/sortable.js +2 -2
- metadata +54 -42
- data/app/assets/javascripts/spina/admin/account.coffee +0 -16
- data/app/models/concerns/spina/image_collectable.rb +0 -23
- data/app/models/concerns/spina/optionable.rb +0 -12
- data/app/models/concerns/spina/part.rb +0 -38
- data/app/models/spina/attachment_collection.rb +0 -20
- data/app/models/spina/image_collection.rb +0 -23
- data/app/models/spina/image_collections_image.rb +0 -6
- data/app/models/spina/layout_part.rb +0 -22
- data/app/models/spina/line.rb +0 -10
- data/app/models/spina/option.rb +0 -17
- data/app/models/spina/page_part.rb +0 -22
- data/app/models/spina/structure.rb +0 -14
- data/app/models/spina/structure_item.rb +0 -22
- data/app/models/spina/structure_part.rb +0 -20
- data/app/models/spina/text.rb +0 -10
- data/app/views/dummy/show.html.haml +0 -1
- data/app/views/spina/admin/attachments/_attachment_collection.html.haml +0 -2
- data/app/views/spina/admin/attachments/_select.html.haml +0 -17
- data/app/views/spina/admin/attachments/_select_collection.html.haml +0 -18
- data/app/views/spina/admin/attachments/insert.js.erb +0 -5
- data/app/views/spina/admin/attachments/insert_collection.js.coffee +0 -7
- data/app/views/spina/admin/attachments/select.js.erb +0 -2
- data/app/views/spina/admin/attachments/select_collection.js.erb +0 -2
- data/app/views/spina/admin/image_collections/_image_collection.html.haml +0 -5
- data/app/views/spina/admin/layout_partables/lines/_form.html.haml +0 -2
- data/app/views/spina/admin/partables/attachment_collections/_form.html.haml +0 -14
- data/app/views/spina/admin/partables/attachments/_form.html.haml +0 -13
- data/app/views/spina/admin/partables/image_collections/_form.html.haml +0 -16
- data/app/views/spina/admin/partables/images/_form.html.haml +0 -21
- data/app/views/spina/admin/partables/lines/_form.html.haml +0 -5
- data/app/views/spina/admin/partables/options/_form.html.haml +0 -7
- data/app/views/spina/admin/partables/photo_collections/_form.html.haml +0 -4
- data/app/views/spina/admin/partables/photos/_form.html.haml +0 -4
- data/app/views/spina/admin/partables/structures/_form.html.haml +0 -21
- data/app/views/spina/admin/partables/texts/_form.html.haml +0 -8
- data/app/views/spina/admin/structure_items/_fields.html.haml +0 -15
- data/app/views/spina/admin/structure_partables/attachment_collections/_form.html.haml +0 -14
- data/app/views/spina/admin/structure_partables/attachments/_form.html.haml +0 -13
data/lib/spina/part.rb
ADDED
data/lib/spina/theme.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Spina
|
2
2
|
class Theme
|
3
3
|
|
4
|
-
attr_accessor :name, :title, :page_parts, :structures, :view_templates, :layout_parts, :custom_pages, :plugins, :public_theme, :config, :navigations, :resources
|
4
|
+
attr_accessor :name, :title, :parts, :page_parts, :structures, :view_templates, :layout_parts, :custom_pages, :plugins, :public_theme, :config, :navigations, :resources
|
5
5
|
|
6
6
|
class << self
|
7
7
|
|
data/lib/spina/version.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
/*! Sortable 1.
|
2
|
-
!function(a){"use strict";"function"==typeof define&&define.amd?define(a):"undefined"!=typeof module&&"undefined"!=typeof module.exports?module.exports=a():"undefined"!=typeof Package?Sortable=a():window.Sortable=a()}(function(){"use strict";function a(a,b){if(!a||!a.nodeType||1!==a.nodeType)throw"Sortable: `el` must be HTMLElement, and not "+{}.toString.call(a);this.el=a,this.options=b=s({},b),a[M]=this;var c={group:Math.random(),sort:!0,disabled:!1,store:null,handle:null,scroll:!0,scrollSensitivity:30,scrollSpeed:10,draggable:/[uo]l/i.test(a.nodeName)?"li":">*",ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",ignore:"a, img",filter:null,animation:0,setData:function(a,b){a.setData("Text",b.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1};for(var d in c)!(d in b)&&(b[d]=c[d]);W(b);for(var f in this)"_"===f.charAt(0)&&(this[f]=this[f].bind(this));this.nativeDraggable=b.forceFallback?!1:Q,e(a,"mousedown",this._onTapStart),e(a,"touchstart",this._onTapStart),this.nativeDraggable&&(e(a,"dragover",this),e(a,"dragenter",this)),U.push(this._onDragOver),b.store&&this.sort(b.store.get(this))}function b(a){w&&w.state!==a&&(h(w,"display",a?"none":""),!a&&w.state&&x.insertBefore(w,t),w.state=a)}function c(a,b,c){if(a){c=c||O;do if(">*"===b&&a.parentNode===c||q(a,b))return a;while(a!==c&&(a=a.parentNode))}return null}function d(a){a.dataTransfer&&(a.dataTransfer.dropEffect="move"),a.preventDefault()}function e(a,b,c){a.addEventListener(b,c,!1)}function f(a,b,c){a.removeEventListener(b,c,!1)}function g(a,b,c){if(a)if(a.classList)a.classList[c?"add":"remove"](b);else{var d=(" "+a.className+" ").replace(L," ").replace(" "+b+" "," ");a.className=(d+(c?" "+b:"")).replace(L," ")}}function h(a,b,c){var d=a&&a.style;if(d){if(void 0===c)return O.defaultView&&O.defaultView.getComputedStyle?c=O.defaultView.getComputedStyle(a,""):a.currentStyle&&(c=a.currentStyle),void 0===b?c:c[b];b in d||(b="-webkit-"+b),d[b]=c+("string"==typeof c?"":"px")}}function i(a,b,c){if(a){var d=a.getElementsByTagName(b),e=0,f=d.length;if(c)for(;f>e;e++)c(d[e],e);return d}return[]}function j(a,b,c,d,e,f,g){var h=O.createEvent("Event"),i=(a||b[M]).options,j="on"+c.charAt(0).toUpperCase()+c.substr(1);h.initEvent(c,!0,!0),h.to=b,h.from=e||b,h.item=d||b,h.clone=w,h.oldIndex=f,h.newIndex=g,b.dispatchEvent(h),i[j]&&i[j].call(a,h)}function k(a,b,c,d,e,f){var g,h,i=a[M],j=i.options.onMove;return g=O.createEvent("Event"),g.initEvent("move",!0,!0),g.to=b,g.from=a,g.dragged=c,g.draggedRect=d,g.related=e||b,g.relatedRect=f||b.getBoundingClientRect(),a.dispatchEvent(g),j&&(h=j.call(i,g)),h}function l(a){a.draggable=!1}function m(){S=!1}function n(a,b){var c=a.lastElementChild,d=c.getBoundingClientRect();return(b.clientY-(d.top+d.height)>5||b.clientX-(d.right+d.width)>5)&&c}function o(a){for(var b=a.tagName+a.className+a.src+a.href+a.textContent,c=b.length,d=0;c--;)d+=b.charCodeAt(c);return d.toString(36)}function p(a,b){var c=0;if(!a||!a.parentNode)return-1;for(;a&&(a=a.previousElementSibling);)"TEMPLATE"!==a.nodeName.toUpperCase()&&q(a,b)&&c++;return c}function q(a,b){if(a){b=b.split(".");var c=b.shift().toUpperCase(),d=new RegExp("\\s("+b.join("|")+")(?=\\s)","g");return!(""!==c&&a.nodeName.toUpperCase()!=c||b.length&&((" "+a.className+" ").match(d)||[]).length!=b.length)}return!1}function r(a,b){var c,d;return function(){void 0===c&&(c=arguments,d=this,setTimeout(function(){1===c.length?a.call(d,c[0]):a.apply(d,c),c=void 0},b))}}function s(a,b){if(a&&b)for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c]);return a}if("undefined"==typeof window||"undefined"==typeof window.document)return function(){throw new Error("Sortable.js requires a window with a document")};var t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K={},L=/\s+/g,M="Sortable"+(new Date).getTime(),N=window,O=N.document,P=N.parseInt,Q=!!("draggable"in O.createElement("div")),R=function(a){return a=O.createElement("x"),a.style.cssText="pointer-events:auto","auto"===a.style.pointerEvents}(),S=!1,T=Math.abs,U=([].slice,[]),V=r(function(a,b,c){if(c&&b.scroll){var d,e,f,g,h=b.scrollSensitivity,i=b.scrollSpeed,j=a.clientX,k=a.clientY,l=window.innerWidth,m=window.innerHeight;if(A!==c&&(z=b.scroll,A=c,z===!0)){z=c;do if(z.offsetWidth
|
1
|
+
/*! Sortable 1.10.2 - MIT | git://github.com/SortableJS/Sortable.git */
|
2
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Sortable=e()}(this,function(){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(){return(a=Object.assign||function(t){for(var e=1;e
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spina
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.alpha
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bram Jetten
|
@@ -220,6 +220,20 @@ dependencies:
|
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: 1.0.0
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: attr_json
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - ">="
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - ">="
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '0'
|
223
237
|
description: CMS
|
224
238
|
email:
|
225
239
|
- bram@denkgroot.com
|
@@ -326,16 +340,20 @@ files:
|
|
326
340
|
- app/assets/images/spina/arrow-right.svg
|
327
341
|
- app/assets/images/spina/datepicker.svg
|
328
342
|
- app/assets/images/spina/divider.svg
|
343
|
+
- app/assets/images/spina/favicon.png
|
329
344
|
- app/assets/images/spina/media_folder_placeholder.svg
|
330
345
|
- app/assets/images/spina/spina.png
|
331
346
|
- app/assets/images/spina/spina.svg
|
332
|
-
- app/assets/javascripts/spina/admin/account.coffee
|
333
347
|
- app/assets/javascripts/spina/admin/application.js
|
334
348
|
- app/assets/javascripts/spina/admin/confirm_delete.coffee.erb
|
349
|
+
- app/assets/javascripts/spina/admin/controllers/attachment_picker_controller.js
|
335
350
|
- app/assets/javascripts/spina/admin/controllers/gallery_select_controller.js
|
336
351
|
- app/assets/javascripts/spina/admin/controllers/image_form_controller.js
|
337
352
|
- app/assets/javascripts/spina/admin/controllers/infinite_scroll_controller.js
|
353
|
+
- app/assets/javascripts/spina/admin/controllers/media_picker_controller.js
|
354
|
+
- app/assets/javascripts/spina/admin/controllers/modal_controller.js
|
338
355
|
- app/assets/javascripts/spina/admin/controllers/page_collapse_controller.js
|
356
|
+
- app/assets/javascripts/spina/admin/controllers/repeater_form_controller.js
|
339
357
|
- app/assets/javascripts/spina/admin/dropdown.coffee
|
340
358
|
- app/assets/javascripts/spina/admin/forms.coffee
|
341
359
|
- app/assets/javascripts/spina/admin/media_gallery.coffee
|
@@ -359,10 +377,12 @@ files:
|
|
359
377
|
- app/assets/stylesheets/spina/_ics_spina.scss
|
360
378
|
- app/assets/stylesheets/spina/_labels.sass
|
361
379
|
- app/assets/stylesheets/spina/_login.sass
|
380
|
+
- app/assets/stylesheets/spina/_media_picker.sass
|
362
381
|
- app/assets/stylesheets/spina/_mixins.sass
|
363
382
|
- app/assets/stylesheets/spina/_modal.sass
|
364
383
|
- app/assets/stylesheets/spina/_normalize.scss
|
365
384
|
- app/assets/stylesheets/spina/_notifications.sass
|
385
|
+
- app/assets/stylesheets/spina/_pages.sass
|
366
386
|
- app/assets/stylesheets/spina/_sortable_lists.sass
|
367
387
|
- app/assets/stylesheets/spina/_tables.sass
|
368
388
|
- app/assets/stylesheets/spina/_trix_custom.sass
|
@@ -390,40 +410,36 @@ files:
|
|
390
410
|
- app/helpers/spina/admin/admin_helper.rb
|
391
411
|
- app/helpers/spina/admin/pages_helper.rb
|
392
412
|
- app/helpers/spina/admin_nav_helper.rb
|
393
|
-
- app/helpers/spina/
|
413
|
+
- app/helpers/spina/attachments_helper.rb
|
394
414
|
- app/helpers/spina/images_helper.rb
|
395
415
|
- app/helpers/spina/pages_helper.rb
|
396
416
|
- app/mailers/spina/user_mailer.rb
|
397
|
-
- app/models/concerns/spina/image_collectable.rb
|
398
|
-
- app/models/concerns/spina/optionable.rb
|
399
|
-
- app/models/concerns/spina/part.rb
|
400
417
|
- app/models/concerns/spina/partable.rb
|
418
|
+
- app/models/concerns/spina/translated_content.rb
|
401
419
|
- app/models/spina/account.rb
|
402
420
|
- app/models/spina/application_record.rb
|
403
421
|
- app/models/spina/attachment.rb
|
404
|
-
- app/models/spina/attachment_collection.rb
|
405
422
|
- app/models/spina/current.rb
|
406
423
|
- app/models/spina/image.rb
|
407
|
-
- app/models/spina/image_collection.rb
|
408
|
-
- app/models/spina/image_collections_image.rb
|
409
|
-
- app/models/spina/layout_part.rb
|
410
|
-
- app/models/spina/line.rb
|
411
424
|
- app/models/spina/media_folder.rb
|
412
425
|
- app/models/spina/navigation.rb
|
413
426
|
- app/models/spina/navigation_item.rb
|
414
|
-
- app/models/spina/option.rb
|
415
427
|
- app/models/spina/page.rb
|
416
|
-
- app/models/spina/
|
428
|
+
- app/models/spina/parts/attachment.rb
|
429
|
+
- app/models/spina/parts/base.rb
|
430
|
+
- app/models/spina/parts/image.rb
|
431
|
+
- app/models/spina/parts/image_collection.rb
|
432
|
+
- app/models/spina/parts/line.rb
|
433
|
+
- app/models/spina/parts/option.rb
|
434
|
+
- app/models/spina/parts/repeater.rb
|
435
|
+
- app/models/spina/parts/repeater_content.rb
|
436
|
+
- app/models/spina/parts/text.rb
|
417
437
|
- app/models/spina/resource.rb
|
418
438
|
- app/models/spina/rewrite_rule.rb
|
419
439
|
- app/models/spina/setting.rb
|
420
|
-
- app/models/spina/structure.rb
|
421
|
-
- app/models/spina/structure_item.rb
|
422
|
-
- app/models/spina/structure_part.rb
|
423
|
-
- app/models/spina/text.rb
|
424
440
|
- app/models/spina/user.rb
|
441
|
+
- app/presenters/spina/content_presenter.rb
|
425
442
|
- app/presenters/spina/menu_presenter.rb
|
426
|
-
- app/views/dummy/show.html.haml
|
427
443
|
- app/views/layouts/spina/admin/admin.html.haml
|
428
444
|
- app/views/layouts/spina/admin/media_library.html.haml
|
429
445
|
- app/views/layouts/spina/admin/pages.html.haml
|
@@ -436,30 +452,25 @@ files:
|
|
436
452
|
- app/views/spina/admin/accounts/social.html.haml
|
437
453
|
- app/views/spina/admin/accounts/style.html.haml
|
438
454
|
- app/views/spina/admin/attachments/_attachment.html.haml
|
439
|
-
- app/views/spina/admin/attachments/_attachment_collection.html.haml
|
440
|
-
- app/views/spina/admin/attachments/_select.html.haml
|
441
|
-
- app/views/spina/admin/attachments/_select_collection.html.haml
|
442
455
|
- app/views/spina/admin/attachments/create.js.erb
|
443
456
|
- app/views/spina/admin/attachments/index.html.haml
|
444
|
-
- app/views/spina/admin/attachments/insert.js.erb
|
445
|
-
- app/views/spina/admin/attachments/insert_collection.js.coffee
|
446
|
-
- app/views/spina/admin/attachments/select.js.erb
|
447
|
-
- app/views/spina/admin/attachments/select_collection.js.erb
|
448
|
-
- app/views/spina/admin/image_collections/_image_collection.html.haml
|
449
457
|
- app/views/spina/admin/images/_form.html.haml
|
450
458
|
- app/views/spina/admin/images/_image.html.haml
|
451
459
|
- app/views/spina/admin/images/create.js.erb
|
452
460
|
- app/views/spina/admin/images/index.html.haml
|
453
461
|
- app/views/spina/admin/images/index.js.erb
|
454
|
-
- app/views/spina/admin/layout_partables/lines/_form.html.haml
|
455
462
|
- app/views/spina/admin/media_folders/_form.html.haml
|
456
463
|
- app/views/spina/admin/media_folders/_media_folder.html.haml
|
457
464
|
- app/views/spina/admin/media_folders/edit.js.erb
|
458
465
|
- app/views/spina/admin/media_folders/new.js.erb
|
459
466
|
- app/views/spina/admin/media_folders/show.html.haml
|
467
|
+
- app/views/spina/admin/media_picker/_image.html.haml
|
468
|
+
- app/views/spina/admin/media_picker/_media_picker.html.haml
|
469
|
+
- app/views/spina/admin/media_picker/_media_picker_grid.html.haml
|
460
470
|
- app/views/spina/admin/media_picker/_modal.html.haml
|
461
471
|
- app/views/spina/admin/media_picker/infinite_scroll.js.erb
|
462
472
|
- app/views/spina/admin/media_picker/select.js.erb
|
473
|
+
- app/views/spina/admin/media_picker/show.html.haml
|
463
474
|
- app/views/spina/admin/media_picker/show.js.erb
|
464
475
|
- app/views/spina/admin/navigations/_navigation_item_nested_list.html.haml
|
465
476
|
- app/views/spina/admin/navigations/_page.html.haml
|
@@ -477,16 +488,15 @@ files:
|
|
477
488
|
- app/views/spina/admin/pages/index.html.haml
|
478
489
|
- app/views/spina/admin/pages/new.html.haml
|
479
490
|
- app/views/spina/admin/pages/update.js.coffee
|
480
|
-
- app/views/spina/admin/
|
481
|
-
- app/views/spina/admin/
|
482
|
-
- app/views/spina/admin/
|
483
|
-
- app/views/spina/admin/
|
484
|
-
- app/views/spina/admin/
|
485
|
-
- app/views/spina/admin/
|
486
|
-
- app/views/spina/admin/
|
487
|
-
- app/views/spina/admin/
|
488
|
-
- app/views/spina/admin/
|
489
|
-
- app/views/spina/admin/partables/texts/_form.html.haml
|
491
|
+
- app/views/spina/admin/parts/attachments/_form.html.haml
|
492
|
+
- app/views/spina/admin/parts/image_collections/_fields.html.haml
|
493
|
+
- app/views/spina/admin/parts/image_collections/_form.html.haml
|
494
|
+
- app/views/spina/admin/parts/images/_form.html.haml
|
495
|
+
- app/views/spina/admin/parts/lines/_form.html.haml
|
496
|
+
- app/views/spina/admin/parts/options/_form.html.haml
|
497
|
+
- app/views/spina/admin/parts/repeaters/_fields.html.haml
|
498
|
+
- app/views/spina/admin/parts/repeaters/_form.html.haml
|
499
|
+
- app/views/spina/admin/parts/texts/_form.html.haml
|
490
500
|
- app/views/spina/admin/password_resets/edit.html.haml
|
491
501
|
- app/views/spina/admin/password_resets/new.html.haml
|
492
502
|
- app/views/spina/admin/resources/edit.html.haml
|
@@ -499,9 +509,6 @@ files:
|
|
499
509
|
- app/views/spina/admin/shared/_notifications.html.haml
|
500
510
|
- app/views/spina/admin/shared/_primary_navigation.html.haml
|
501
511
|
- app/views/spina/admin/shared/_rich_text_field.html.haml
|
502
|
-
- app/views/spina/admin/structure_items/_fields.html.haml
|
503
|
-
- app/views/spina/admin/structure_partables/attachment_collections/_form.html.haml
|
504
|
-
- app/views/spina/admin/structure_partables/attachments/_form.html.haml
|
505
512
|
- app/views/spina/admin/users/_form.html.haml
|
506
513
|
- app/views/spina/admin/users/edit.html.haml
|
507
514
|
- app/views/spina/admin/users/index.html.haml
|
@@ -537,6 +544,9 @@ files:
|
|
537
544
|
- db/migrate/10_create_spina_image_collections.rb
|
538
545
|
- db/migrate/11_create_spina_resources.rb
|
539
546
|
- db/migrate/12_add_url_title_to_spina_page_translations.rb
|
547
|
+
- db/migrate/13_add_json_attributes_to_spina_accounts.rb
|
548
|
+
- db/migrate/14_add_json_attributes_to_spina_pages.rb
|
549
|
+
- db/migrate/15_add_slug_to_spina_resources.rb
|
540
550
|
- db/migrate/1_create_spina_tables.rb
|
541
551
|
- db/migrate/2_create_spina_translation_tables.rb
|
542
552
|
- db/migrate/3_create_spina_navigations.rb
|
@@ -565,8 +575,10 @@ files:
|
|
565
575
|
- lib/generators/spina/templates/config/initializers/themes/default.rb
|
566
576
|
- lib/generators/spina/templates/config/initializers/themes/demo.rb
|
567
577
|
- lib/spina.rb
|
578
|
+
- lib/spina/attr_json_spina_parts_model.rb
|
568
579
|
- lib/spina/engine.rb
|
569
580
|
- lib/spina/fontcustom/_ics_spina.scss
|
581
|
+
- lib/spina/part.rb
|
570
582
|
- lib/spina/plugin.rb
|
571
583
|
- lib/spina/railtie.rb
|
572
584
|
- lib/spina/theme.rb
|
@@ -596,9 +608,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
596
608
|
version: '0'
|
597
609
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
598
610
|
requirements:
|
599
|
-
- - "
|
611
|
+
- - ">"
|
600
612
|
- !ruby/object:Gem::Version
|
601
|
-
version:
|
613
|
+
version: 1.3.1
|
602
614
|
requirements: []
|
603
615
|
rubygems_version: 3.0.3
|
604
616
|
signing_key:
|
@@ -1,16 +0,0 @@
|
|
1
|
-
ready = ->
|
2
|
-
if $('.account-theme').length > 0
|
3
|
-
layout_parts = $('.account-theme').data('layout-parts')
|
4
|
-
show_layout_parts(layout_parts)
|
5
|
-
|
6
|
-
$(document).on 'turbolinks:load', ready
|
7
|
-
|
8
|
-
$(document).on 'change', '.account-theme select', ->
|
9
|
-
layout_parts = $(this).find('option:selected').data('layout-parts').split(" ")
|
10
|
-
show_layout_parts(layout_parts)
|
11
|
-
|
12
|
-
show_layout_parts = (layout_parts) ->
|
13
|
-
$('tr.layout-part').hide()
|
14
|
-
for layout_part in layout_parts
|
15
|
-
if layout_part
|
16
|
-
$('tr.layout-part[data-name=' + layout_part + ']').show()
|
@@ -1,23 +0,0 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module ImageCollectable
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
attr_reader :image_tokens, :image_positions
|
9
|
-
end
|
10
|
-
|
11
|
-
def image_tokens=(ids)
|
12
|
-
self.image_ids = ids.split(",")
|
13
|
-
end
|
14
|
-
|
15
|
-
def image_positions=(positions)
|
16
|
-
positions = positions.split(",")
|
17
|
-
self.image_collections_images.each do |image|
|
18
|
-
image.position = positions.index(image.image.try(:id).try(:to_s))
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
require 'active_support/concern'
|
2
|
-
|
3
|
-
module Spina
|
4
|
-
module Part
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
attr_accessor :position
|
9
|
-
|
10
|
-
validates :name, :title, :partable_type, presence: true
|
11
|
-
|
12
|
-
after_save -> { partable.try(:save) }
|
13
|
-
|
14
|
-
scope :sorted, -> { order(:position) }
|
15
|
-
end
|
16
|
-
|
17
|
-
def to_s
|
18
|
-
name
|
19
|
-
end
|
20
|
-
|
21
|
-
def content
|
22
|
-
(partable || partable_type.constantize.new).content
|
23
|
-
end
|
24
|
-
|
25
|
-
def value
|
26
|
-
partable.try(:value)
|
27
|
-
end
|
28
|
-
|
29
|
-
def partable_attributes=(attributes)
|
30
|
-
if partable.present?
|
31
|
-
partable.assign_attributes(attributes)
|
32
|
-
else
|
33
|
-
self.partable = self.partable_type.constantize.new(attributes)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
end
|
38
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Spina
|
2
|
-
class AttachmentCollection < ApplicationRecord
|
3
|
-
|
4
|
-
has_one :page_part, as: :page_partable
|
5
|
-
has_many :structure_parts, as: :structure_partable
|
6
|
-
has_and_belongs_to_many :attachments, join_table: 'spina_attachment_collections_attachments'
|
7
|
-
|
8
|
-
attr_reader :attachment_tokens
|
9
|
-
accepts_nested_attributes_for :attachments, allow_destroy: true
|
10
|
-
|
11
|
-
def content
|
12
|
-
self
|
13
|
-
end
|
14
|
-
|
15
|
-
def attachment_tokens=(ids)
|
16
|
-
self.attachment_ids = ids.split(",")
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
end
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module Spina
|
2
|
-
class ImageCollection < ApplicationRecord
|
3
|
-
include ImageCollectable
|
4
|
-
|
5
|
-
has_one :page_part, as: :page_partable
|
6
|
-
has_many :image_collections_images, autosave: true
|
7
|
-
has_many :images, through: :image_collections_images
|
8
|
-
has_many :structure_parts, as: :structure_partable
|
9
|
-
|
10
|
-
accepts_nested_attributes_for :images, allow_destroy: true
|
11
|
-
|
12
|
-
def content
|
13
|
-
self
|
14
|
-
end
|
15
|
-
|
16
|
-
alias_method :old_update, :update
|
17
|
-
def update(attributes)
|
18
|
-
self.images.clear if attributes.reject{|key,value| key == "id" }.blank?
|
19
|
-
old_update(attributes)
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module Spina
|
2
|
-
class LayoutPart < ApplicationRecord
|
3
|
-
include Part
|
4
|
-
include Optionable
|
5
|
-
|
6
|
-
belongs_to :account
|
7
|
-
belongs_to :layout_partable, polymorphic: true
|
8
|
-
|
9
|
-
accepts_nested_attributes_for :layout_partable, allow_destroy: true
|
10
|
-
|
11
|
-
validates_uniqueness_of :name, scope: :account_id
|
12
|
-
|
13
|
-
alias_attribute :partable, :layout_partable
|
14
|
-
alias_attribute :partable_type, :layout_partable_type
|
15
|
-
alias_method :layout_partable_attributes=, :partable_attributes=
|
16
|
-
|
17
|
-
def position(theme)
|
18
|
-
layout_parts = theme.layout_template[:layout_parts]
|
19
|
-
layout_parts.index { |layout_part| layout_part == self.name }.to_i
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
data/app/models/spina/line.rb
DELETED
data/app/models/spina/option.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module Spina
|
2
|
-
class Option < ApplicationRecord
|
3
|
-
has_one :page_part, as: :page_partable
|
4
|
-
has_one :layout_part, as: :layout_partable
|
5
|
-
has_one :structure_part, as: :structure_partable
|
6
|
-
|
7
|
-
def content
|
8
|
-
I18n.t(['options',part.name,value].compact.join('.'))
|
9
|
-
end
|
10
|
-
|
11
|
-
private
|
12
|
-
|
13
|
-
def part
|
14
|
-
page_part || layout_part || structure_part
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|