formstrap 0.4.9 → 0.4.11

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.
Files changed (31) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/formstrap/controllers/media_controller.js +8 -4
  3. data/app/assets/javascripts/formstrap/vendor/redactor/i18n/nl.js +1 -1
  4. data/app/assets/javascripts/formstrap/vendor/redactor/plugins/ai.js +958 -982
  5. data/app/assets/javascripts/formstrap/vendor/redactor/plugins/linkstyles.js +2 -2
  6. data/app/assets/javascripts/formstrap.js +105 -98
  7. data/app/models/concerns/formstrap/labelable.rb +2 -1
  8. data/app/views/formstrap/_association.html.erb +1 -0
  9. data/app/views/formstrap/_checkbox.html.erb +1 -0
  10. data/app/views/formstrap/_color.html.erb +1 -0
  11. data/app/views/formstrap/_date.html.erb +1 -0
  12. data/app/views/formstrap/_email.html.erb +1 -0
  13. data/app/views/formstrap/_file.html.erb +1 -0
  14. data/app/views/formstrap/_label.html.erb +5 -0
  15. data/app/views/formstrap/_media.html.erb +2 -1
  16. data/app/views/formstrap/_number.html.erb +1 -0
  17. data/app/views/formstrap/_password.html.erb +1 -0
  18. data/app/views/formstrap/_redactor.html.erb +1 -0
  19. data/app/views/formstrap/_select.html.erb +1 -0
  20. data/app/views/formstrap/_switch.html.erb +2 -1
  21. data/app/views/formstrap/_text.html.erb +2 -1
  22. data/app/views/formstrap/_textarea.html.erb +1 -0
  23. data/app/views/formstrap/_wysiwyg.html.erb +1 -0
  24. data/config/locales/formstrap/de.yml +2 -0
  25. data/config/locales/formstrap/en.yml +2 -0
  26. data/config/locales/formstrap/fr.yml +2 -0
  27. data/config/locales/formstrap/nl.yml +2 -0
  28. data/lib/formstrap/version.rb +1 -1
  29. data/package.json +1 -1
  30. metadata +2 -3
  31. data/app/views/formstrap/shared/_notifications.html.erb +0 -20
@@ -1,9 +1,11 @@
1
1
  <%
2
2
  # name: formstrap/label
3
3
  #
4
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
4
5
  # ==== Required parameters
5
6
  # * +form+ - Form object
6
7
  # * +attribute+ - Name of the attribute of the form model
8
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
7
9
  #
8
10
  # ==== Optional parameters
9
11
  # * +text+ - Custom label to be used instead of the attribute
@@ -20,3 +22,6 @@
20
22
 
21
23
  <% label = Formstrap::LabelView.new(local_assigns) %>
22
24
  <%= form.label label.attribute, label.text, label.options %>
25
+ <% if label.translatable %>
26
+ <%= bootstrap_icon "translate", class: "ms-1 text-black text-opacity-50", title: t(".translatable_tooltip") %>
27
+ <% end %>
@@ -17,6 +17,7 @@
17
17
  # * +height+ - Height of the thumbnail
18
18
  # * +exclude_models+ - Array of model names to exclude from selection (e.g. ["User", "Company"])
19
19
  # * +edit_url+ - Placeholder link for the edit page of the attachment. Needs to contain a ":id" part, e.g. "admin_media_edit_url(":id"). This url be opened in a modal
20
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
20
21
  #
21
22
  # ==== References
22
23
  # https://headmin.dev/docs/forms/media
@@ -41,7 +42,7 @@
41
42
  <% end %>
42
43
 
43
44
  <!-- Placeholder -->
44
- <div class="<%= "d-none" if media.attachments.any? %>" data-media-target="placeholder">
45
+ <div data-media-target="placeholder">
45
46
  <a href="<%= media.modal_url %>" data-turbo-frame="modal" data-media-target="modalButton">
46
47
  <%= render "formstrap/shared/thumbnail", media.thumbnail_options %>
47
48
  </a>
@@ -14,6 +14,7 @@
14
14
  # * +plaintext+ - Render input as plain text.
15
15
  # * +prepend+ - Display as input group with text on the left-hand side
16
16
  # * +wrapper+ - Hash with all options for the surrounding html tag
17
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
17
18
  #
18
19
  # ==== References
19
20
  # https://headmin.dev/docs/forms/number
@@ -13,6 +13,7 @@
13
13
  # * +plaintext+ - Render input as plain text.
14
14
  # * +prepend+ - Display as input group with text on the left-hand side
15
15
  # * +wrapper+ - Hash with all options for the surrounding html tag
16
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
16
17
  #
17
18
  # ==== References
18
19
  # https://headmin.dev/docs/forms/password
@@ -12,6 +12,7 @@
12
12
  # * +prepend+ - Display as input group with text on the left-hand side
13
13
  # * +redactor+ - Hash with all options you can pass to redactor JS config
14
14
  # * +wrapper+ - Hash with all options for the surrounding html tag
15
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
15
16
  #
16
17
  # ==== References
17
18
  # https://imperavi.com/redactor/docs
@@ -17,6 +17,7 @@
17
17
  # * +tags+ - Allow options to be created dynamically. This will set the multiple attribute to true
18
18
  # * +wrapper+ - Hash with all options for the surrounding html tag
19
19
  # * +remote+ - Hash with all options for remote data fetching
20
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
20
21
  #
21
22
  # ==== Remote options
22
23
  # * +url+ -- JSON endpoint to fetch data from
@@ -11,6 +11,7 @@
11
11
  # * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
