admin_it 1.2.2 → 1.2.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 +4 -4
- data/lib/admin_it/context/context.rb +1 -1
- data/lib/admin_it/field/field.rb +1 -1
- data/lib/admin_it/helpers/table.rb +12 -2
- data/lib/admin_it/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6ec3eb78a87d91d7b2dba8f2c4113960ae39b73e
|
|
4
|
+
data.tar.gz: f4f6e92081571574f4b8a919747a7fe98369a603
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 19616ee61e99a9291bd57b5f581687eefc43b8ff560614c3b9a3de1d013ba1fc1891f3d5d89655d60ede36e14df612b752aba6574703c3282dc1e8a130c7cbf8
|
|
7
|
+
data.tar.gz: 3238518aff17e67ddc0d1c65220ec89d23ce943149428680c1a10e5ce5c7851d6c5a107167fa638d6d27b5bfb9086f7a0ed413a0654e453767eebadc321a383b
|
|
@@ -159,7 +159,7 @@ module AdminIt
|
|
|
159
159
|
when :sortable then values.select { |f| f.sortable? }
|
|
160
160
|
when :with_labels then values.select { |f| f.show_label? }
|
|
161
161
|
when :without_labels then values.select { |f| !f.show_label? }
|
|
162
|
-
when Field::TYPES then values.select { |f| f.type == scope }
|
|
162
|
+
when *Field::TYPES then values.select { |f| f.type == scope }
|
|
163
163
|
else values
|
|
164
164
|
end
|
|
165
165
|
end
|
data/lib/admin_it/field/field.rb
CHANGED
|
@@ -268,7 +268,7 @@ module AdminIt
|
|
|
268
268
|
when :sortable then values.select { |f| f.sortable? }
|
|
269
269
|
when :with_labels then values.select { |f| f.show_label? }
|
|
270
270
|
when :without_labels then values.select { |f| !f.show_label? }
|
|
271
|
-
when Field::TYPES then values.select { |f| f.type == scope }
|
|
271
|
+
when *Field::TYPES then values.select { |f| f.type == scope }
|
|
272
272
|
else values
|
|
273
273
|
end
|
|
274
274
|
end
|
|
@@ -27,6 +27,15 @@ module AdminIt
|
|
|
27
27
|
entity = context.entity
|
|
28
28
|
resource = parent.parent.resource
|
|
29
29
|
single = resource.singles.select { |c| !(c <= NewContext) }
|
|
30
|
+
|
|
31
|
+
p_context = context.child? ? context.parent : context
|
|
32
|
+
params = {}
|
|
33
|
+
params[:section] = p_context.section if p_context.respond_to?(:section)
|
|
34
|
+
if context.child?
|
|
35
|
+
params[:layout] = :dialog
|
|
36
|
+
params[:parent] = context.parent
|
|
37
|
+
end
|
|
38
|
+
|
|
30
39
|
buttons = single.map do |_context|
|
|
31
40
|
if _context <= ShowContext && context.show_in_dialog?
|
|
32
41
|
'<a class="btn btn-xs btn-info" ' +
|
|
@@ -35,8 +44,9 @@ module AdminIt
|
|
|
35
44
|
%Q(<i class="fa fa-#{_context.icon}"></i></a>)
|
|
36
45
|
else
|
|
37
46
|
cl = _context <= ShowContext ? 'info' : 'default'
|
|
38
|
-
href = _context.
|
|
39
|
-
|
|
47
|
+
href = _context.url(entity, **params)
|
|
48
|
+
data = context.child? ? %Q(data-toggle="modal" data-target="#confirm_modal") : ''
|
|
49
|
+
"<a class=\"btn btn-xs btn-#{cl}\" href=\"#{href}\"#{data}>" \
|
|
40
50
|
"<i class=\"fa fa-#{_context.icon}\"></i></a>"
|
|
41
51
|
end
|
|
42
52
|
end
|
data/lib/admin_it/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: admin_it
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexey Ovchinnikov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-06-
|
|
11
|
+
date: 2014-06-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|