slash_admin 1.4.1 → 1.5

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: 11e65af2390efad19838b6a296c332d2390f7db2cc19d5e7fb3b194a20764e02
4
- data.tar.gz: 6b8d9aeb8534270f7edf23f56a13d8284ed791d3fc08a85a5577adada253e075
3
+ metadata.gz: 66c021626154a42a86fbd5227ac9e5af5ae42bb8a908c0a0a3683dd6d7cb6f47
4
+ data.tar.gz: 8f8df399ea649c9d498221eac54d5216970d826d4626e6c6d96d3c01af37279f
5
5
  SHA512:
6
- metadata.gz: 3198056fa8a35ae1d9e0005d86b44ef6e382675b63073deeb7974862a73b100cdeadef0ab6cd0f8f7ccf150c11ea0a38e95a42c149f41626393ba318144f33cf
7
- data.tar.gz: e7e82ddba2244e1ca4c65d6f39cf8627793182bf36b709adae59f7b385364eeeeed4bee13d1fe2dade6b0edb295bdc1c03181921bae6c6449df84d42bc2da1f7
6
+ metadata.gz: 3a38afabe3fa6ebbf1178dea5f832a162d591ca9060202ed58d0c77dab48466ecffe666d4d8c130b61bf9421af862b89b50005ff6e710acc4038edd5816d66d6
7
+ data.tar.gz: 16cd83d5a57c4cfcc62b5d1a4e91993c2dba2fdffb3e1ea0d73f7dfe6f414a5f1108a332afaabd9ebe3d49ffb80f6a9a7553ca96e34aa4ca50187afe893fc5c1
@@ -1,11 +1,16 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
2
  <%= render 'slash_admin/shared/tooltip', a: a %>
3
3
  <%= f.collection_select a.to_s + '_id',
4
- class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id, object_label(class_name_from_association(f.object, a)),
5
- {
6
- include_blank: true,
7
- },
8
- 'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
9
- 'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
10
- 'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
11
- class: 'form-control select2-model-single', required: required?(f.object, a).present? %>
4
+ class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id, object_label(class_name_from_association(f.object, a)),
5
+ {
6
+ include_blank: true,
7
+ },
8
+ {
9
+ 'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
10
+ 'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
11
+ 'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
12
+ class: 'form-control select2-model-single',
13
+ required: required?(f.object, a).present?,
14
+ selected: f.object.send(a).present? ? f.object.send(a).try(:id) : nil,
15
+ }
16
+ %>
@@ -1,11 +1,13 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
2
  <%= render 'slash_admin/shared/tooltip', a: a %>
3
3
  <%= f.select a.to_s,
4
- class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20).collect { |assoc| [assoc.send(object_label(class_name_from_association(f.object, a))), assoc.id] },
5
- {
6
- include_blank: true,
7
- },
8
- 'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
9
- 'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
10
- 'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
11
- class: 'form-control select2-model-single', required: required?(f.object, a).present? %>
4
+ options_for_select(class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id = #{f.object.send(a).try(:id)} THEN 1 ELSE 0 END DESC" : "id DESC").limit(20).collect { |assoc| [assoc.send(object_label(class_name_from_association(f.object, a))), assoc.id] }, f.object.send(a).present? ? f.object.send(a).try(:id) : nil),
5
+ {
6
+ include_blank: true,
7
+ },
8
+ 'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
9
+ 'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
10
+ 'data-fields': "SlashAdmin::Models::#{class_name_from_association(f.object, a).classify.pluralize}Controller".constantize.new.autocomplete_params.join(' '),
11
+ class: 'form-control select2-model-single',
12
+ required: required?(f.object, a).present?
13
+ %>
@@ -1,3 +1,3 @@
1
1
  module SlashAdmin
2
- VERSION = "1.4.1"
2
+ VERSION = "1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: slash_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: '1.5'
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOVACS Nicolas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-19 00:00:00.000000000 Z
11
+ date: 2020-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails