para 0.8.13 → 0.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 162c6a81b2f57ab3565758832cacec3a10442bd52a520870d73c56745098914b
4
- data.tar.gz: 73b84d05ccfd02ce566c90925edba4f4123cb5ed38cbc193e47c7e8dde5c2dee
3
+ metadata.gz: 4fdbe5ef6d030b3f6aca6f18209211742914f15de7965bc583190a4480921e0e
4
+ data.tar.gz: aa514928922edf16906fb54f40027a9afc208e5327c00e1fee34ac24c66bb748
5
5
  SHA512:
6
- metadata.gz: 3a23e25fab98168e0baeae6c5ef9623f580cb0a1ad4c2f6a7c7f78c2ed0f7ff0d35b5639c14e2deda65312f57f3fb9f6d2bf5e2dd1bd862d2e9a1db0a638b865
7
- data.tar.gz: 42acaacd0c3dfeeee9af36a334229d8c1d9a36762fea88a57cb3dd4725296906347f348bc8916c857524ac2bd1c64fa5d7eb133e46aa5c146925ac1d0deb7ddd
6
+ metadata.gz: 242dee3461cd57765d4f3b57e32073cb0a30a863e6bb59858891b621c989a36a1c189924bd78f237b25cc6890149816ab9a4f189b9d093465f7483664f525ac7
7
+ data.tar.gz: a15d5cdab40b3a00b46401b405bd007774bc119dceaf7d6f8423808a2673fafc2e5abf20961bf5176892e6ba670e88c61637d3d9d4a6f10a63ffae3b4f90b5f5
@@ -5,8 +5,10 @@ module Para
5
5
  #
6
6
  def admin_component_sections
7
7
  @admin_component_sections ||= begin
8
- Para::ComponentSection.ordered.includes(:components).tap do |sections|
9
- sections.flat_map(&:components).each(&method(:decorate))
8
+ sections = Para::ComponentSection.ordered.includes(:components, :parent_component)
9
+
10
+ sections.tap do |loaded_sections|
11
+ loaded_sections.flat_map(&:components).each(&method(:decorate))
10
12
  end
11
13
  end
12
14
  end
@@ -19,9 +19,13 @@ module Para
19
19
  attributes = model_field_mappings(model).fields
20
20
  relation = options.fetch(:relation, model.name.to_s.underscore.pluralize)
21
21
  allow_adding_resource = options.fetch(:addable, true)
22
+ force_list = options.fetch(:force_list, false)
22
23
 
23
- partial = :list
24
- partial = :tree if model.respond_to?(:roots) && can?(:tree, model)
24
+ partial = if !force_list && model.respond_to?(:roots) && can?(:tree, model)
25
+ :tree
26
+ else
27
+ :list
28
+ end
25
29
 
26
30
  render(
27
31
  partial: find_partial_for(relation, partial),
@@ -15,7 +15,7 @@
15
15
  %ul.component-section-list-items.collapse.in{ id: "collapse-section-#{index}" }
16
16
  - component_section.components.each do |component|
17
17
  - if can?(:manage, component) && show_component?(component)
18
- %li.component-item{ class: (@component == component) && 'active' }
18
+ %li.component-item{ class: (@component == component || @component.parent_component == component) && 'active' }
19
19
  = link_to component.main_navigation_name, component.path
20
20
 
21
21
  - else
@@ -1,3 +1,3 @@
1
1
  module Para
2
- VERSION = '0.8.13'
2
+ VERSION = '0.8.14'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: para
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.13
4
+ version: 0.8.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Valentin Ballestrino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-15 00:00:00.000000000 Z
11
+ date: 2020-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails