card-mod-bar_and_box 0.17.0 → 0.18.1

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: 636fadbb9bbe3602992ed6066c6fcab12d57edf178bac8c460b159f3a7abdb3d
4
- data.tar.gz: f651af530fb42581530e5fcee9071ad75e3f3f18521b24c2cd6dfbbca1d1d252
3
+ metadata.gz: 9061f51aff47bab5b93fa42c029d676283a5d2dcfae7aa903b1ac2cd18d7c5a9
4
+ data.tar.gz: 7d318eef6b4c1a4460a18f8c294930e9238b4431e1515871d515b4e6570a2717
5
5
  SHA512:
6
- metadata.gz: cf405d9341c1bf03478acbd6bfb62d9f509bf9c1e6ed7bb7df8a0cb71a9155f763624179626b5720a8245c2e55396754487d0ec380e59821c5c4799b91252c46
7
- data.tar.gz: bfc0790319ccb91fdd96c7ee2eedf07580cd560ad4d950aff86fa447413dea678af1390301482cdd2c0069fe5e46bb2470450cb7d466f5c6df4bb68cf33ec258
6
+ metadata.gz: ff529c26b006992e7509be97fbe8ec4db1ce09a5ff04afde11cc8fe12a0dc036be8bb3043e70de53b91bc93aa4100dfaef065454364de9d237502df73b756c5f
7
+ data.tar.gz: 75bc73dfdb936c257bea2a43ab2e5b5c4d71aec186679fc80e3fc7f62aa761c1d3f5181ed48e75ba5034c4e05a7052a07c3944b8456474db6c537161210fe096
@@ -1,4 +1,4 @@
1
- $(window).ready ->
1
+ $ ->
2
2
  # $("body").on "click", ".bar-menu", (e) ->
3
3
  # e.stopImmediatePropagation()
4
4
 
@@ -13,6 +13,11 @@ $(window).ready ->
13
13
  else
14
14
  window.location = cardLinkPath(cl)
15
15
 
16
+ $("body").on "shown.bs.collapse", ".bar > .collapse", (_event) ->
17
+ s = $(this).find "> .d0-card-body > .card-slot-stub"
18
+ s.slotReload s.data("stubUrl")
19
+ s.removeClass "card-slot-stub"
20
+
16
21
  openInNewTab = (event) -> event.metaKey
17
22
  cardLinkPath = (cl) -> decko.path(cl.data("cardLinkUrl") || cl.data("cardLinkName"))
18
23
 
@@ -1,4 +1,7 @@
1
1
  $bar_stripe_color: $dark !default;
2
+ $bar-body-hover-color: rgba($gray-100, 0.5) !default;
3
+ $bar-transition: $accordion-transition !default;
4
+
2
5
 
