base_editing_bootstrap 0.10.2 → 0.12.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e1b2b4d7acdd0cc339988fde4d7ce56578bc2cb692184c77cb47e90f256f2d7
4
- data.tar.gz: 30b9e2672ac29a97722f1f163ee6ed5e7cb9473d5aac9f5ad85bdd9621e0b351
3
+ metadata.gz: 2ebd5f42f60f886ca0e8c5ecff7d5be53531bf015ea7c44f763f6d07127f69ec
4
+ data.tar.gz: 007b28d61ec3058efdc94488578cc2fdae37d1477296511db5e5653f77b94bee
5
5
  SHA512:
6
- metadata.gz: 6e6d302e8a9d8e644b1eebfdccef92b85437651fb36f74264b38384afb0e237412858d3a86f58d81579b7b981c5891bad5706fb72e3c42b2b9c994fd3b907cb2
7
- data.tar.gz: d32ad07d930010e7a7ae647619dcd42cd61ca4e30ffa86bde4f42c5be8a10a75102788f121217fe613972e083c4e2dea4b4c1a8667dbeb96430d220a20f73d59
6
+ metadata.gz: 530342bff9cac4c81404c568d89faf99293f1992e3c2aedea0042ec4ed9a3f30bf72f9a9da75036bef84eb29c8b7e8299baa4b5c548d5ef7ca2e9497732a3478
7
+ data.tar.gz: 4b9e115f5ee49c9857bb243091e4ca58c70f0e02d16e241dbb93c09337728fee62455c673818fb963810d0dec36462ce332194217d590c3848bd013213126c55
data/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
3
3
 
4
4
  - - -
5
+ ## 0.12.0 - 2024-10-01
6
+ #### Documentation
7
+ - Update documentation - (e49af20) - Marino Bonetti
8
+ #### Features
9
+ - Add Rendering of HelpText - (35ceb69) - Marino Bonetti
10
+ #### Miscellaneous Chores
11
+ - Fix Ask for otp - (0f4e66b) - Marino Bonetti
12
+
13
+ - - -
14
+
15
+ ## 0.11.0 - 2024-09-05
16
+ #### Features
17
+ - Add clear search button - (f989c17) - Marino Bonetti
18
+ #### Miscellaneous Chores
19
+ - Add ask otp - (51be33d) - Marino Bonetti
20
+
21
+ - - -
22
+
5
23
  ## 0.10.2 - 2024-09-05
6
24
  #### Bug Fixes
7
25
  - Force to_s ransackable_attributes - (a5c8cbb) - Marino Bonetti
data/README.md CHANGED
@@ -117,10 +117,17 @@ Utilizzo per modello base, in questo esempio prendiamo come modello Post come es
117
117
  end
118
118
 
119
119
  ```
120
- - [OPTIONAL] nel caso si volesse fare override dei campi della form chiamare il generatore:
121
- ```shell
122
- rails g base_editing_bootstrap:field_override ModelName field1 field2:type
123
- ```
120
+ - [OPTIONAL] FORM overrides:
121
+ - nel caso si volesse fare override dei campi della form chiamare il generatore:
122
+ ```shell
123
+ rails g base_editing_bootstrap:field_override ModelName field1 field2:type
124
+ ```
125
+ - è possibile customizzare
126
+ - un text help per ogni campo andando ad aggiungere nelle traduzioni la relativa
127
+ traduzione nella posizione: `it.activerecord.attributes.MODEL.FIELD/help_text`
128
+ - un blocco per l'unità di misura accanto al campo aggiungendo alle traduzioni:
129
+ `it.activerecord.attributes.MODEL.FIELD/unit`
130
+
124
131
  - [OPTIONAL] la medesima cosa è possibile fare con il rendering dei campi
125
132
  delle celle della tabella
126
133
  ```shell
@@ -6,7 +6,7 @@ module Utilities
6
6
  # Per aggiungere bottoni:
7
7
  # ES:
8
8
  # def search_form_buttons(ransack_form, &block)
9
- # super #<- questo serve per costruiri i bottoni definiti da super
9
+ # super #<- questo serve per costruire i bottoni definiti da super
10
10
  # content_for(:search_form_buttons) do #<- questo serve per aggiungere al content_for un'altro bottone
11
11
  # link_to "xls", admins_log_alarms_path(params: {q: params.permit(q:{})[:q]}, format: :xlsx), class: "btn btn-info", target: :_blank
12
12
  # end
@@ -15,7 +15,10 @@ module Utilities
15
15
  # @param [Ransack::Helpers::FormBuilder] ransack_form
16
16
  def search_form_buttons(ransack_form)
17
17
  content_for(:search_form_buttons) do
18
- ransack_form.submit(I18n.translate('.search'), class: "btn btn-primary")
18
+ ransack_form.submit(I18n.translate('.search'), class: "btn btn-primary") +
19
+ link_to(I18n.translate('.clear_search'),
20
+ index_custom_polymorphic_path(ransack_form.object.klass),
21
+ class: "btn btn-secondary")
19
22
  end
20
23
  end
21
24
 
@@ -0,0 +1,16 @@
1
+ <%
2
+ # LOCALS disponibili per rendering del testo dell'help del campo se presente
3
+ # nelle traduzioni in field/help_text
4
+ # object: classe active_model che mi serve per cercare l'help text
5
+ # field: campo per cui stampare l'help
6
+ %>
7
+ <%# locals: (object:,field:) -%>
8
+ <%
9
+ help_text = object.class.human_attribute_name("#{field}/help_text", default: "")
10
+ unless help_text.blank?
11
+ %>
12
+ <div class="form-text"><%= help_text %></div>
13
+ <%
14
+ end
15
+ %>
16
+
@@ -4,3 +4,4 @@
4
4
  <%= form_print_field(form, form_field) %>
5
5
  <%= error_messages_for(form.object, form_field) %>
6
6
  </div>
7
+ <%= render partial: "editing_form_help_text", locals: {object: form.object, field: form_field} %>
@@ -5,7 +5,7 @@
5
5
  </div>
6
6
 
7
7
  <div class="row mt-4">
8
- <div class="col-1">
8
+ <div class="col">
9
9
  <div class="btn-group mr-1">
10
10
  <% search_form_buttons(f) %>
11
11
  <%= content_for :search_form_buttons %>
@@ -1,5 +1,6 @@
1
1
  it:
2
2
  search: "Esegui ricerca"
3
+ clear_search: "Cancella ricerca"
3
4
  save: "Salva"
4
5
  back: "Indietro"
5
6
  new: "Nuovo"
@@ -1 +1 @@
1
- 0.10.2
1
+ 0.12.0
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: base_editing_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marino Bonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-05 00:00:00.000000000 Z
11
+ date: 2024-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -312,6 +312,7 @@ files:
312
312
  - app/policies/base_model_policy.rb
313
313
  - app/views/.keep
314
314
  - app/views/base_editing/_edit_page_title_header.html.erb
315
+ - app/views/base_editing/_editing_form_help_text.html.erb
315
316
  - app/views/base_editing/_editing_form_measure_unit.html.erb
316
317
  - app/views/base_editing/_form.html.erb
317
318
  - app/views/base_editing/_form_field.html.erb