diff --git a/app/resources/views/layout/head.blade.php b/app/resources/views/layout/head.blade.php index 9d6c07f..c3969fd 100644 --- a/app/resources/views/layout/head.blade.php +++ b/app/resources/views/layout/head.blade.php @@ -5,6 +5,6 @@ @else
| - - - | ` + return [ + '', + this.draw().actionButtons().edit(id), + this.draw().actionButtons().promise(id), + this.draw().actionButtons().remove(id), + ' | ' + ].join("\n") } return draw } + actions = { edit: event => { event.preventDefault() const id = event.currentTarget.dataset.id - reservations.components.modals.edit.load(id) + const project_id = {{ $project_id ?? 'null' }}; + reservations.components.modals.edit.load({project_id, type: 'active', reservation_id: id}) return false }, remove: event => { @@ -522,7 +584,10 @@ const draw = super.draw() const tooltip = draw.tooltip() tooltip['valida'] = reservation => { - const formatter = new Intl.NumberFormat('es-CL', {minimumFractionDigits: 2, maximumFractionDigits: 2}) + const formatter = new Intl.NumberFormat('es-CL', { + minimumFractionDigits: 2, + maximumFractionDigits: 2 + }) const output = [] const table = [ @@ -590,7 +655,15 @@ } return draw } + actions = { + edit: event => { + event.preventDefault() + const id = event.currentTarget.dataset.id + const project_id = {{ $project_id ?? 'null' }}; + reservations.components.modals.edit.load({project_id, type: 'pending', reservation_id: id}) + return false + }, approve: event => { event.preventDefault() const id = event.currentTarget.dataset.id @@ -624,6 +697,7 @@ return data[idx] }) } + draw() { const draw = super.draw() draw.actions = (id) => { @@ -631,7 +705,9 @@ } return draw } - watch() {} + + watch() { + } mapState(state) { return { @@ -794,7 +870,7 @@ this.show.projects() this.components.modals.add = new AddReservationModal(configuration.ids.projects) - this.components.modals.edit = new EditReservationModal() + this.components.modals.edit = new EditReservationModal(configuration.ids.projects) this.components.modals.comment = new CommentModal() const project_id = {{ $project_id ?? 'null' }}; diff --git a/app/resources/views/ventas/reservations/modal/add.blade.php b/app/resources/views/ventas/reservations/modal/add.blade.php index 69109be..e47224d 100644 --- a/app/resources/views/ventas/reservations/modal/add.blade.php +++ b/app/resources/views/ventas/reservations/modal/add.blade.php @@ -1,534 +1,87 @@ -