chg: [inbox] Improved layouts
parent
414ac9a59f
commit
0a1294bbee
|
@ -59,6 +59,9 @@ class InboxController extends AppController
|
|||
|
||||
public function delete($id)
|
||||
{
|
||||
$this->set('deletionTitle', __('Discard request'));
|
||||
$this->set('deletionText', __('Are you sure you want to discard request #{0}?', $id));
|
||||
$this->set('deletionConfirm', __('Discard'));
|
||||
$this->CRUD->delete($id);
|
||||
$responsePayload = $this->CRUD->getResponsePayload();
|
||||
if (!empty($responsePayload)) {
|
||||
|
|
|
@ -75,12 +75,17 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
|||
'description' => __('A list of requests to be manually processed'),
|
||||
'actions' => [
|
||||
[
|
||||
'open_modal' => '/inbox/process/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'url' => '/inbox/view',
|
||||
'url_params_data_paths' => ['id'],
|
||||
'icon' => 'eye'
|
||||
],
|
||||
[
|
||||
'open_modal' => '/individuals/delete/[onclick_params_data_path]',
|
||||
'open_modal' => '/inbox/process/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'icon' => 'cogs'
|
||||
],
|
||||
[
|
||||
'open_modal' => '/inbox/delete/[onclick_params_data_path]',
|
||||
'modal_params_data_path' => 'id',
|
||||
'icon' => 'trash'
|
||||
],
|
||||
|
|
|
@ -43,6 +43,7 @@ echo $this->element(
|
|||
[
|
||||
'key' => 'data',
|
||||
'path' => 'data',
|
||||
'type' => 'json'
|
||||
],
|
||||
],
|
||||
'children' => []
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
<?php
|
||||
$value = Cake\Utility\Hash::extract($data, $field['path']);
|
||||
echo sprintf('<pre><code>%s</pre></code>', h(json_encode($value, JSON_PRETTY_PRINT)));
|
|
@ -1,7 +1,13 @@
|
|||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><?= __('Delete {0}', h(Cake\Utility\Inflector::singularize(Cake\Utility\Inflector::humanize($this->request->getParam('controller'))))) ?></h5>
|
||||
<h5 class="modal-title">
|
||||
<?php if (empty($deletionTitle)): ?>
|
||||
<p><?= __('Delete {0}', h(Cake\Utility\Inflector::singularize(Cake\Utility\Inflector::humanize($this->request->getParam('controller'))))) ?></p>
|
||||
<?php else: ?>
|
||||
<p><?= h($deletionTitle) ?></p>
|
||||
<?php endif; ?>
|
||||
</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
|
@ -15,7 +21,7 @@
|
|||
</div>
|
||||
<div class="modal-footer">
|
||||
<?= $this->Form->postLink(
|
||||
'Delete',
|
||||
!empty($deletionConfirm) ? h($deletionConfirm) : __('Delete'),
|
||||
(empty($postLinkParameters) ? ['action' => 'delete', $id] : $postLinkParameters),
|
||||
['class' => 'btn btn-danger button-execute', 'id' => 'submitButton']
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue