pg_rails 7.6.4 → 7.6.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 558b69c5a93797c069002f3477d6ccc34b63b98fa4f1a37ddedcc4ab6010ef3b
4
- data.tar.gz: a3cc4d53326372aaa5e7155b2d50cfdee3fc3d0814a81eee53ec3701814c3e23
3
+ metadata.gz: d093a397aa4021d053313ee524475eb24295290e56974623fdf03b0ab14691ee
4
+ data.tar.gz: b0ae6c35558a26ff88d59e4949341a2d1046bd0ff81ff83279961b70d20813dd
5
5
  SHA512:
6
- metadata.gz: 259c3f0cc7c935f4a5b9569a2cd33cb1cc60e71a1c5cc85118fb3190415ebad4d78065c641bbe0bdaf479639df1be0ef93ded0ad589313f7dd23011ecfa618d8
7
- data.tar.gz: b0e0ad29958f836916d4469d43bd5f3c8797eb9e00a981694034c025158083f28a0ea32bce7057a957bd2d2898d75daf7905fc9e0facd2ec78677f0de06c3389
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
- = 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
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.ms-1 = @model.decorate.send(@attribute)
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.6.4'
4
+ VERSION = '7.6.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.6.4
4
+ version: 7.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso