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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66c021626154a42a86fbd5227ac9e5af5ae42bb8a908c0a0a3683dd6d7cb6f47
|
4
|
+
data.tar.gz: 8f8df399ea649c9d498221eac54d5216970d826d4626e6c6d96d3c01af37279f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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
|
+
%>
|
data/lib/slash_admin/version.rb
CHANGED
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
|
+
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-
|
11
|
+
date: 2020-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|