slash_admin 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/slash_admin/application.js +5 -4
- data/app/assets/stylesheets/slash_admin/application.scss +2 -2
- data/app/views/slash_admin/custom_fields/_select.html.erb +9 -3
- data/app/views/slash_admin/custom_fields/_timezone.html.erb +4 -1
- data/app/views/slash_admin/fields/_belongs_to.html.erb +1 -1
- data/app/views/slash_admin/fields/_has_one.html.erb +1 -1
- data/app/views/slash_admin/fields/_nested_belongs_to.html.erb +1 -1
- data/lib/slash_admin/version.rb +1 -1
- data/vendor/assets/javascripts/select2/i18n/en.js +3 -0
- data/vendor/assets/javascripts/select2/i18n/fr.js +3 -0
- data/vendor/assets/javascripts/{select2.min.js → select2/select2.min.js} +0 -0
- data/vendor/assets/stylesheets/{select2-bootstrap4.css → select2/select2-bootstrap4.css} +0 -0
- data/vendor/assets/stylesheets/{select2.min.css → select2/select2.min.css} +0 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60a62e71df7ce85dd3b7a4ec43387b2487e6b785173efe76bf68af86f9ebc0f3
|
4
|
+
data.tar.gz: '0280264757dfe91230cdf5b359b577fe1bfdaf0914bc255593e92da0e98595b4'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c02ac33b7adeeb9fb6dfe8b9986ff253b66fee5dc23674587eb27db2ff16c5997dfa2ac14e578f56e5d3b0a0410f56594a93b37be586be1aa0584ee40b3b1682
|
7
|
+
data.tar.gz: c4153fff71a6d0fe535ddeb0992feed99388a31a73b661de066139f32e75247998d4f21fcbfcf05ca222b57c181474bd7f32793f351f95dc42779841a43f0621
|
@@ -5,7 +5,9 @@
|
|
5
5
|
//= require jquery_ujs
|
6
6
|
//= require popper
|
7
7
|
//= require bootstrap
|
8
|
-
//= require select2.min
|
8
|
+
//= require select2/select2.min
|
9
|
+
//= require select2/i18n/fr
|
10
|
+
//= require select2/i18n/en
|
9
11
|
//= require moment
|
10
12
|
//= require moment/fr
|
11
13
|
//= require bootstrap-material-datetimepicker
|
@@ -205,12 +207,12 @@ function init() {
|
|
205
207
|
|
206
208
|
|
207
209
|
$(".select2-single, .select2-multiple").each (function() {
|
208
|
-
let initialPlaceholder = $(this).attr('placeholder');
|
210
|
+
let initialPlaceholder = $(this).attr('data-placeholder') || I18n.t('slash_admin.view.select');
|
211
|
+
|
209
212
|
$(this).select2({
|
210
213
|
placeholder: initialPlaceholder,
|
211
214
|
allowClear: true,
|
212
215
|
theme: 'bootstrap4',
|
213
|
-
debug: true,
|
214
216
|
}).on("select2:unselecting", function (e) {
|
215
217
|
$(this).data('state', 'unselected');
|
216
218
|
}).on("select2:open", function (e) {
|
@@ -232,7 +234,6 @@ function init() {
|
|
232
234
|
placeholder: initialPlaceholder,
|
233
235
|
allowClear: true,
|
234
236
|
theme: 'bootstrap4',
|
235
|
-
debug: true,
|
236
237
|
ajax: {
|
237
238
|
url: Routes.slash_admin_remote_select_path({
|
238
239
|
format: "json"
|
@@ -14,8 +14,8 @@
|
|
14
14
|
*= require toastr
|
15
15
|
*= require jquery.nestable
|
16
16
|
*= require sweetalert
|
17
|
-
*= require select2.min
|
18
|
-
*= require select2-bootstrap4
|
17
|
+
*= require select2/select2.min
|
18
|
+
*= require select2/select2-bootstrap4
|
19
19
|
*= require bootstrap-datepicker.min
|
20
20
|
*= require bootstrap-material-datetimepicker
|
21
21
|
*= require jquery.tagsinput-revisited.min
|
@@ -1,7 +1,13 @@
|
|
1
1
|
<%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
|
2
2
|
<%= render 'slash_admin/shared/tooltip', a: a %>
|
3
|
-
<% if a[a.keys.first][:multiple].present?
|
4
|
-
<%= f.select(a.keys.first, a[a.keys.first][:choices],
|
3
|
+
<% if a[a.keys.first][:multiple].present? %>
|
4
|
+
<%= f.select(a.keys.first, a[a.keys.first][:choices],
|
5
|
+
{ include_blank: a[a.keys.first][:include_blank], required: required?(f.object, a) },
|
6
|
+
'data-placeholder': t('slash_admin.view.select_model', model_name: @model_class.human_attribute_name(a.keys.first).singularize.downcase),
|
7
|
+
class: 'form-control select2-multiple', multiple: true) %>
|
5
8
|
<% else %>
|
6
|
-
<%= f.select(a.keys.first, a[a.keys.first][:choices],
|
9
|
+
<%= f.select(a.keys.first, a[a.keys.first][:choices],
|
10
|
+
{ include_blank: a[a.keys.first][:include_blank], required: required?(f.object, a) },
|
11
|
+
'data-placeholder': t('slash_admin.view.select_model', model_name: @model_class.human_attribute_name(a.keys.first).singularize.downcase),
|
12
|
+
class: 'form-control select2-single') %>
|
7
13
|
<% end %>
|
@@ -1,3 +1,6 @@
|
|
1
1
|
<%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
|
2
2
|
<%= render 'slash_admin/shared/tooltip', a: a %>
|
3
|
-
<%= f.select(a.keys.first, ActiveSupport::TimeZone::MAPPING.values,
|
3
|
+
<%= f.select(a.keys.first, ActiveSupport::TimeZone::MAPPING.values,
|
4
|
+
{ include_blank: true, required: required?(f.object, a) },
|
5
|
+
'data-placeholder': t('slash_admin.view.select_model', model_name: @model_class.human_attribute_name(a.keys.first).singularize.downcase),
|
6
|
+
class: 'form-control select2-single') %>
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= f.collection_select a.to_s + '_id',
|
4
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
5
|
{
|
6
|
-
|
6
|
+
include_blank: true,
|
7
7
|
},
|
8
8
|
'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
|
9
9
|
'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
|
@@ -3,7 +3,7 @@
|
|
3
3
|
<%= f.select a.to_s,
|
4
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
5
|
{
|
6
|
-
|
6
|
+
include_blank: true,
|
7
7
|
},
|
8
8
|
'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
|
9
9
|
'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= f.collection_select a.to_s + '_id',
|
5
5
|
class_name_from_association.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(a),
|
6
6
|
{
|
7
|
-
|
7
|
+
include_blank: true,
|
8
8
|
},
|
9
9
|
'data-placeholder': t('slash_admin.view.select_model', model_name: class_name_from_association.constantize.model_name.human.downcase),
|
10
10
|
'data-model': class_name_from_association.constantize.model_name.to_s.underscore,
|
data/lib/slash_admin/version.rb
CHANGED
@@ -0,0 +1,3 @@
|
|
1
|
+
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2
|
+
|
3
|
+
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var n=e.input.length-e.maximum,r="Please delete "+n+" character";return 1!=n&&(r+="s"),r},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var n="You can only select "+e.maximum+" item";return 1!=e.maximum&&(n+="s"),n},noResults:function(){return"No results found"},searching:function(){return"Searching…"},removeAllItems:function(){return"Remove all items"}}}),e.define,e.require}();
|
@@ -0,0 +1,3 @@
|
|
1
|
+
/*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */
|
2
|
+
|
3
|
+
!function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var n=e.input.length-e.maximum;return"Supprimez "+n+" caractère"+(n>1?"s":"")},inputTooShort:function(e){var n=e.minimum-e.input.length;return"Saisissez au moins "+n+" caractère"+(n>1?"s":"")},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1?"s":"")},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"},removeAllItems:function(){return"Supprimer tous les éléments"}}}),e.define,e.require}();
|
File without changes
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slash_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- KOVACS Nicolas
|
@@ -420,7 +420,9 @@ files:
|
|
420
420
|
- vendor/assets/javascripts/codemirror/mode/javascript.js
|
421
421
|
- vendor/assets/javascripts/jquery.nestable.js
|
422
422
|
- vendor/assets/javascripts/jquery.tagsinput-revisited.min.js
|
423
|
-
- vendor/assets/javascripts/select2.
|
423
|
+
- vendor/assets/javascripts/select2/i18n/en.js
|
424
|
+
- vendor/assets/javascripts/select2/i18n/fr.js
|
425
|
+
- vendor/assets/javascripts/select2/select2.min.js
|
424
426
|
- vendor/assets/javascripts/toastr.js
|
425
427
|
- vendor/assets/stylesheets/animate.css
|
426
428
|
- vendor/assets/stylesheets/bootstrap-datepicker.min.css
|
@@ -430,8 +432,8 @@ files:
|
|
430
432
|
- vendor/assets/stylesheets/codemirror/theme/relax-seti.css
|
431
433
|
- vendor/assets/stylesheets/jquery.nestable.css
|
432
434
|
- vendor/assets/stylesheets/jquery.tagsinput-revisited.min.css
|
433
|
-
- vendor/assets/stylesheets/select2-bootstrap4.css
|
434
|
-
- vendor/assets/stylesheets/select2.min.css
|
435
|
+
- vendor/assets/stylesheets/select2/select2-bootstrap4.css
|
436
|
+
- vendor/assets/stylesheets/select2/select2.min.css
|
435
437
|
- vendor/assets/stylesheets/sweetalert.css
|
436
438
|
- vendor/assets/stylesheets/toastr.css
|
437
439
|
homepage: https://github.com/nicovak/slash_admin
|