12
12
  # * +unchecked_value+ - Value for unchecked state
13
13
  # * +wrapper+ - Hash with all options for the surrounding html tag
14
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
14
15
  #
15
16
  # ==== References
16
17
  # https://headmin.dev/docs/forms/switch
@@ -26,4 +27,4 @@
26
27
  switch = Formstrap::SwitchView.new(local_assigns)
27
28
  %>
28
29
 
29
- <%= render "formstrap/checkbox", switch.options %>
30
+ <%= render "formstrap/checkbox", switch.options %>
@@ -15,6 +15,7 @@
15
15
  # * +plaintext+ - Render input as plain text.
16
16
  # * +prepend+ - Display as input group with text on the left-hand side
17
17
  # * +wrapper+ - Hash with all options for the surrounding html tag
18
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
18
19
  #
19
20
  # ==== References
20
21
  # https://headmin.dev/docs/forms/text
@@ -39,4 +40,4 @@
39
40
  <%= render "formstrap/validation", text.validation_options if text.validate? %>
40
41
  <%= render "formstrap/hint", text.hint_options if text.hint? %>
41
42
  <%= render "formstrap/label", text.label_options if text.append_label? %>
42
- <% end %>
43
+ <% end %>
@@ -13,6 +13,7 @@
13
13
  # * +plaintext+ - Render input as plain text.
14
14
  # * +prepend+ - Display as input group with text on the left-hand side
15
15
  # * +wrapper+ - Hash with all options for the surrounding html tag
16
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
16
17
  #
17
18
  # ==== References
18
19
  # https://headmin.dev/docs/forms/textarea
@@ -10,6 +10,7 @@
10
10
  # * +label+ - Text to display inside label tag. Defaults to the attribute name. Set to false if you don"t want to show a label.
11
11
  # * +toolbar+ - Show toolbar (default true)
12
12
  # * +wrapper+ - Hash with all options for the surrounding html tag
13
+ # * +translatable+ - Adds a translatable icon next to the label if it is set to true. Defaults depends on initializer.
13
14
  #
14
15
  # ==== References
15
16
  # https://imperavi.com/redactor/docs
@@ -7,6 +7,8 @@ de:
7
7
  other: Dateien durchsuchen oder hierher ziehen und ablegen
8
8
  group:
9
9
  save: Speichern
10
+ label:
11
+ translatable_tooltip: Dieses Feld ist übersetzbar und kann je nach Sprache einen anderen Wert enthalten
10
12
  media:
11
13
  modal:
12
14
  close: Schließen
@@ -7,6 +7,8 @@ en:
7
7
  other: Browse files or drag & drop them here
8
8
  group:
9
9
  save: Save
10
+ label:
11
+ translatable_tooltip: This field is translatable and can contain a different value per language
10
12
  media:
11
13
  modal:
12
14
  close: Close
@@ -7,6 +7,8 @@ fr:
7
7
  other: Parcourir les fichiers ou faites les glisser et déposez-les ici
8
8
  group:
9
9
  save: Sauvegarder
10
+ label:
11
+ translatable_tooltip: Ce champ est traduisible et peut contenir une valeur différente selon la langue
10
12
  media:
11
13
  modal:
12
14
  close: Fermer
@@ -7,6 +7,8 @@ nl:
7
7
  other: Kies bestanden of sleep ze hierheen
8
8
  group:
9
9
  save: Opslaan
10
+ label:
11
+ translatable_tooltip: "Dit veld is vertaalbaar en kan per taal een andere waarde bevatten"
10
12
  media:
11
13
  modal:
12
14
  close: Sluiten
@@ -1,3 +1,3 @@
1
1
  module Formstrap
2
- VERSION = "0.4.9"
2
+ VERSION = "0.4.11"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frontierdotbe/formstrap",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "Bootstrap-powered Form Helpers",
5
5
  "module": "app/assets/javascripts/formstrap.js",
6
6
  "main": "app/assets/javascripts/formstrap.js",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: formstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jef Vlamings
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-17 00:00:00.000000000 Z
11
+ date: 2025-04-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An extensive Bootstrap form library to power your Ruby On Rails application.
14
14
  email:
@@ -172,7 +172,6 @@ files:
172
172
  - app/views/formstrap/pagination/_infinite.html.erb
173
173
  - app/views/formstrap/repeater/_row.html.erb
174
174
  - app/views/formstrap/shared/_nested_preview.html.erb
175
- - app/views/formstrap/shared/_notifications.html.erb
176
175
  - app/views/formstrap/shared/_popup.html.erb
177
176
  - app/views/formstrap/shared/_thumbnail.html.erb
178
177
  - bin/console
@@ -1,20 +0,0 @@
1
- <%
2
- # formstrap/shared/notifications
3
- #
4
- # ==== Examples
5
- # Basic version
6
- # <%= render "formstrap/shared/notifications" %#>
7
- %>
8
-
9
- <div class="toast-container position-absolute top-0 end-0 p-3">
10
- <% flash.each do |name, message| %>
11
- <div class="toast align-items-center text-white show <%= notification_color(name.to_sym)[:background] %>" role="alert" aria-live="assertive" aria-atomic="true" data-controller="toast">
12
- <div class="d-flex">
13
- <div class="toast-body <%= notification_color(name.to_sym)[:text] %>">
14
- <%= message %>
15
- </div>
16
- <button type="button" class="btn-close btn-close-white me-2 m-auto" data-bs-dismiss="toast" aria-label="Close"></button>
17
- </div>
18
- </div>
19
- <% end %>
20
- </div>