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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e96e6d9fe0799703b334eb063cf44a1ee7498ae0
4
- data.tar.gz: 2d67207520e2cf2cdad5409a96711587b63abdb6
3
+ metadata.gz: 6ec3eb78a87d91d7b2dba8f2c4113960ae39b73e
4
+ data.tar.gz: f4f6e92081571574f4b8a919747a7fe98369a603
5
5
  SHA512:
6
- metadata.gz: ef9256ae9ff7ac5710c74fdbad74a401c72d1fa0c6b45942869cef6bf1e4fce353ca393ebe574d71cda077fa1525b75162869b57af8d5b8a37effb104aefa66b
7
- data.tar.gz: 9638a3aef76d5b3f5a24d1463c08f60049dfc2e17b5a3402c37d4d531073e82cc893badb83a1ca1cf168bc11a30bc9760a0e115ec658f570373460d965b9571f
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
@@ -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.path(entity)
39
- "<a class=\"btn btn-xs btn-#{cl}\" href=\"#{href}\">" \
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
@@ -1,5 +1,5 @@
1
1
  #
2
2
  module AdminIt
3
3
  # Current gem version
4
- VERSION = '1.2.2'
4
+ VERSION = '1.2.3'
5
5
  end
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.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-09 00:00:00.000000000 Z
11
+ date: 2014-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails