slash_admin 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/slash_admin/models_controller.rb +1 -1
  3. data/app/views/slash_admin/base/_data_list.html.erb +1 -1
  4. data/app/views/slash_admin/base/_data_new.html.erb +0 -1
  5. data/app/views/slash_admin/custom_fields/_color.html.erb +1 -0
  6. data/app/views/slash_admin/custom_fields/_email.html.erb +1 -0
  7. data/app/views/slash_admin/custom_fields/_google_map.html.erb +2 -0
  8. data/app/views/slash_admin/custom_fields/_password.html.erb +1 -0
  9. data/app/views/slash_admin/custom_fields/_select.html.erb +1 -0
  10. data/app/views/slash_admin/custom_fields/_tags.html.erb +1 -0
  11. data/app/views/slash_admin/custom_fields/_timezone.html.erb +1 -0
  12. data/app/views/slash_admin/custom_fields/_wysiwyg.html.erb +1 -0
  13. data/app/views/slash_admin/fields/_belongs_to.html.erb +2 -1
  14. data/app/views/slash_admin/fields/_boolean.html.erb +1 -0
  15. data/app/views/slash_admin/fields/_carrierwave.html.erb +1 -0
  16. data/app/views/slash_admin/fields/_date.html.erb +1 -0
  17. data/app/views/slash_admin/fields/_decimal.html.erb +1 -0
  18. data/app/views/slash_admin/fields/_has_many.html.erb +1 -0
  19. data/app/views/slash_admin/fields/_has_one.html.erb +1 -0
  20. data/app/views/slash_admin/fields/_integer.html.erb +1 -0
  21. data/app/views/slash_admin/fields/_json.html.erb +2 -1
  22. data/app/views/slash_admin/fields/_jsonb.html.erb +3 -2
  23. data/app/views/slash_admin/fields/_nested_belongs_to.html.erb +1 -0
  24. data/app/views/slash_admin/fields/_nested_has_many.html.erb +1 -0
  25. data/app/views/slash_admin/fields/_nested_has_one.html.erb +1 -0
  26. data/app/views/slash_admin/fields/_number.html.erb +1 -0
  27. data/app/views/slash_admin/fields/_string.html.erb +1 -0
  28. data/app/views/slash_admin/fields/_text.html.erb +1 -0
  29. data/app/views/slash_admin/shared/_tooltip.html.erb +3 -0
  30. data/lib/slash_admin/version.rb +1 -1
  31. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf1f27f49b9b55f98ce8af943d5c3c9c0a682810da3f9439339215fcbe74f1d0
4
- data.tar.gz: 7a81000b24701b380fb4c9cdcccb8d74635ac8b5af99e6fe06b5cc8edba64d46
3
+ metadata.gz: c5a4c285955a883a0704418cb27fa2837ef8a8fb58745413160846338142e621
4
+ data.tar.gz: 3ecc92ebafdf31d9fdea0c21f45c7d781e99a7f45cc31955a244870704300f5a
5
5
  SHA512:
6
- metadata.gz: 648584d064c58d2ba54c656c249ff10f4f4c486e3fd075d69e1c3d022e7a34a1671a4ae21623fffbc9e5e78db021d4a65fd474110ce267c261c2554846e1c6b4
7
- data.tar.gz: 7ab8584258a1d35fb28c6283cc11d04015c3373a5e107ddef223d615f2e0f683452f25580b2d259cfd8acfa2374c433fd8a828346c041c55bd41d1db53d88c8c
6
+ metadata.gz: bb4285ecb2759b358dfe285a67e3a58e9ff6558a32899a49975dfe6fb6083fc12105f59666a4c457dbcc9a1268eac6c79f7450ffa97e7ed93c211fc316ecffc9
7
+ data.tar.gz: d7ebaf4596b6d463e49c7c4abbad3c59ccb533f95d045b26a229f31424b2cc068ebaa87ec7ba1cfce7a541dc47263256ad11a962094137b0dabc7dac7b62ca05
@@ -145,7 +145,7 @@ module SlashAdmin
145
145
  def after_save_on_update
146
146
  end
147
147
 
148
- # Add tooltip to th list view
148
+ # Add tooltip to th list view & edit/create view
149
149
  # {
150
150
  # attr: 'Value',
151
151
  # title: 'The title of my model',
@@ -48,7 +48,7 @@
48
48
  <%= @model_class.human_attribute_name(attr) %>
49
49
  <% if tooltips.key? attr %>
50
50
  <a href="#" data-toggle="tooltip" data-placement="top" title="<%= tooltips[attr] %>"><i class="fas fa-question-circle"></i></a>
51
- <% end %>
51
+ <% end %>
52
52
  </th>
53
53
  <% end %>
54
54
  <% end %>
@@ -6,7 +6,6 @@
6
6
  <%= render 'slash_admin/shared/errors_data_new' %>
7
7
 
8
8
  <% params.each do |a| %>
9
- <%# <strong><%= @model_class.type_for_attribute(a).type.to_s </strong> %>
10
9
  <%= render 'slash_admin/fields/form_group', f: f, a: a %>
11
10
  <% end %>
12
11
 
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_field a.keys.first, class: 'form-control colorpicker', required: required?(f.object, a) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.email_field a.keys.first, class: 'form-control', required: required?(f.object, a) %>
@@ -1,4 +1,6 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
3
+
2
4
  <input type="text" class="form-control" id="<%= f.options[:html][:id] %>_search" />
3
5
  <script async defer
