para 0.8.2.3 → 0.8.3
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
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 932450574c9f0ae3df18f694ec0e85292fae9c13e89bae9e0c4e3170acf31b5e
|
|
4
|
+
data.tar.gz: affb81684ce4e7f0fba86a8e6f31c31e40aa5a43bcb400a6cf6e0effd964a0d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ecb83cf77fa7d9ac72461a9537e936bc72c890a755a36f6ad4441235dfdf9c7c9bc561aa17fd3352920d177bbf8e00909498c3e3548c7814b7393369bd739052
|
|
7
|
+
data.tar.gz: 1728f4c124e70866df8eb0d83ede63a63c194eff93d3941361d62d7a43493b6126789187fc9de12f0523ad38c5af7239d3c734f17da515ce8eb5f2800952237c
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
%ul.component-section-list-items.collapse.in{ id: "collapse-section-#{index}" }
|
|
16
16
|
- component_section.components.each do |component|
|
|
17
|
-
- if can?
|
|
17
|
+
- if can?(:manage, component) && show_component?(component)
|
|
18
18
|
%li.component-item{ class: (@component == component) && 'active' }
|
|
19
19
|
= link_to component.name, component.path
|
|
20
20
|
|
|
@@ -47,6 +47,10 @@ module Para
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
+
def component_configuration_for(identifier)
|
|
51
|
+
sections.map(&:components).flatten.find { |c| c.identifier.to_s == identifier.to_s }
|
|
52
|
+
end
|
|
53
|
+
|
|
50
54
|
private
|
|
51
55
|
|
|
52
56
|
def build
|
|
@@ -145,12 +149,13 @@ module Para
|
|
|
145
149
|
end
|
|
146
150
|
|
|
147
151
|
class Component
|
|
148
|
-
attr_accessor :identifier, :type, :options, :model
|
|
152
|
+
attr_accessor :identifier, :type, :shown_if, :options, :model
|
|
149
153
|
|
|
150
|
-
def initialize(identifier, type_identifier,
|
|
154
|
+
def initialize(identifier, type_identifier, shown_if: nil, **options)
|
|
151
155
|
self.identifier = identifier.to_s
|
|
152
156
|
self.type = Para::Component.registered_components[type_identifier]
|
|
153
157
|
self.options = options
|
|
158
|
+
self.shown_if = shown_if
|
|
154
159
|
|
|
155
160
|
unless type
|
|
156
161
|
raise UndefinedComponentTypeError.new(
|
|
@@ -11,7 +11,7 @@ module Para
|
|
|
11
11
|
input_html_options[:class] << "multi-select"
|
|
12
12
|
|
|
13
13
|
# Load existing resources
|
|
14
|
-
resources = object.send(attribute_name)
|
|
14
|
+
resources = input_html_options[:value] || object.send(attribute_name)
|
|
15
15
|
# Order them if the list should be orderable
|
|
16
16
|
resources = resources.sort_by(&method(:resource_position)) if orderable?
|
|
17
17
|
|
data/lib/para/version.rb
CHANGED
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.
|
|
4
|
+
version: 0.8.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Valentin Ballestrino
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -849,8 +849,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
849
849
|
- !ruby/object:Gem::Version
|
|
850
850
|
version: '0'
|
|
851
851
|
requirements: []
|
|
852
|
-
|
|
853
|
-
rubygems_version: 2.6.11
|
|
852
|
+
rubygems_version: 3.0.3
|
|
854
853
|
signing_key:
|
|
855
854
|
specification_version: 4
|
|
856
855
|
summary: Rails admin engine
|