base_editing_bootstrap 0.10.2 → 0.12.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +18 -0
- data/README.md +11 -4
- data/app/helpers/utilities/search_helper.rb +5 -2
- data/app/views/base_editing/_editing_form_help_text.html.erb +16 -0
- data/app/views/base_editing/_form_field.html.erb +1 -0
- data/app/views/base_editing/_search.html.erb +1 -1
- data/config/locales/it.yml +1 -0
- data/lib/base_editing_bootstrap/VERSION +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2ebd5f42f60f886ca0e8c5ecff7d5be53531bf015ea7c44f763f6d07127f69ec
|
4
|
+
data.tar.gz: 007b28d61ec3058efdc94488578cc2fdae37d1477296511db5e5653f77b94bee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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]
|
121
|
-
|
122
|
-
|
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
|
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
|
+
|
data/config/locales/it.yml
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
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.
|
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-
|
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
|