4
6
  src="https://maps.googleapis.com/maps/api/js?key=<%= a[a.keys.first.to_sym][:google_api_key] %>&libraries=places&callback=initMap&language=<%= I18n.locale %>">
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.password_field a.keys.first, class: 'form-control', required: required?(f.object, a) %>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <% if a[a.keys.first][:multiple].present? && a[a.keys.first][:multiple] == true %>
3
4
  <%= f.select(a.keys.first, a[a.keys.first][:choices], { include_blank: a[a.keys.first][:include_blank], required: required?(f.object, a) }, class: 'selectize-multiple', multiple: true) %>
4
5
  <% else %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_field a.keys.first, class: 'form-control tagsinput tags', required: required?(f.object, a) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.select(a.keys.first, ActiveSupport::TimeZone::MAPPING.values, { include_blank: true, required: required?(f.object, a) }, class: 'selectize-single') %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a.keys.first, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_area a.keys.first, class: 'form-control froala-editor', rows: '5', required: required?(f.object, a) %>
@@ -1,7 +1,8 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.collection_select a.to_s + '_id',
3
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)),
4
- {
5
+ {
5
6
  prompt: t('slash_admin.view.select_model', model_name: class_name_from_association(f.object, a).constantize.model_name.human.downcase),
6
7
  },
7
8
  'data-model': class_name_from_association(f.object, a).constantize.model_name.to_s.underscore,
@@ -1,2 +1,3 @@
1
1
  <%= f.check_box a, class: 'form-control-label' %>
2
2
  <%= f.label a %>
3
+ <%= render 'slash_admin/shared/tooltip', a: a %>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a.to_sym, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
 
3
4
  <% if f.object.send(a).is_a? Array %>
4
5
  <% multiple_files = true %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_field a, class: "form-control bootstrap-material-#{@model_class.type_for_attribute(a.to_s).type.to_s}", required: required?(f.object, a) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.number_field a, class: 'form-control', step: '0.01', required: required?(f.object, a) %>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.collection_select "#{a.to_s.singularize}_ids",
3
4
  class_name_from_association(f.object, a).constantize.all.order(f.object.send(a).present? ? "CASE WHEN id IN(#{f.object.send(a).pluck(:id).join(',')}) THEN 1 ELSE 0 END DESC" : "id DESC").limit(20), :id,
4
5
  object_label(class_name_from_association(f.object, a)),
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.select a.to_s,
3
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] },
4
5
  {
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.number_field a, class: 'form-control', step: '1', required: required?(f.object, a) %>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}"%>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_area a, class: "form-control #{'jsonarea_' + f.object.class.to_s + '_' + a.to_s}", required: required?(f.object, a), value: f.object.send(a).to_json %>
3
4
 
4
5
  <script src="https://rawgithub.com/zaach/jsonlint/79b553fb65c192add9066da64043458981b3972b/lib/jsonlint.js"></script>
@@ -11,4 +12,4 @@
11
12
  gutters: ["CodeMirror-lint-markers"],
12
13
  lint: true
13
14
  });
14
- </script>
15
+ </script>
@@ -1,5 +1,6 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}"%>
2
- <%= f.text_area a, class: "form-control #{'jsonarea_' + f.object.class.to_s + '_' + a.to_s}", required: required?(f.object, a) %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
3
+ <%= f.text_area a, class: "form-control #{'jsonarea_' + f.object.class.to_s + '_' + a.to_s}", required: required?(f.object, a), value: f.object.send(a).to_json %>
3
4
 
4
5
  <script src="https://rawgithub.com/zaach/jsonlint/79b553fb65c192add9066da64043458981b3972b/lib/jsonlint.js"></script>
5
6
  <script type="text/javascript">
@@ -11,4 +12,4 @@
11
12
  gutters: ["CodeMirror-lint-markers"],
12
13
  lint: true
13
14
  });
14
- </script>
15
+ </script>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a).present? ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.collection_select a.to_s + '_id',
3
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(a),
4
5
  {
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: 'form-control-label' %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
 
3
4
  <%= f.fields_for a do |association_model| %>
4
5
  <%= render 'slash_admin/fields/has_many_row', f: association_model, model_ref: a.to_sym %>
@@ -1,4 +1,5 @@
1
1
  <%= f.label a, class: 'form-control-label label-has-one' %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
 
3
4
  <% if f.object.send(a).blank? %>
4
5
  <% f.object.send("#{a.to_s}=", a.to_s.classify.constantize.new) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.number_field a, class: 'form-control', step: '0.01', required: required?(f.object, a) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_field a, class: 'form-control', required: required?(f.object, a) %>
@@ -1,2 +1,3 @@
1
1
  <%= f.label a, class: "form-control-label #{required?(f.object, a) ? 'required' : ''}" %>
2
+ <%= render 'slash_admin/shared/tooltip', a: a %>
2
3
  <%= f.text_area a, class: 'form-control', rows: '5', required: required?(f.object, a) %>
@@ -0,0 +1,3 @@
1
+ <% if tooltips.key? a %>
2
+ <a href="#" data-toggle="tooltip" data-placement="top" title="<%= tooltips[a] %>"><i class="fas fa-question-circle"></i></a>
3
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module SlashAdmin
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
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.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - KOVACS Nicolas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-15 00:00:00.000000000 Z
11
+ date: 2019-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -392,6 +392,7 @@ files:
392
392
  - app/views/slash_admin/shared/_menu.html.erb
393
393
  - app/views/slash_admin/shared/_new_form_buttons.html.erb
394
394
  - app/views/slash_admin/shared/_sub_header.html.erb
395
+ - app/views/slash_admin/shared/_tooltip.html.erb
395
396
  - config/initializers/validators.rb
396
397
  - config/locales/en.yml
397
398
  - config/locales/fr.yml