pg_rails 7.6.4 → 7.6.5
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 +4 -4
- data/pg_engine/app/assets/stylesheets/pg_rails_b5.scss +43 -3
- data/pg_engine/app/components/inline_edit/inline_edit_component.html.slim +9 -9
- data/pg_engine/app/components/inline_edit/inline_show_component.html.slim +2 -2
- data/pg_engine/app/lib/pg_form_builder.rb +2 -0
- data/pg_rails/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d093a397aa4021d053313ee524475eb24295290e56974623fdf03b0ab14691ee
|
4
|
+
data.tar.gz: b0ae6c35558a26ff88d59e4949341a2d1046bd0ff81ff83279961b70d20813dd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1d7f92c914bf3ca632cfcb04cdcb9a52870e69a057085df1b68bc7e402a4831f7ce1b008f9aa3a6e50bd3436ce192225f795f52841b939bb0733024c4c98fa
|
7
|
+
data.tar.gz: 87b8d08575eca14e090029038176c1dcf352047a340f41b3f908bfaf21b06614e952d5543a595e02503f25bb47d0dd45cb5ba86d74c089f0d4c35cde4b23db96
|
@@ -204,24 +204,64 @@ input[type=datetime-local], input[type=datetime] {
|
|
204
204
|
// Inline edit
|
205
205
|
|
206
206
|
.inline-edit {
|
207
|
-
// text-decoration: underline;
|
208
|
-
// text-decoration-style: dotted;
|
209
|
-
// text-decoration-color: #262626;
|
210
207
|
border-bottom: 1px dotted #333;
|
211
208
|
padding-bottom: 1px;
|
212
209
|
|
210
|
+
&:not(:has(.trix-content)) .edit-link {
|
211
|
+
margin-right: 0.25em;
|
212
|
+
}
|
213
|
+
|
214
|
+
&:has(.trix-content) .edit-link {
|
215
|
+
margin-bottom: 0.55em;
|
216
|
+
display: inline-block;
|
217
|
+
border-bottom: 1px dotted #333;
|
218
|
+
}
|
219
|
+
|
213
220
|
a:hover {
|
214
221
|
i {
|
215
222
|
color: black;
|
216
223
|
}
|
217
224
|
}
|
218
225
|
|
226
|
+
form {
|
227
|
+
display: flex;
|
228
|
+
align-items: start;
|
229
|
+
gap: 0.25rem;
|
230
|
+
|
231
|
+
&:has(trix-editor) {
|
232
|
+
display: block;
|
233
|
+
|
234
|
+
.actions {
|
235
|
+
margin-top: 0.25rem;
|
236
|
+
}
|
237
|
+
}
|
238
|
+
}
|
239
|
+
|
219
240
|
input[type=text] {
|
220
241
|
min-width: 22em;
|
221
242
|
}
|
222
243
|
|
244
|
+
select {
|
245
|
+
max-width: 45em;
|
246
|
+
}
|
247
|
+
|
223
248
|
// To display correctly in tables with fixed witdh columns
|
224
249
|
.form-select {
|
225
250
|
width: initial;
|
226
251
|
}
|
227
252
|
}
|
253
|
+
|
254
|
+
// WIP, inline rich text en listados
|
255
|
+
.listado {
|
256
|
+
.inline-edit {
|
257
|
+
display: flex!important;
|
258
|
+
align-items: center;
|
259
|
+
gap: 0.25em;
|
260
|
+
|
261
|
+
&:has(.trix-content) .edit-link {
|
262
|
+
margin-bottom: 0;
|
263
|
+
display: inline;
|
264
|
+
border-bottom: none;
|
265
|
+
}
|
266
|
+
}
|
267
|
+
}
|
@@ -1,14 +1,14 @@
|
|
1
1
|
= helpers.turbo_frame_tag(@frame_id, class: 'inline-edit')
|
2
|
-
= helpers.pg_form_for(@model, render_errors: false, wrapper_mappings: @wrapper_mappings
|
3
|
-
html: { class: 'd-flex align-items-start gap-1' }) do |f|
|
2
|
+
= helpers.pg_form_for(@model, render_errors: false, wrapper_mappings: @wrapper_mappings) do |f|
|
4
3
|
= hidden_field_tag :inline_attribute, @attribute
|
5
4
|
|
6
5
|
= f.field @unsuffixed_attribute, label: false, html5: true
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
.actions.d-flex.gap-1
|
8
|
+
= button_tag class: 'btn btn-sm btn-primary',
|
9
|
+
data: { controller: 'tooltip', 'bs-title': 'Guardar' } do
|
10
|
+
i.bi.bi-check-lg
|
11
|
+
= link_to users_inline_show_path(model: @model.to_gid, attribute: @attribute),
|
12
|
+
class: 'btn btn-sm btn-secondary',
|
13
|
+
data: { controller: 'tooltip', 'bs-title': 'Cancelar' } do
|
14
|
+
i.bi.bi-x-lg
|
@@ -1,8 +1,8 @@
|
|
1
1
|
- if @model.class.inline_editable?(@unsuffixed_attribute) && helpers.policy(@model).edit?
|
2
2
|
= helpers.turbo_frame_tag(@frame_id, class: 'inline-edit')
|
3
3
|
= link_to users_inline_edit_path(model: @model.to_gid, attribute: @attribute),
|
4
|
-
class: 'text-body-tertiary', style: 'font-size: 0.8em' do
|
4
|
+
class: 'text-body-tertiary edit-link', style: 'font-size: 0.8em' do
|
5
5
|
i.bi.bi-pencil
|
6
|
-
span
|
6
|
+
span = @model.decorate.send(@attribute)
|
7
7
|
- else
|
8
8
|
= @model.decorate.send(@attribute)
|
@@ -31,6 +31,8 @@ class PgFormBuilder < SimpleForm::FormBuilder
|
|
31
31
|
|
32
32
|
if find_on_all_associations(model.class, attribute_name).present?
|
33
33
|
pg_associable(attribute_name, options)
|
34
|
+
elsif model.respond_to?("rich_text_#{attribute_name}")
|
35
|
+
rich_text_area attribute_name
|
34
36
|
else
|
35
37
|
input(attribute_name, options, &)
|
36
38
|
end
|
data/pg_rails/lib/version.rb
CHANGED