3
6
  ._card-link {
4
7
  cursor: pointer;
@@ -6,13 +9,16 @@ $bar_stripe_color: $dark !default;
6
9
 
7
10
  .bar {
8
11
  border: 1px solid $border-color;
9
- &:hover {
12
+ > .bar-body, > .bar-menu, > .accordion-header > .accordion-button {
13
+ @include transition($bar-transition);
14
+ }
15
+ &:hover:not(.no-bar-hover) {
10
16
  cursor: pointer;
11
- > .bar-body, > .bar-menu, > .accordion-header >.accordion-button {
12
- background-color: $gray-200;
17
+ > .bar-body, > .bar-menu, > .accordion-header > .accordion-button {
18
+ background-color: $bar-body-hover-color;
13
19
  }
14
20
  }
15
- &.accordion-item {
21
+ &.accordion-item > .accordion-header {
16
22
  .bar-left, .bar-right {
17
23
  padding: 0;
18
24
  }
@@ -8,7 +8,6 @@ $box_stripe_color: $secondary !default;
8
8
  cursor: pointer
9
9
  }
10
10
  border-top: 3px solid $box_stripe_color;
11
- width: 320px;
12
11
  }
13
12
 
14
13
  .box-top {
@@ -55,12 +54,19 @@ $box_stripe_color: $secondary !default;
55
54
  .card-list-box {
56
55
  display: flex;
57
56
  flex-wrap: wrap;
58
- justify-content: center;
57
+ justify-content: space-around;
59
58
  }
60
59
 
61
60
  // wrapper around box in list context
62
61
  .item-box {
63
- display: inline-block;
64
- padding: 10px 1%;
62
+ display: flex;
63
+ padding: 1rem 0;
65
64
  vertical-align: top;
66
- }
65
+ justify-content: center;
66
+ }
67
+
68
+ .box, .item-box {
69
+ min-width: 320px;
70
+ max-width: 400px;
71
+ width: 100%
72
+ }
data/config/admin.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  views:
2
2
  - box
3
3
  - bar
4
- - expanded_bar
5
- - one_line_content
6
4
  - mini_bar
7
5
  - closed
8
6
  - open
7
+ - one_line_content
@@ -1,4 +1,4 @@
1
1
  // bar_and_box.js.coffee
2
- (function(){var n,a;$(window).ready(function(){return $(document).on("click","._card-link",function(i){var r;return"on"===(r=$(this)).data("skip")?r.data("skip",null):a(i)?window.open(n(r),"_tab_"+Math.floor(1e3*Math.random())):r.closest("._card-link-modal")[0]?r.find("._modal-page-link").trigger("click"):window.location=n(r)})}),a=function(n){return n.metaKey},n=function(n){return decko.path(n.data("cardLinkUrl")||n.data("cardLinkName"))},decko.slot.ready(function(n){return n.find("._card-link a, ._card-link ._card-link-clickable").on("click",function(n){var a;return(a=$(this)).hasClass("_over-card-link")||a.closest("._over-card-link")[0]?a.closest("._card-link").data("skip","on"):n.preventDefault()})})}).call(this);
2
+ (function(){var a,n;$(function(){return $(document).on("click","._card-link",function(t){var r;return"on"===(r=$(this)).data("skip")?r.data("skip",null):n(t)?window.open(a(r),"_tab_"+Math.floor(1e3*Math.random())):r.closest("._card-link-modal")[0]?r.find("._modal-page-link").trigger("click"):window.location=a(r)}),$("body").on("shown.bs.collapse",".bar > .collapse",function(){var a;return(a=$(this).find("> .d0-card-body > .card-slot-stub")).slotReload(a.data("stubUrl")),a.removeClass("card-slot-stub")})}),n=function(a){return a.metaKey},a=function(a){return decko.path(a.data("cardLinkUrl")||a.data("cardLinkName"))},decko.slot.ready(function(a){return a.find("._card-link a, ._card-link ._card-link-clickable").on("click",function(a){var n;return(n=$(this)).hasClass("_over-card-link")||n.closest("._over-card-link")[0]?n.closest("._card-link").data("skip","on"):a.preventDefault()})})}).call(this);
3
3
  // click_select.js.coffee
4
4
  (function(){$(window).ready(function(){return $("body").on("click","._click-multiselect-editor ._select-item",function(e){return $(this).closest("._select-item").toggleClass("selected"),e.stopPropagation()}),$("body").on("click","._click-select-editor ._select-item",function(e){return $(this).closest("._click-select-editor").find(".selected").removeClass("selected"),$(this).closest("._select-item").addClass("selected"),e.stopPropagation()})})}).call(this);
data/set/all/bar.rb CHANGED
@@ -5,17 +5,24 @@ format :html do
5
5
  bar_cols 9, 3
6
6
  mini_bar_cols 9, 3
7
7
 
8
- view :bar, unknown: :mini_bar do
8
+ # drops bar-middle in small viewports
9
+ view :bar, unknown: :mini_bar, cache: :yes do
9
10
  cols = bar_cols.size == 3 ? [mini_bar_cols, bar_cols] : [bar_cols]
10
11
  prepare_bar(*cols)
11
12
  build_bar
12
13
  end
13
14
 
14
- view :mini_bar, unknown: true do
15
+ view :mini_bar, cache: :yes, unknown: true do
15
16
  prepare_bar mini_bar_cols
16
17
  build_bar
17
18
  end
18
19
 
20
+ view :full_bar, unknown: :mini_bar, cache: :yes do
21
+ class_up "bar", full_page_card.safe_set_keys
22
+ class_up_cols %w[bar-left bar-middle bar-right], bar_cols
23
+ build_bar
24
+ end
25
+
19
26
  view(:bar_left, unknown: true) { render_title }
20
27
  view(:bar_middle, unknown: :blank) { "" }
21
28
  view(:bar_right, unknown: :blank) { "" }
@@ -28,17 +35,17 @@ format :html do
28
35
  view :bar_menu, unknown: true, template: :haml
29
36
  view :bar_body, unknown: true, template: :haml
30
37
 
31
- view :accordion_bar, unknown: :mini_bar do
38
+ view :closed, unknown: :mini_bar, cache: :yes do
32
39
  build_accordion_bar
33
40
  end
34
- view :closed_bar, :accordion_bar
35
- view :closed, :accordion_bar
41
+ view :closed_bar, :closed
42
+ view :accordion_bar, :closed
36
43
 
37
- view :open_bar do
44
+ view :open, cache: :yes do
38
45
  build_accordion_bar open: true
39
46
  end
40
- view :expanded_bar, :open_bar
41
- view :open, :open_bar
47
+ view :open_bar, :open
48
+ view :expanded_bar, :open
42
49
 
43
50
  def build_accordion_bar open: false
44
51
  prepare_bar mini_bar_cols
@@ -46,9 +53,9 @@ format :html do
46
53
  wrap do
47
54
  accordion_item render_bar_body,
48
55
  subheader: render_menu,
49
- body: render_bar_bottom,
56
+ body: bar_bottom(open: open),
50
57
  open: open,
51
- context: :accordion_bar
58
+ context: :closed
52
59
  end
53
60
  end
54
61
 
@@ -86,4 +93,18 @@ format :html do
86
93
  def bar_wrap_data
87
94
  full_page_card == card ? wrap_data : full_page_card.format.wrap_data
88
95
  end
96
+
97
+ # TODO: make card_stubs work
98
+ def bar_bottom open: false
99
+ open ? render_bar_bottom : card_stub(view: :bar_bottom)
100
+ end
101
+
102
+ # TODO: move to a more general accessible place (or its own abstract module)
103
+ def card_stub path_args
104
+ wrap_with :div,
105
+ class: "card-slot card-slot-stub",
106
+ data: { "stub-url": path(path_args) } do
107
+ ""
108
+ end
109
+ end
89
110
  end
data/set/all/box.rb CHANGED
@@ -1,4 +1,4 @@
1
- view :box, template: :haml do
1
+ view :box, template: :haml, cache: :yes do
2
2
  voo.hide :menu
3
3
  end
4
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-bar_and_box
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.1
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: 2024-06-12 00:00:00.000000000 Z
13
+ date: 2024-11-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: card
@@ -18,28 +18,28 @@ dependencies:
18
18
  requirements:
19
19
  - - '='
20
20
  - !ruby/object:Gem::Version
21
- version: 1.107.0
21
+ version: 1.108.1
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.107.0
28
+ version: 1.108.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: card-mod-style
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 0.17.0
35
+ version: 0.18.1
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.17.0
42
+ version: 0.18.1
43
43
  description: ''
44
44
  email:
45
45
  - info@decko.org
@@ -67,7 +67,7 @@ files:
67
67
  - set/type/image.rb
68
68
  homepage: https://decko.org
69
69
  licenses:
70
- - GPL-3.0
70
+ - GPL-3.0-or-later
71
71
  metadata:
72
72
  source_code_uri: https://github.com/decko-commons/decko
73
73
  homepage_uri: https://decko.org