card-mod-layout 0.14.2 → 0.15.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3b9347188889d52cf3c4ba629db96046727f6acb83de6c0e219bf258fcf27dda
4
- data.tar.gz: c87c2b313bb85bbd469c09ebcf32466114c6161e1324f6e6e75b561ab767c5be
3
+ metadata.gz: eae60ab480a1985e43a70c077377a025e51d30b1b39a395b04c6907c3c57a41d
4
+ data.tar.gz: 672b7bf9992a129a5ca1f5ff497fc19511b55b0ff5146226b25152a1d4e9d14c
5
5
  SHA512:
6
- metadata.gz: 9296c1fc07201cc333b94773c21812328b0449cd9ac9f1fd5c7a583e47d3258cdeea8367dcf33a2d9c857f4de5acb14f4f7ba89d26016f4e4a9c345b6aab243e
7
- data.tar.gz: bdd62b5a5248520633d021a29a7499597a6c89e61b9c55ca071668f7a92e2c48aed4712090f313d8b4ab4128f517ccf736678ce25ca9826e43fe817c7c2a44cf
6
+ metadata.gz: 7b08ce988ef614da4dc3c4c675a1b717e0bdbb481c6c4b98b862dab1de79f951a446ecd6837ee49dcbea22c71c2758d7d6040c7415e7d7de2e79b964732788c5
7
+ data.tar.gz: ec94cb6a8b07a78e54de66ef5145d13c0c607f338275a5b167f7ddc7a7688a6b57e6f05f7f01893ee76e7a46587dc064d3230e1cdb107a7ed766188e0fff6ee1
@@ -0,0 +1,76 @@
1
+ wrapDeckoLayout = ->
2
+ $footer = $('body > footer').first()
3
+ $('body > article, body > aside').wrapAll("<div class='#{containerClass()}'/>")
4
+ $('body > div > article, body > div > aside')
5
+ .wrapAll('<div class="row row-offcanvas">')
6
+ if $footer
7
+ $('body').append $footer
8
+
9
+ wrapSidebarToggle = (toggle, flex) ->
10
+ "<div class='container'><div class='row #{flex}'>#{toggle}</div></div>"
11
+
12
+ containerClass = ->
13
+ if $('body').hasClass('fluid') then "container-fluid" else "container"
14
+
15
+ toggleButton = (side) ->
16
+ icon_dir = if side == 'left' then 'right' else 'left'
17
+ "<button class='offcanvas-toggle btn btn-secondary "+
18
+ "d-sm-none' data-toggle='offcanvas-#{side}'>" +
19
+ "<i class='material-icons'>chevron_#{icon_dir}</i></button>"
20
+
21
+ sidebarToggle = (side) ->
22
+ if side == "both"
23
+ wrapSidebarToggle(toggleButton("left") + toggleButton("right"), "flex-row justify-content-between")
24
+ else if side == "left"
25
+ wrapSidebarToggle(toggleButton("left"), "flex-row")
26
+ else
27
+ wrapSidebarToggle(toggleButton("right"), "flex-row-reverse")
28
+
29
+ singleSidebar = (side) ->
30
+ $article = $('body > article').first()
31
+ $aside = $('body > aside').first()
32
+ $article.addClass("col-xs-12 col-sm-9")
33
+ $aside.addClass(
34
+ "col-xs-6 col-sm-3 sidebar-offcanvas sidebar-offcanvas-#{side}"
35
+ )
36
+ if side == 'left'
37
+ $('body').append($aside).append($article)
38
+ else
39
+ $('body').append($article).append($aside)
40
+ wrapDeckoLayout()
41
+ $article.prepend(sidebarToggle(side))
42
+
43
+ doubleSidebar = ->
44
+ $article = $('body > article').first()
45
+ $asideLeft = $('body > aside').first()
46
+ $asideRight = $($('body > aside')[1])
47
+ $article.addClass("col-xs-12 col-sm-6")
48
+ sideClass = "col-xs-6 col-sm-3 sidebar-offcanvas"
49
+ $asideLeft.addClass("#{sideClass} sidebar-offcanvas-left")
50
+ $asideRight.addClass("#{sideClass} sidebar-offcanvas-right")
51
+ $('body').append($asideLeft).append($article).append($asideRight)
52
+ wrapDeckoLayout()
53
+ toggles = sidebarToggle('both')
54
+ $article.prepend(toggles)
55
+
56
+ $.fn.extend toggleText: (a, b) ->
57
+ @text(if @text() == b then a else b)
58
+
59
+ this
60
+ $(window).ready ->
61
+ switch
62
+ when $('body').hasClass('right-sidebar')
63
+ singleSidebar('right')
64
+ when $('body').hasClass('left-sidebar')
65
+ singleSidebar('left')
66
+ when $('body').hasClass('two-sidebar')
67
+ doubleSidebar()
68
+
69
+ $('[data-toggle="offcanvas-left"]').click ->
70
+ $('.row-offcanvas').removeClass('right-active').toggleClass('left-active')
71
+ $(this).find('i.material-icons')
72
+ .toggleText('chevron_left', 'chevron_right')
73
+ $('[data-toggle="offcanvas-right"]').click ->
74
+ $('.row-offcanvas').removeClass('left-active').toggleClass('right-active')
75
+ $(this).find('i.material-icons')
76
+ .toggleText('chevron_left', 'chevron_right')
@@ -0,0 +1,111 @@
1
+ $(window).ready ->
2
+ $('body').on 'hidden.bs.modal', (_event) ->
3
+ decko.removeModal()
4
+
5
+ $('body').on "show.bs.modal", "._modal-slot", (event, slot) ->
6
+ link = $(event.relatedTarget)
7
+ addModalDialogClasses $(this), link
8
+ $(this).modal("handleUpdate")
9
+ decko.contentLoaded $(event.target), link
10
+
11
+ $('._modal-slot').each ->
12
+ openModalIfPresent $(this)
13
+ addModalDialogClasses $(this)
14
+
15
+ $('body').on 'click', '.submit-modal', ->
16
+ $(this).closest('.modal-content').find('form').submit()
17
+
18
+ openModalIfPresent = (mslot) ->
19
+ modal_content = mslot.find(".modal-content")
20
+ if modal_content.length > 0 && modal_content.html().length > 0
21
+ $("#main > .card-slot").registerAsOrigin("modal", mslot)
22
+ mslot.modal("show")
23
+
24
+ addModalDialogClasses = ($modal_slot, $link) ->
25
+ dialog = $modal_slot.find(".modal-dialog")
26
+ classes_from_link =
27
+ if $link? then $link.data("modal-class") else $modal_slot.data("modal-class")
28
+ if classes_from_link? and dialog?
29
+ dialog.addClass classes_from_link
30
+
31
+ jQuery.fn.extend {
32
+ showAsModal: ($slotter) ->
33
+ el = @modalify($slotter) if $slotter?
34
+ if $("body > ._modal-slot").is(":visible")
35
+ @addModal el, $slotter
36
+ else
37
+ if $("body > ._modal-slot")[0]
38
+ $("._modal-slot").trigger "decko.slot.destroy"
39
+ $("body > ._modal-slot").replaceWith el
40
+ else
41
+ $("body").append el
42
+
43
+ $slotter.registerAsOrigin("modal", el)
44
+ el.modal("show", $slotter)
45
+
46
+ addModal: (el, $slotter) ->
47
+ if $slotter.data("slotter-mode") == "modal-replace"
48
+ addModalDialogClasses el, $slotter
49
+ dialog = el.find(".modal-dialog")
50
+ el.adoptModalOrigin()
51
+ $("._modal-slot").trigger "decko.slot.destroy"
52
+ $("body > ._modal-slot > .modal-dialog").replaceWith dialog
53
+ decko.contentLoaded dialog, $slotter
54
+ else
55
+ decko.pushModal el
56
+ $slotter.registerAsOrigin("modal", el)
57
+ el.modal("show", $slotter)
58
+
59
+ adoptModalOrigin: () ->
60
+ origin_slot_id = $("body > ._modal-slot .card-slot[data-modal-origin-slot-id]")
61
+ .data("modal-origin-slot-id")
62
+ @find(".modal-body .card-slot").attr("data-modal-origin-slot-id", origin_slot_id)
63
+
64
+ modalSlot: ->
65
+ slot = $("#modal-container")
66
+ if slot.length > 0 then slot else decko.createModalSlot()
67
+
68
+ modalify: ($slotter) ->
69
+ if $slotter.data("modal-body")?
70
+ @find(".modal-body").append($slotter.data("modal-body"))
71
+
72
+ if @hasClass("_modal-slot")
73
+ this
74
+ else
75
+ modalSlot = $('<div/>', id: "modal-container", class: "modal fade _modal-slot")
76
+ modalSlot.append(
77
+ $('<div/>' , class: "modal-dialog").append(
78
+ $('<div/>', class: "modal-content").append(this)
79
+ )
80
+ )
81
+ modalSlot
82
+ }
83
+
84
+ $.extend decko,
85
+ createModalSlot: ->
86
+ slot = $('<div/>', id: "modal-container", class: "modal fade _modal-slot")
87
+ $("body").append(slot)
88
+ slot
89
+
90
+ removeModal: ->
91
+ if $("._modal-stack")[0]
92
+ decko.popModal()
93
+ else
94
+ $("._modal-slot").trigger "decko.slot.destroy"
95
+ $(".modal-dialog").empty()
96
+
97
+ pushModal: (el) ->
98
+ mslot = $("body > ._modal-slot")
99
+ mslot.removeAttr("id")
100
+ mslot.removeClass("_modal-slot").addClass("_modal-stack").removeClass("modal").addClass("background-modal")
101
+ el.insertBefore mslot
102
+ $(".modal-backdrop").removeClass("show")
103
+
104
+ popModal: ->
105
+ $(".modal-backdrop").addClass("show")
106
+ $("body > ._modal-slot").trigger "decko.slot.destroy"
107
+ $("body > ._modal-slot").remove()
108
+ modal = $($("._modal-stack")[0])
109
+ modal.addClass("_modal-slot").removeClass("_modal-stack").attr("id", "modal-container").addClass("modal").removeClass("background-modal")
110
+ $(document.body).addClass("modal-open")
111
+
@@ -0,0 +1,54 @@
1
+ jQuery.fn.extend
2
+ overlaySlot: ->
3
+ oslot = @closest(".card-slot._overlay")
4
+ return oslot if oslot[0]?
5
+ oslot = @closest(".overlay-container").find("._overlay")
6
+ oslot[0]? && $(oslot[0])
7
+
8
+ addOverlay: (overlay, $slotter) ->
9
+ if @parent().hasClass("overlay-container")
10
+ if $(overlay).hasClass("_stack-overlay")
11
+ @before overlay
12
+ else
13
+ $("._overlay-origin").removeClass("_overlay-origin")
14
+ @replaceOverlay(overlay)
15
+ else
16
+ if @parent().hasClass("_overlay-container-placeholder")
17
+ @parent().addClass("overlay-container")
18
+ else
19
+ @wrapAll('<div class="overlay-container">')
20
+ @addClass("_bottomlay-slot")
21
+ @before overlay
22
+
23
+ $slotter.registerAsOrigin("overlay", overlay)
24
+ decko.contentLoaded(overlay, $slotter)
25
+
26
+ replaceOverlay: (overlay) ->
27
+ @overlaySlot().trigger "decko.slot.destroy"
28
+ @overlaySlot().replaceWith overlay
29
+ $(".bridge-sidebar .tab-pane:not(.active) .bridge-pills > .nav-item > .nav-link.active").removeClass("active")
30
+
31
+ isInOverlay: ->
32
+ return @closest(".card-slot._overlay").length
33
+
34
+ removeOverlay: () ->
35
+ slot = @overlaySlot()
36
+ if slot
37
+ slot.removeOverlaySlot()
38
+
39
+ removeOverlaySlot: () ->
40
+ @trigger "decko.slot.destroy"
41
+ if @siblings().length == 1
42
+ bottomlay = $(@siblings()[0])
43
+ if bottomlay.hasClass("_bottomlay-slot")
44
+ if bottomlay.parent().hasClass("_overlay-container-placeholder")
45
+ bottomlay.parent().removeClass("overlay-container")
46
+ else
47
+ bottomlay.unwrap()
48
+ bottomlay.removeClass("_bottomlay-slot").updateBridge(true, bottomlay)
49
+
50
+ #bottomlay.find(".tinymce-textarea").each ->
51
+ # tinymce.EditorManager.execCommand('mceAddControl',true, editor_id);
52
+ # decko.initTinyMCE($(this).attr("id"))
53
+
54
+ @remove()
@@ -0,0 +1,103 @@
1
+ .d0-nav-container {
2
+ flex-wrap: inherit;
3
+ display: flex;
4
+ width: 100%;
5
+ justify-content: space-between;
6
+ }
7
+
8
+
9
+ /*----------- Sidebar -------------*/
10
+
11
+ .row.row-offcanvas {
12
+ > aside, article {
13
+ margin: 0;
14
+ }
15
+ }
16
+
17
+ /* collapsed sidebar styles */
18
+ @media screen and (max-width: 576px) {
19
+ .row-offcanvas {
20
+ position: relative;
21
+ -webkit-transition: all 0.25s ease-out;
22
+ -moz-transition: all 0.25s ease-out;
23
+ transition: all 0.25s ease-out;
24
+ }
25
+
26
+ .sidebar-offcanvas-right {
27
+ right: -41.6%;
28
+ }
29
+
30
+ .sidebar-offcanvas-left {
31
+ left: -41.6%;
32
+ }
33
+ .row-offcanvas.right-active {
34
+ right: 41.6%;
35
+ }
36
+ .row-offcanvas.left-active {
37
+ left: 41.6%;
38
+ }
39
+ .sidebar-offcanvas {
40
+ position: absolute !important;
41
+ top: 0 !important;
42
+ width: 41.6% !important;
43
+ }
44
+ }
45
+
46
+ .offcanvas-toggle {
47
+ font-size: 10px !important;
48
+ padding: 5px !important;
49
+ margin-bottom: 15px !important;
50
+ }
51
+
52
+ .act-summary {
53
+ min-width: 27px;
54
+ }
55
+
56
+
57
+ footer .separator {
58
+ padding-left: 2px;
59
+ padding-right: 2px;
60
+ }
61
+
62
+ body.right-sidebar, body.left-sidebar, body.two-sidebar {
63
+ article, #primary {
64
+ margin: 0 1% 3em 1%;
65
+ float: left;
66
+ width: 67%;
67
+ }
68
+
69
+ aside, #secondary {
70
+ margin: 0 1% 3em 1%;
71
+ float: right;
72
+ width: 28%;
73
+ }
74
+
75
+ footer {
76
+ clear:both;
77
+ text-align: center;
78
+ padding: 1em;
79
+ }
80
+ }
81
+
82
+ @media print {
83
+ article, #primary {
84
+ width: 100%;
85
+ float: none;
86
+ margin: 0;
87
+ }
88
+
89
+ aside, #secondary, footer {
90
+ display: none;
91
+ }
92
+ }
93
+
94
+ .RIGHT-Xenabled_role.edit_inline-view {
95
+ .pointer-checkbox-list {
96
+ #pointer-checkbox-anyone_signed_in {
97
+ display: none;
98
+ }
99
+ }
100
+ .card-editor {
101
+ padding-bottom: 0;
102
+ }
103
+ }
@@ -0,0 +1,42 @@
1
+ .background-modal {
2
+ position: fixed;
3
+ top: 0;
4
+ right: 0;
5
+ bottom: 0;
6
+ left: 0;
7
+ z-index: 900;
8
+ outline: 0;
9
+ overflow-x: hidden;
10
+ overflow-y: auto;
11
+ }
12
+
13
+ .modal-menu .close{
14
+ font-size: 16px;
15
+ // margin-left: 10px;
16
+ }
17
+
18
+ .modal-dialog.modal-full {
19
+ max-width: 99%;
20
+ margin: 1%;
21
+ }
22
+
23
+
24
+ .modal-backdrop.in {
25
+ z-index: auto;
26
+ }
27
+
28
+ .modal-body > div {
29
+ display: inline-block;
30
+ width: 100%;
31
+
32
+ .menu-slot {
33
+ z-index: 1;
34
+ }
35
+ }
36
+
37
+
38
+ /*------ bootstrap 5 --------*/
39
+
40
+ .modal-header .btn-close {
41
+ background: none;
42
+ }
@@ -0,0 +1,51 @@
1
+ /*-------------------------- */
2
+ /*- Overlay - */
3
+ /*-------------------------- */
4
+
5
+ .overlay-container {
6
+ position: relative;
7
+ height: 100%;
8
+ overflow: auto;
9
+ .card-slot.overlay_rule-view {
10
+ border-left: 5px solid $primary;
11
+ }
12
+
13
+ .d0-card-overlay
14
+ > .d0-card-frame
15
+ > .d0-card-content {
16
+ overflow-y: scroll;
17
+ padding: 1rem 1.5rem; // px-4
18
+ }
19
+ }
20
+
21
+
22
+ .d0-card-overlay {
23
+ position: absolute;
24
+ width: 100%;
25
+ height: 100%;
26
+ z-index: 10;
27
+
28
+ > .d0-card-frame {
29
+ height: 100%;
30
+ width: 100%;
31
+
32
+ > .d0-card-header {
33
+ border-bottom: 1px solid $border-color;
34
+ padding: 0.25rem 0.25rem 0.25rem 1.25rem;
35
+ .title {
36
+ font-weight: bold;
37
+ text-transform: capitalize;
38
+ }
39
+ .card-title {
40
+ margin-bottom: 0;
41
+ }
42
+ }
43
+ }
44
+ }
45
+
46
+ // FIXME: this directly overrides above rule.
47
+
48
+ .d0-card-overlay > .d0-card-frame > .d0-card-header {
49
+ padding-left: -15px!important;
50
+ padding-right: -15px!important;
51
+ }
@@ -0,0 +1,6 @@
1
+ // layout.js.coffee
2
+ (function(){var a,e,t,s,o,i,n;i=function(){var e;if(e=$("body > footer").first(),$("body > article, body > aside").wrapAll("<div class='"+a()+"'/>"),$("body > div > article, body > div > aside").wrapAll('<div class="row row-offcanvas">'),e)return $("body").append(e)},n=function(a,e){return"<div class='container'><div class='row "+e+"'>"+a+"</div></div>"},a=function(){return $("body").hasClass("fluid")?"container-fluid":"container"},o=function(a){return"<button class='offcanvas-toggle btn btn-secondary d-sm-none' data-toggle='offcanvas-"+a+"'><i class='material-icons'>chevron_"+("left"===a?"right":"left")+"</i></button>"},t=function(a){return"both"===a?n(o("left")+o("right"),"flex-row justify-content-between"):"left"===a?n(o("left"),"flex-row"):n(o("right"),"flex-row-reverse")},s=function(a){var e,s;return e=$("body > article").first(),s=$("body > aside").first(),e.addClass("col-xs-12 col-sm-9"),s.addClass("col-xs-6 col-sm-3 sidebar-offcanvas sidebar-offcanvas-"+a),"left"===a?$("body").append(s).append(e):$("body").append(e).append(s),i(),e.prepend(t(a))},e=function(){var a,e,s,o,n;return a=$("body > article").first(),e=$("body > aside").first(),s=$($("body > aside")[1]),a.addClass("col-xs-12 col-sm-6"),o="col-xs-6 col-sm-3 sidebar-offcanvas",e.addClass(o+" sidebar-offcanvas-left"),s.addClass(o+" sidebar-offcanvas-right"),$("body").append(e).append(a).append(s),i(),n=t("both"),a.prepend(n)},$.fn.extend({toggleText:function(a,e){return this.text(this.text()===e?a:e),this}}),$(window).ready(function(){switch(!1){case!$("body").hasClass("right-sidebar"):s("right");break;case!$("body").hasClass("left-sidebar"):s("left");break;case!$("body").hasClass("two-sidebar"):e()}return $('[data-toggle="offcanvas-left"]').click(function(){return $(".row-offcanvas").removeClass("right-active").toggleClass("left-active"),$(this).find("i.material-icons").toggleText("chevron_left","chevron_right")}),$('[data-toggle="offcanvas-right"]').click(function(){return $(".row-offcanvas").removeClass("left-active").toggleClass("right-active"),$(this).find("i.material-icons").toggleText("chevron_left","chevron_right")})})}).call(this);
3
+ // modal.js.coffee
4
+ (function(){var o,d;$(window).ready(function(){return $("body").on("hidden.bs.modal",function(){return decko.removeModal()}),$("body").on("show.bs.modal","._modal-slot",function(d){var a;return a=$(d.relatedTarget),o($(this),a),$(this).modal("handleUpdate"),decko.contentLoaded($(d.target),a)}),$("._modal-slot").each(function(){return d($(this)),o($(this))}),$("body").on("click",".submit-modal",function(){return $(this).closest(".modal-content").find("form").submit()})}),d=function(o){var d;if((d=o.find(".modal-content")).length>0&&d.html().length>0)return $("#main > .card-slot").registerAsOrigin("modal",o),o.modal("show")},o=function(o,d){var a,l;if(l=o.find(".modal-dialog"),null!=(a=null!=d?d.data("modal-class"):o.data("modal-class"))&&null!=l)return l.addClass(a)},jQuery.fn.extend({showAsModal:function(o){var d;return null!=o&&(d=this.modalify(o)),$("body > ._modal-slot").is(":visible")?this.addModal(d,o):($("body > ._modal-slot")[0]?($("._modal-slot").trigger("decko.slot.destroy"),$("body > ._modal-slot").replaceWith(d)):$("body").append(d),o.registerAsOrigin("modal",d),d.modal("show",o))},addModal:function(d,a){var l;return"modal-replace"===a.data("slotter-mode")?(o(d,a),l=d.find(".modal-dialog"),d.adoptModalOrigin(),$("._modal-slot").trigger("decko.slot.destroy"),$("body > ._modal-slot > .modal-dialog").replaceWith(l),decko.contentLoaded(l,a)):(decko.pushModal(d),a.registerAsOrigin("modal",d),d.modal("show",a))},adoptModalOrigin:function(){var o;return o=$("body > ._modal-slot .card-slot[data-modal-origin-slot-id]").data("modal-origin-slot-id"),this.find(".modal-body .card-slot").attr("data-modal-origin-slot-id",o)},modalSlot:function(){var o;return(o=$("#modal-container")).length>0?o:decko.createModalSlot()},modalify:function(o){var d;return null!=o.data("modal-body")&&this.find(".modal-body").append(o.data("modal-body")),this.hasClass("_modal-slot")?this:((d=$("<div/>",{id:"modal-container","class":"modal fade _modal-slot"})).append($("<div/>",{"class":"modal-dialog"}).append($("<div/>",{"class":"modal-content"}).append(this))),d)}}),$.extend(decko,{createModalSlot:function(){var o;return o=$("<div/>",{id:"modal-container","class":"modal fade _modal-slot"}),$("body").append(o),o},removeModal:function(){return $("._modal-stack")[0]?decko.popModal():($("._modal-slot").trigger("decko.slot.destroy"),$(".modal-dialog").empty())},pushModal:function(o){var d;return(d=$("body > ._modal-slot")).removeAttr("id"),d.removeClass("_modal-slot").addClass("_modal-stack").removeClass("modal").addClass("background-modal"),o.insertBefore(d),$(".modal-backdrop").removeClass("show")},popModal:function(){return $(".modal-backdrop").addClass("show"),$("body > ._modal-slot").trigger("decko.slot.destroy"),$("body > ._modal-slot").remove(),$($("._modal-stack")[0]).addClass("_modal-slot").removeClass("_modal-stack").attr("id","modal-container").addClass("modal").removeClass("background-modal"),$(document.body).addClass("modal-open")}})}).call(this);
5
+ // overlay.js.coffee
6
+ (function(){jQuery.fn.extend({overlaySlot:function(){var e;return null!=(e=this.closest(".card-slot._overlay"))[0]?e:null!=(e=this.closest(".overlay-container").find("._overlay"))[0]&&$(e[0])},addOverlay:function(e,r){return this.parent().hasClass("overlay-container")?$(e).hasClass("_stack-overlay")?this.before(e):($("._overlay-origin").removeClass("_overlay-origin"),this.replaceOverlay(e)):(this.parent().hasClass("_overlay-container-placeholder")?this.parent().addClass("overlay-container"):this.wrapAll('<div class="overlay-container">'),this.addClass("_bottomlay-slot"),this.before(e)),r.registerAsOrigin("overlay",e),decko.contentLoaded(e,r)},replaceOverlay:function(e){return this.overlaySlot().trigger("decko.slot.destroy"),this.overlaySlot().replaceWith(e),$(".bridge-sidebar .tab-pane:not(.active) .bridge-pills > .nav-item > .nav-link.active").removeClass("active")},isInOverlay:function(){return this.closest(".card-slot._overlay").length},removeOverlay:function(){var e;if(e=this.overlaySlot())return e.removeOverlaySlot()},removeOverlaySlot:function(){var e;return this.trigger("decko.slot.destroy"),1===this.siblings().length&&(e=$(this.siblings()[0])).hasClass("_bottomlay-slot")&&(e.parent().hasClass("_overlay-container-placeholder")?e.parent().removeClass("overlay-container"):e.unwrap(),e.removeClass("_bottomlay-slot").updateBridge(!0,e)),this.remove()}})}).call(this);
data/data/real.yml ADDED
@@ -0,0 +1,143 @@
1
+ ---
2
+ - :name: Layout
3
+ :type: :cardtype
4
+ :codename: layout_type
5
+ :fields:
6
+ :description: Organize webpages. [[http://decko.org/Layout|more]]
7
+ :type:
8
+ :fields:
9
+ :create: Shark
10
+ :update: Shark
11
+ :delete: Shark
12
+
13
+ - :name: "*layout"
14
+ :type: :setting
15
+ :codename: layout
16
+ :fields:
17
+ :right:
18
+ :fields:
19
+ :input_type: select
20
+ :content_options:
21
+ :codename: layout_options
22
+ :type: :search_type
23
+
24
+ - :name:
25
+ - :all
26
+ - :layout
27
+ :type: :pointer
28
+ :content: Default Layout
29
+
30
+ - :name: "*main menu"
31
+ :type: :link_list
32
+ :content: "[[:recent|Recent Changes]]"
33
+ :codename: main_menu
34
+ :conflict: :defer
35
+ :fields:
36
+ :self:
37
+ :fields:
38
+ :read: Anyone
39
+
40
+ - :name: "*header"
41
+ :type: :html
42
+ :codename: header
43
+ :fields:
44
+ :self:
45
+ :fields:
46
+ :read: Anyone
47
+ :content: |
48
+ <nav class="navbar navbar-expand-lg navbar-dark bg-dark mb-3 nodblclick">
49
+ <div class="container">
50
+ <div class="d0-nav-container">
51
+ <div class="d-flex">
52
+ <a class="nav-logo navbar-brand" href="{{:home|home_path}}">
53
+ {{:logo|core;size:small}}
54
+ </a>
55
+ <a class="navbar-brand" href="{{:home|home_path}}">{{:title|core}}</a>
56
+ </div>
57
+ <button class="navbar-toggler" type="button" aria-label="Toggle navigation"
58
+ aria-controls="d0-navbar" aria-expanded="false"
59
+ data-bs-toggle="collapse" data-bs-target="#d0-navbar">
60
+ <span class="navbar-toggler-icon"></span>
61
+ </button>
62
+ <div class="collapse navbar-collapse" id="d0-navbar">
63
+ <ul class="navbar-nav mr-auto main-nav ms-2">{{:main_menu|navbar_links}}</ul>
64
+ <div class="navbar-nav search-box-nav mx-2">{{:search|search_box}}</div>
65
+ {{:account_links|navbar_links}}
66
+ </div>
67
+ </div>
68
+ </div>
69
+ </nav>
70
+
71
+ - :name: "*footer"
72
+ :codename: footer
73
+ :type: :html
74
+ :content: |-
75
+ <div class="d-flex justify-content-center align-items-center">
76
+ {{:credit|core}}
77
+ </div>
78
+
79
+ - :name: "*sidebar"
80
+ :codename: sidebar
81
+ :content: |-
82
+ <div>[[/ | {{:logo|content_panel}}]]</div>
83
+ <div>{{:sidebar_menu|titled}}</div>
84
+ :fields:
85
+ :right:
86
+ :fields:
87
+ :read: Anyone
88
+
89
+ - :name: Menu
90
+ :codename: sidebar_menu
91
+ :content: "<p>[[/?view=new|Add a card]]</p>"
92
+
93
+ - :name: Default Layout
94
+ :codename: default_layout
95
+ :type: :layout_type
96
+ :content: |-
97
+ <body class="d-flex flex-column h-100">
98
+ <header>{{:header|core}}</header>
99
+ <article class="container flex-shrink-0" role="main">{{_main|titled}}</article>
100
+ <footer class="footer mt-auto py-3">{{:footer|content}}</footer>
101
+ </body>
102
+
103
+ - :name: Full Width Layout
104
+ :codename: full_layout
105
+ :type: :layout_type
106
+ :content: |-
107
+ <body class="fluid d-flex flex-column h-100">
108
+ <header>{{:header|core}}</header>
109
+ <article class="container flex-shrink-0" role="main">{{_main|titled}}</article>
110
+ <footer class="footer mt-auto py-3">{{:footer|core}}</footer>
111
+ </body>
112
+
113
+ - :name: Home Layout
114
+ :codename: home_layout
115
+ :type: :layout_type
116
+ :content: |-
117
+ <body class="d-flex flex-column h-100">
118
+ <header>{{:header|core}}</header>
119
+ <article class="container flex-shrink-0" role="main">{{_main|content}}</article>
120
+ <footer class="footer mt-auto py-3">{{:footer|content}}</footer>
121
+ </body>
122
+
123
+ - :name: Right Thin Sidebar Layout
124
+ :codename: right_thin_sidebar_layout
125
+ :type: :layout_type
126
+ :content: |-
127
+ <body class="right-sidebar thin-sidebar d-flex flex-column h-100">
128
+ <header>{{:header|core}}</header>
129
+ <article class="container flex-shrink-0" role="main">{{_main|titled}}</article>
130
+ <aside>{{:sidebar|content}}</aside>
131
+ <footer class="footer mt-auto py-3">{{:footer|core}}</footer>
132
+ </body>
133
+
134
+ - :name: Left Sidebar Layout
135
+ :codename: left_sidebar_layout
136
+ :type: :layout_type
137
+ :content: |-
138
+ <body class="left-sidebar">
139
+ <header>{{:header|core}}</header>
140
+ <article>{{_main|titled}}</article>
141
+ <aside>{{:sidebar|core}}</aside>
142
+ <footer>{{:footer|core}}</footer>
143
+ </body>
data/data/test.yml ADDED
@@ -0,0 +1,18 @@
1
+ ---
2
+ - :name: lay out
3
+ :type: :layout_type
4
+ :content: 'Greatest {{_main|title: Callahan!; view: labeled}}'
5
+ - :name: stacks
6
+ :type: :list
7
+ :content: |-
8
+ horizontal
9
+ vertical
10
+ - :name:
11
+ - stacks
12
+ - :self
13
+ - :layout
14
+ :type: :pointer
15
+ :content: lay out
16
+ - :name: horizontal
17
+ - :name: vertical
18
+ :type: :pointer
@@ -5,14 +5,27 @@ format :html do
5
5
  end
6
6
 
7
7
  def account_dropdown &render_role_item
8
- split_button link_to_mycard, nil do
8
+ class_up "dropdown-toggle-split", "nav-link"
9
+ split_dropdown_button link_to_mycard do
9
10
  [
10
- link_to_card([Auth.current, :account_settings], "Account"),
11
- (["Roles", role_items(&render_role_item)] if special_roles?)
12
- ]
11
+ [[Auth.current, :account_settings], "Account"],
12
+ [:signin, t("account_sign_out"), { path: { action: :delete } }]
13
+ ] + account_dropdown_roles(&render_role_item)
13
14
  end
14
15
  end
15
16
 
17
+ private
18
+
19
+ def account_dropdown_roles &block
20
+ return [] unless special_roles?
21
+
22
+ [dropdown_header("Roles")] + account_dropdown_role_items(&block)
23
+ end
24
+
25
+ def account_dropdown_role_items
26
+ Auth.current_roles.map { |role| block_given? ? yield(role) : [role] }
27
+ end
28
+
16
29
  def special_roles?
17
30
  Auth.current_roles.size > 1
18
31
  end
File without changes
data/set/all/alert.rb CHANGED
@@ -15,9 +15,7 @@ format :html do
15
15
  end
16
16
 
17
17
  def alert_close_button
18
- wrap_with :button, type: "button", "data-dismiss": "alert",
19
- class: "close", "aria-label": "Close" do
20
- wrap_with :span, "&times;", "aria-hidden" => true
21
- end
18
+ wrap_with :button, "", type: "button", "data-bs-dismiss": "alert",
19
+ class: "btn-close", "aria-label": "Close"
22
20
  end
23
21
  end
data/set/all/layouts.rb CHANGED
@@ -22,7 +22,7 @@ format :html do
22
22
  <<-HTML.strip_heredoc
23
23
  <header>#{nest :header, view: :core}</header>
24
24
  <article>#{layout_nest}</article>
25
- <footer>{nest :footer, view: :core}</footer>
25
+ <footer>#{nest :footer, view: :core}</footer>
26
26
  HTML
27
27
  end
28
28
  end
@@ -33,7 +33,7 @@ format :html do
33
33
  <header>#{nest :header, view: :core}</header>
34
34
  <article>#{layout_nest}</article>
35
35
  <aside>#{nest :sidebar, view: :core}</aside>
36
- <footer>{nest :footer, view: :core}</footer>
36
+ <footer>#{nest :footer, view: :core}</footer>
37
37
  HTML
38
38
  end
39
39
  end
@@ -1,10 +1,16 @@
1
- #modal-container.modal.fade._modal-slot{role: "dialog", "data-backdrop": "static"}
2
- -# .modal-dialog
1
+ #modal-container.modal.fade._modal-slot{ role: "dialog" }
2
+ //, "data-backdrop": "static"}
3
3
  %div{class: classes}
4
4
  .modal-content
5
- .modal-header.clearfix
5
+ .modal-header
6
6
  = title
7
- = menu if voo.show? :menu
7
+ - if voo.show? :modal_menu
8
+ = menu
9
+ -# - else
10
+ -# else
11
+ -# %button.btn-close{ type: "button",
12
+ -# "data-bs-dismiss": "modal",
13
+ -# "aria-label": "Close" }
8
14
  .modal-body
9
15
  = body
10
16
  - if footer.present?
data/set/all/modal.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  format :html do
2
- MODAL_SIZE = { small: "sm", medium: nil, large: "lg", full: "full" }.freeze
3
- MODAL_CLOSE_OPTS = { "data-dismiss": "modal",
2
+ MODAL_SIZE = { small: "sm", medium: nil, large: "lg", full: "full", xl: "xl" }.freeze
3
+ MODAL_CLOSE_OPTS = { type: "button",
4
+ "data-bs-dismiss": "modal",
4
5
  "data-cy": "close-modal" }.freeze
5
6
 
6
7
  wrapper :modal do |opts={}|
@@ -11,28 +12,6 @@ format :html do
11
12
  footer: normalize_modal_option(:footer, opts)
12
13
  end
13
14
 
14
- def normalize_modal_option key, opts
15
- val = opts[key]
16
- return render("modal_#{key}") unless val
17
-
18
- cast_model_option val
19
- end
20
-
21
- def cast_model_option val
22
- case val
23
- when Symbol
24
- cast_model_option_symbol val
25
- when Proc
26
- val.call(self)
27
- else
28
- val
29
- end
30
- end
31
-
32
- def cast_model_option_symbol val
33
- respond_to?(val) ? send(val) : val
34
- end
35
-
36
15
  view :modal, wrap: :modal do
37
16
  ""
38
17
  end
@@ -57,7 +36,7 @@ format :html do
57
36
  [close_modal_window, pop_out_modal_window]
58
37
  end
59
38
 
60
- wrapper :modal_menu, :div, class: "modal-menu ml-auto"
39
+ wrapper :modal_menu, :div, class: "modal-menu _modal-menu ms-auto"
61
40
 
62
41
  view :modal_title, unknown: true do
63
42
  ""
@@ -65,8 +44,8 @@ format :html do
65
44
 
66
45
  view :modal_footer, unknown: true do
67
46
  button_tag "Close",
68
- class: "btn-xs _close-modal float-right",
69
- "data-dismiss" => "modal"
47
+ class: "btn-xs _close-modal float-end",
48
+ "data-bs-dismiss" => "modal"
70
49
  end
71
50
 
72
51
  view :modal_link do
@@ -105,16 +84,42 @@ format :html do
105
84
  end
106
85
 
107
86
  def normalize_modal_size_class size
108
- size.in?(MODAL_SIZE.keys) ? size : cast_model_option(size)
87
+ size.in?(MODAL_SIZE.keys) ? size : cast_modal_option(size)
109
88
  end
110
89
 
111
90
  def close_modal_window
112
91
  link_to icon_tag(:close), path: "",
113
- class: "_close-modal close",
114
- "data-dismiss": "modal"
92
+ class: "_close-modal btn-close",
93
+ "data-bs-dismiss": "modal"
115
94
  end
116
95
 
117
96
  def pop_out_modal_window
118
- link_to icon_tag(:new_window), path: {}, class: "pop-out-modal close"
97
+ return unless card.known?
98
+
99
+ link_to icon_tag(:new_window), path: {}, class: "pop-out-modal btn-close"
100
+ end
101
+
102
+ private
103
+
104
+ def normalize_modal_option key, opts
105
+ val = opts[key]
106
+ return render("modal_#{key}") unless val
107
+
108
+ cast_modal_option val
109
+ end
110
+
111
+ def cast_modal_option val
112
+ case val
113
+ when Symbol
114
+ cast_modal_option_symbol val
115
+ when Proc
116
+ val.call(self)
117
+ else
118
+ val
119
+ end
120
+ end
121
+
122
+ def cast_modal_option_symbol val
123
+ respond_to?(val) ? send(val) : val
119
124
  end
120
125
  end
@@ -44,7 +44,7 @@ format :html do
44
44
 
45
45
  def dropdown_toggle_link
46
46
  link_to(render_title, href: "#", class: "nav-link dropdown-toggle",
47
- "data-toggle": "dropdown")
47
+ "data-bs-toggle": "dropdown")
48
48
  end
49
49
 
50
50
  def dropdown_menu
data/set/all/overlay.rb CHANGED
@@ -1,11 +1,11 @@
1
1
  format :html do
2
2
  OVERLAY_CLOSE_OPTS = { class: "_close-overlay btn-sm",
3
- "data-dismiss": "overlay",
3
+ "data-bs-dismiss": "overlay",
4
4
  type: "button" }.freeze
5
5
 
6
6
  wrapper :overlay do |opts|
7
7
  class_up "card-slot", "_overlay d0-card-overlay bg-body", :single_use
8
- @content_body = true
8
+ @set_keys = true
9
9
  voo.hide! :menu
10
10
  overlay_frame true, overlay_header(opts[:title]), opts[:slot] do
11
11
  interior
@@ -21,7 +21,7 @@ format :html do
21
21
  end
22
22
 
23
23
  view :overlay_menu do
24
- wrap_with :div, class: "btn-group btn-group-sm align-self-start ml-auto" do
24
+ wrap_with :div, class: "btn-group btn-group-sm align-self-start ms-auto" do
25
25
  [render_overlay_help_link, slotify_overlay_link, close_overlay_link]
26
26
  end
27
27
  end
@@ -48,7 +48,7 @@ format :html do
48
48
  end
49
49
 
50
50
  def close_overlay_link
51
- overlay_menu_link :close, path: "#", "data-dismiss": "overlay"
51
+ overlay_menu_link :close, path: "#", "data-bs-dismiss": "overlay"
52
52
  end
53
53
 
54
54
  def overlay_close_button link_text="Close", opts={}
@@ -68,7 +68,7 @@ format :html do
68
68
  end
69
69
 
70
70
  def overlay_menu_link icon, args={}
71
- add_class args, "border-light text-dark p-1 ml-1"
71
+ add_class args, "border-light text-dark p-1 ms-1"
72
72
  button_link fa_icon(icon, class: "fa-lg"), args.merge(btn_type: "outline-secondary")
73
73
  end
74
74
 
@@ -56,7 +56,7 @@ format :html do
56
56
  end
57
57
 
58
58
  def layout_name_from_rule
59
- card.rule_card(:layout)&.try :item_name
59
+ card.rule_card(:layout)&.try :first_name
60
60
  end
61
61
 
62
62
  def render_outside_of_layout view, args
@@ -1,4 +1,4 @@
1
- .pointer-checkbox
1
+ .pointer-checkbox.dropdown-item
2
2
  = check_box_tag "pointer_checkbox-#{unique_id}", option_name, checked,
3
- id: id, class: "pointer-checkbox-button _submit-on-change"
3
+ id: id, class: "pointer-checkbox-button _submit-on-change me-2"
4
4
  = link_to_card option_name
@@ -1,5 +1,7 @@
1
1
  include_set Abstract::AccountDropdown
2
2
 
3
+ assign_type :session
4
+
3
5
  def ok_to_read
4
6
  true
5
7
  end
@@ -0,0 +1 @@
1
+ assign_type :pointer
@@ -5,6 +5,8 @@ def ok_to_read
5
5
  end
6
6
 
7
7
  format :html do
8
+ delegate :signed_in?, to: Card::Auth
9
+
8
10
  view :core, cache: :never do
9
11
  status_class = Auth.signed_in? ? "logged-in" : "logged-out"
10
12
  wrap_with :div, id: "logging", class: status_class do
@@ -14,47 +16,45 @@ format :html do
14
16
 
15
17
  def navbar_items
16
18
  # removed invite for now
17
- links =
18
- %i[my_card sign_out sign_up sign_in].map do |link_view|
19
- render link_view
20
- end.compact
19
+ navbar_item_views.map do |link_view|
20
+ rendered = render link_view
21
+ wrap_with_nav_item rendered if rendered
22
+ end.compact
23
+ end
21
24
 
22
- links.map do |link|
23
- wrap_with_nav_item link
24
- end
25
+ def navbar_item_views
26
+ %i[my_card sign_out sign_up sign_in]
25
27
  end
26
28
 
27
- def self.link_options opts={}, &block
28
- options = { denial: :blank, cache: :never }.merge opts
29
- options[:perms] = block if block_given?
30
- options.clone
29
+ def self.link_options perms
30
+ { denial: :blank, cache: :never, perms: perms }
31
31
  end
32
32
 
33
- view :sign_up, link_options(&:show_signup_link?) do
33
+ view :sign_up, link_options(:show_signup_link?) do
34
34
  link_to_card :signup, account_link_text(:sign_up),
35
35
  class: nav_link_class("signup-link"),
36
36
  path: { action: :new, mark: :signup }
37
37
  end
38
38
 
39
- view(:sign_in, link_options { !Auth.signed_in? }) do
39
+ view :sign_in, link_options(:not_signed_in?) do
40
40
  link_to_card :signin, account_link_text(:sign_in),
41
41
  class: nav_link_class("signin-link")
42
42
  end
43
43
 
44
- view(:sign_out, link_options { Auth.signed_in? }) do
44
+ view :sign_out, link_options(:signed_in?) do
45
45
  link_to_card :signin, account_link_text(:sign_out),
46
46
  class: nav_link_class("signout-link"),
47
47
  path: { action: :delete }
48
48
  end
49
49
 
50
- view :invite, link_options(&:show_invite_link?) do
50
+ view :invite, link_options(:show_invite_link?) do
51
51
  link_to_card :signup, account_link_text(:invite),
52
52
  class: nav_link_class("invite-link"),
53
53
  path: { action: :new, mark: :signup }
54
54
  end
55
55
 
56
- view(:my_card, link_options { Auth.signed_in? }) do
57
- can_disable_roles? ? interactive_roles_dropdown : simple_roles_dropdown
56
+ view :my_card, link_options(:signed_in?) do
57
+ can_disable_roles? ? interactive_roles_dropdown : account_dropdown
58
58
  end
59
59
 
60
60
  def interactive_roles_dropdown
@@ -62,10 +62,6 @@ format :html do
62
62
  view: :edit_inline, hide: %i[edit_inline_buttons name_formgroup]
63
63
  end
64
64
 
65
- def simple_roles_dropdown
66
- account_dropdown(&method(:link_to_card))
67
- end
68
-
69
65
  def enabled_roles_card
70
66
  Auth.current.fetch :enabled_roles, new: { type_id: SessionID }
71
67
  end
@@ -87,8 +83,12 @@ format :html do
87
83
  "nav-link #{classy(type)}"
88
84
  end
89
85
 
86
+ def not_signed_in?
87
+ !Auth.signed_in?
88
+ end
89
+
90
90
  def show_signup_link?
91
- !Auth.signed_in? && Card.new(type_id: SignupID).ok?(:create)
91
+ not_signed_in? && Card.new(type: :signup).ok?(:create)
92
92
  end
93
93
 
94
94
  def show_invite_link?
@@ -1,3 +1,5 @@
1
+ # DEPRECATED!
2
+
1
3
  format :html do
2
4
  view :nav_item do
3
5
  wrap_with :div, "", class: "dropdown-divider"
@@ -0,0 +1,3 @@
1
+ def item_names _args={}
2
+ Card.search(type: :layout) + Card::Layout.built_in_layouts
3
+ end
data/set/type/html.rb CHANGED
@@ -7,8 +7,4 @@ format :html do
7
7
  end.join "\n"
8
8
  end
9
9
  end
10
-
11
- def item_links _args={}
12
- raw(render_core).split(/[,\n]/)
13
- end
14
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-layout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.2
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ethan McCutchen
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-01-08 00:00:00.000000000 Z
13
+ date: 2023-01-04 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,42 +18,56 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.104.2
21
+ version: 1.105.0
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - '='
27
27
  - !ruby/object:Gem::Version
28
- version: 1.104.2
28
+ version: 1.105.0
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-account
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.14.2
35
+ version: 0.15.0
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 0.14.2
42
+ version: 0.15.0
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: card-mod-session
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - '='
48
48
  - !ruby/object:Gem::Version
49
- version: 0.14.2
49
+ version: 0.15.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - '='
55
55
  - !ruby/object:Gem::Version
56
- version: 0.14.2
56
+ version: 0.15.0
57
+ - !ruby/object:Gem::Dependency
58
+ name: card-mod-tabs
59
+ requirement: !ruby/object:Gem::Requirement
60
+ requirements:
61
+ - - '='
62
+ - !ruby/object:Gem::Version
63
+ version: 0.15.0
64
+ type: :runtime
65
+ prerelease: false
66
+ version_requirements: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - '='
69
+ - !ruby/object:Gem::Version
70
+ version: 0.15.0
57
71
  description: ''
58
72
  email:
59
73
  - info@decko.org
@@ -61,6 +75,15 @@ executables: []
61
75
  extensions: []
62
76
  extra_rdoc_files: []
63
77
  files:
78
+ - assets/script/layout.js.coffee
79
+ - assets/script/modal.js.coffee
80
+ - assets/script/overlay.js.coffee
81
+ - assets/style/layout.scss
82
+ - assets/style/modal.scss
83
+ - assets/style/overlay.scss
84
+ - data/files/mod_layout_script_asset_output/file.js
85
+ - data/real.yml
86
+ - data/test.yml
64
87
  - lib/card/layout.rb
65
88
  - lib/card/layout/card_layout.rb
66
89
  - lib/card/layout/code_layout.rb
@@ -70,7 +93,7 @@ files:
70
93
  - locales/en.yml
71
94
  - set/abstract/account_dropdown.rb
72
95
  - set/abstract/items.rb
73
- - set/abstract/pointer.rb
96
+ - set/abstract/list.rb
74
97
  - set/all/alert.rb
75
98
  - set/all/layouts.rb
76
99
  - set/all/modal.rb
@@ -79,17 +102,17 @@ files:
79
102
  - set/all/overlay.rb
80
103
  - set/all/overlay/overlay_header.haml
81
104
  - set/all/process_layout.rb
82
- - set/all/tabs.rb
83
105
  - set/right/enabled_roles.rb
84
106
  - set/right/enabled_roles/role_checkbox.haml
85
107
  - set/right/head.rb
108
+ - set/right/layout.rb
86
109
  - set/self/account_links.rb
87
110
  - set/self/alerts.rb
88
111
  - set/self/dropdown_divider.rb
89
112
  - set/self/foot.rb
90
113
  - set/self/head.rb
91
114
  - set/self/layout.rb
92
- - set/self/navbox.rb
115
+ - set/self/layout_options.rb
93
116
  - set/self/sidebar.rb
94
117
  - set/type/html.rb
95
118
  - set/type/layout_type.rb
@@ -103,6 +126,7 @@ metadata:
103
126
  wiki_uri: https://decko.org
104
127
  documentation_url: http://docs.decko.org/
105
128
  card-mod: layout
129
+ card-mod-group: gem-defaults
106
130
  post_install_message:
107
131
  rdoc_options: []
108
132
  require_paths:
@@ -118,7 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
118
142
  - !ruby/object:Gem::Version
119
143
  version: '0'
120
144
  requirements: []
121
- rubygems_version: 3.2.15
145
+ rubygems_version: 3.3.11
122
146
  signing_key:
123
147
  specification_version: 4
124
148
  summary: decko layouts
data/set/all/tabs.rb DELETED
@@ -1,52 +0,0 @@
1
- format :html do
2
- view :tabs do
3
- construct_tabs "tabs"
4
- end
5
-
6
- def construct_tabs tab_type
7
- tabs = { active: {}, paths: {} }
8
- voo.items[:view] ||= :content
9
- card.each_item_name_with_options(_render_raw) do |name, options|
10
- construct_tab tabs, name, options
11
- end
12
- tabs tabs[:paths], tabs[:active][:name], tab_type: tab_type, load: :lazy do
13
- tabs[:active][:content]
14
- end
15
- end
16
-
17
- def construct_tab tabs, name, explicit_options
18
- tab_options = item_view_options explicit_options
19
- tabs[:paths][name] = {
20
- title: nest(name, view: :title, title: tab_options[:title]),
21
- path: nest_path(name, tab_options).html_safe
22
- }
23
- return unless tabs[:active].empty?
24
-
25
- tabs[:active] = { name: name, content: nest(name, tab_options) }
26
- end
27
-
28
- # def tab_title title, name
29
- # return name unless title
30
- # name.to_name.title title, @context_names
31
- # end
32
-
33
- view :pills do
34
- construct_tabs "pills"
35
- end
36
-
37
- view :tabs_static do
38
- construct_static_tabs "tabs"
39
- end
40
-
41
- view :pills_static do
42
- construct_static_tabs "pills"
43
- end
44
-
45
- def construct_static_tabs tab_type
46
- tabs = {}
47
- card.item_cards.each do |item|
48
- tabs[item.name] = nest item, item_view_options(args)
49
- end
50
- tabs tabs, nil, tab_type: tab_type
51
- end
52
- end
data/set/self/navbox.rb DELETED
@@ -1,33 +0,0 @@
1
- format :html do
2
- view :navbox, cache: :never do
3
- select_tag "query[keyword]", "", class: "_navbox navbox form-control w-100",
4
- placeholder: navbar_placeholder
5
- end
6
-
7
- view :navbar do
8
- # FIXME: not bootstrap class here.
9
- class_up "navbox-form", "form-inline"
10
- render_core
11
- end
12
-
13
- view :core do
14
- form_tag path(mark: :search), method: "get", role: "search",
15
- class: classy("navbox-form", "nodblclick") do
16
- wrap_with :div, class: "form-group w-100" do
17
- render_navbox
18
- end
19
- end
20
- end
21
-
22
- # def initial_options
23
- # return "" unless (keyword = params.dig :query, :keyword)
24
- # options_for_select [keyword]
25
- # end
26
-
27
- # TODO: the more natural placeholder would be the content of the navbox card, no?
28
- # Also, the forced division of "raw" and "core" should probably be replaced
29
- # with a single haml template (for core view)
30
- def navbar_placeholder
31
- @placeholder ||= Card[:navbox, "*placeholder"]&.content || "Search"
32
- end
33
- end