pg_rails 7.0.8.pre.alpha.112 → 7.1.1.pre.1

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: 05fcca002b0d29dc6e54d625ebec851eddc239a858ebf6714019000a528e7d35
4
- data.tar.gz: 8ce185225473246f30228ccde564466ccff35fb390c87006f3ee8c900a6f005c
3
+ metadata.gz: 26619042e1d28565472f7c5dd99e31b4a75668c3efd5e0c299ad6f3a5e6f71cd
4
+ data.tar.gz: 1f306defd53cda0f8567ac4f17465b99aaed1d1293565b08b08176b853301713
5
5
  SHA512:
6
- metadata.gz: 93de11640c80585f58c9d5c6b69082efdd5151e9a164097aacf1ce7b1b528e8e4d5d4a873823ae2ec9bdf00fab688839300f5960802447078d1219a5ef454d75
7
- data.tar.gz: 6751325594662bd3165fcb81516190e5645fb47295dcb0a465577c6cee2b44adde0fae49196dacf031cae228cc4c8ded14b0ab0bf67e57f62636456f65316953
6
+ metadata.gz: a338901f4520b0a9dd9b7dfb363951ddd884f20ad87b9bcd5fea6591d908383c22a942ff9be7e6f914a7788e18e8233b58a541cb5b37d27f889665025bdede16
7
+ data.tar.gz: e21ec84cfa1a7191fdc5776524cfa1e67468f38720080ceb6299dd9305f16d7f57cc155314f72d9eaa79a6ed0a2c7d9834d7781f80eeb0e0d7d53f6827557230
@@ -9,6 +9,14 @@ export default class extends Controller {
9
9
 
10
10
  connect (e) {
11
11
  this.modalPuntero = new bootstrap.Modal(this.element)
12
+ if (this.element.dataset.removeOnHide) {
13
+ this.element.addEventListener('hidden.bs.modal', (e) => {
14
+ this.element.remove()
15
+ window.Stimulus.controllers.map((c) => { return c.calendar })
16
+ .filter((e) => { return e })
17
+ .map((c) => { c.refetchEvents() })
18
+ })
19
+ }
12
20
  this.modalPuntero.show()
13
21
  document.addEventListener('turbo:before-cache', () => {
14
22
  this.element.remove()
@@ -135,6 +135,9 @@ input[type=datetime-local], input[type=datetime] {
135
135
  }
136
136
 
137
137
  // Full calendar
138
+ .fc .fc-highlight {
139
+ background-color: #{tint-color($primary, 60%)};
140
+ }
138
141
  .fc-daygrid-day-top a {
139
142
  text-decoration: none;
140
143
  }
@@ -143,7 +146,8 @@ input[type=datetime-local], input[type=datetime] {
143
146
  }
144
147
  .fc-multimonth {
145
148
  .fc-daygrid-day-events {
146
- display: none;
149
+ xdisplay: none;
150
+ visibility: hidden;
147
151
  }
148
152
  .fc-daygrid-day-top {
149
153
  display: inline-block;
@@ -89,6 +89,7 @@ module PgEngine
89
89
  object = instancia_modelo
90
90
  respond_to do |format|
91
91
  if (@saved = object.save)
92
+ # TODO: 'asociable' lo cambiaría por 'in_modal' o algo así
92
93
  if params[:asociable]
93
94
  format.turbo_stream do
94
95
  render turbo_stream:
@@ -96,7 +97,8 @@ module PgEngine
96
97
  <div data-modal-target="response" data-response='#{object.decorate.to_json}'></div>
97
98
  HTML
98
99
  )
99
- # rubocop:enable Rails/SkipsModelValidations
100
+ # FIXME: handlear json
101
+ # render json: object.decorate, content_type: 'application/json'
100
102
  end
101
103
  end
102
104
  format.html do
@@ -113,10 +115,9 @@ module PgEngine
113
115
  # self.instancia_modelo = instancia_modelo.decorate
114
116
  if params[:asociable]
115
117
  format.turbo_stream do
116
- # rubocop:disable Rails/SkipsModelValidations
118
+ # FIXME: agregar , status: :unprocessable_entity
117
119
  render turbo_stream:
118
120
  turbo_stream.update_all('.modal.show .pg-associable-form', partial: 'form', locals: { asociable: true })
119
- # rubocop:enable Rails/SkipsModelValidations
120
121
  end
121
122
  end
122
123
  format.html { render :new, status: :unprocessable_entity }
@@ -138,9 +139,14 @@ module PgEngine
138
139
  end
139
140
 
140
141
  def pg_respond_show(object = nil)
141
- respond_to do |format|
142
- format.json { render json: object || instancia_modelo }
143
- format.html
142
+ object = object || instancia_modelo
143
+ if params[:modal].present?
144
+ render turbo_stream: turbo_stream.append_all('body', partial: 'pg_layout/modal_show', locals: { object: })
145
+ else
146
+ respond_to do |format|
147
+ format.json { render json: object }
148
+ format.html
149
+ end
144
150
  end
145
151
  end
146
152
 
@@ -22,7 +22,6 @@ function bindListingClick () {
22
22
  }
23
23
  }
24
24
  }
25
- console.log('click')
26
25
  }
27
26
  }
28
27
  bindListingClick()
@@ -0,0 +1,9 @@
1
+ .modal.modal-lg.modal-asociable[tabindex="-1" data-controller="modal" data-remove-on-hide="true"]
2
+ .modal-dialog
3
+ .modal-content
4
+ .modal-header
5
+ .modal-title
6
+ h3 Item
7
+ a.btn-close[type="button" data-bs-dismiss="modal" aria-label="Close"]
8
+ .modal-body
9
+ = render object
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgRails
4
- VERSION = '7.0.8-alpha.112'
4
+ VERSION = '7.1.1-1'
5
5
  end
@@ -7,5 +7,8 @@ $danger-bg-subtle: tint-color($danger, 98%);
7
7
  // $info-border-subtle: tint-color($info, 60%);
8
8
  $warning-border-subtle: tint-color($warning, 20%);
9
9
  // $danger-border-subtle: tint-color($danger, 60%);
10
+ $secondary-bg-subtle: tint-color($secondary, 92%);
11
+ $warning-bg-subtle: tint-color($warning, 40%);
12
+
10
13
 
11
14
  $btn-close-focus-shadow: none;
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pg_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.0.8.pre.alpha.112
4
+ version: 7.1.1.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martín Rosso
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-10 00:00:00.000000000 Z
11
+ date: 2024-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -848,6 +848,7 @@ files:
848
848
  - pg_layout/app/views/layouts/pg_layout/mailer.html.slim
849
849
  - pg_layout/app/views/layouts/pg_layout/mailer.text.erb
850
850
  - pg_layout/app/views/pg_layout/_flash.html.slim
851
+ - pg_layout/app/views/pg_layout/_modal_show.html.slim
851
852
  - pg_layout/app/views/pg_layout/_navbar.html.erb
852
853
  - pg_layout/app/views/pg_layout/_sidebar.html.erb
853
854
  - pg_layout/app/views/pg_layout/_sidebar_mobile.html.erb