card-mod-bar_and_box 0.16.0 → 0.18.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: 045d48b15ab21786a41caf92d84a18c62112aafb66524d5a9f58d157759bd847
4
- data.tar.gz: 3c673705d9a60869fa6b303f38a576990cb7f1b72b2c147e2ea3650a5abca3e3
3
+ metadata.gz: 190d7d4831a2ae497659729cec7e0e2d6b75cde8160b3313474452b5d6ea9c5a
4
+ data.tar.gz: c5f650e79126ad7b072c2ebdba5450212cd9432444605950c31e7b7c9984e234
5
5
  SHA512:
6
- metadata.gz: 8310e4f931acdc9aaa70ac8d01c91f416be60282a70cb3e4a35ad84a68da4aab537f77b8fb98846932a7f882a98731a07a3f5953837822cd57c111103e01f9ef
7
- data.tar.gz: 505d58da24346ff16d17ce09e6378d4d5bbcab4073124c955fd3f6fd34e03c70300579253f1b1b60f17f2e30457fa88a9983a2428ce5e739fbda91019f86c73b
6
+ metadata.gz: 1472daa4fff82f6660d17995383f6861b294b912464ec1aaec8f0f4cd384405ae4e3b1fdfb489b50bb0953bd78835ea63d364283de0d83b2a6731f1a9b14afca
7
+ data.tar.gz: bef94ea876185503f22cff962615dd308f8193f88881c30a5da6c4b8ad3844f931bacc0ca60281922e431306b424d7d265a5ead97ce7bfd95e39efbb8d68db90
@@ -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,12 +1,13 @@
1
1
  # TODO: move to list mod when possible
2
2
  # (currently not because list mod comes before jquery)
3
3
 
4
- $("body").on "click", "._click-multiselect-editor ._select-item", (event) ->
5
- $(this).closest("._select-item").toggleClass("selected")
6
- event.stopPropagation()
4
+ $(window).ready ->
5
+ $("body").on "click", "._click-multiselect-editor ._select-item", (event) ->
6
+ $(this).closest("._select-item").toggleClass("selected")
7
+ event.stopPropagation()
7
8
 
8
- $("body").on "click", "._click-select-editor ._select-item", (event) ->
9
- selectEditor = $(this).closest("._click-select-editor")
10
- selectEditor.find(".selected").removeClass("selected")
11
- $(this).closest("._select-item").addClass("selected")
12
- event.stopPropagation()
9
+ $("body").on "click", "._click-select-editor ._select-item", (event) ->
10
+ selectEditor = $(this).closest("._click-select-editor")
11
+ selectEditor.find(".selected").removeClass("selected")
12
+ $(this).closest("._select-item").addClass("selected")
13
+ event.stopPropagation()
@@ -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 ADDED
@@ -0,0 +1,7 @@
1
+ views:
2
+ - box
3
+ - bar
4
+ - mini_bar
5
+ - closed
6
+ - open
7
+ - one_line_content
@@ -1,4 +1,4 @@
1
1
  // bar_and_box.js.coffee
2
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);
3
3
  // click_select.js.coffee
4
- (function(){$("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);
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,26 +35,28 @@ 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
45
52
  class_up "accordion-item", "bar #{classy 'bar'}"
46
- accordion_item render_bar_body,
47
- subheader: render_menu,
48
- body: render_bar_bottom,
49
- open: open,
50
- context: :accordion_bar
53
+ wrap do
54
+ accordion_item render_bar_body,
55
+ subheader: render_menu,
56
+ body: bar_bottom(open: open),
57
+ open: open,
58
+ context: :closed
59
+ end
51
60
  end
52
61
 
53
62
  def build_bar
@@ -84,4 +93,18 @@ format :html do
84
93
  def bar_wrap_data
85
94
  full_page_card == card ? wrap_data : full_page_card.format.wrap_data
86
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
87
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.16.0
4
+ version: 0.18.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: 2023-11-18 00:00:00.000000000 Z
13
+ date: 2024-10-31 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.106.0
21
+ version: 1.108.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.106.0
28
+ version: 1.108.0
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.16.0
35
+ version: 0.18.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.16.0
42
+ version: 0.18.0
43
43
  description: ''
44
44
  email:
45
45
  - info@decko.org
@@ -54,6 +54,7 @@ files:
54
54
  - assets/style/bar.scss
55
55
  - assets/style/box.scss
56
56
  - assets/style/image_box.scss
57
+ - config/admin.yml
57
58
  - data/files/mod_bar_and_box_script_asset_output/file.js
58
59
  - set/abstract/media.rb
59
60
  - set/abstract/media/media_snippet.haml
@@ -66,7 +67,7 @@ files:
66
67
  - set/type/image.rb
67
68
  homepage: https://decko.org
68
69
  licenses:
69
- - GPL-3.0
70
+ - GPL-3.0-or-later
70
71
  metadata:
71
72
  source_code_uri: https://github.com/decko-commons/decko
72
73
  homepage_uri: https://decko.org
@@ -83,14 +84,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
83
84
  requirements:
84
85
  - - ">="
85
86
  - !ruby/object:Gem::Version
86
- version: '2.5'
87
+ version: '3.0'
87
88
  required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  requirements:
89
90
  - - ">="
90
91
  - !ruby/object:Gem::Version
91
92
  version: '0'
92
93
  requirements: []
93
- rubygems_version: 3.4.10
94
+ rubygems_version: 3.5.7
94
95
  signing_key:
95
96
  specification_version: 4
96
97
  summary: bar and box views