chg: [inbox] Improved layouts
parent
414ac9a59f
commit
0a1294bbee
|
@ -59,6 +59,9 @@ class InboxController extends AppController
|
||||||
|
|
||||||
public function delete($id)
|
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);
|
$this->CRUD->delete($id);
|
||||||
$responsePayload = $this->CRUD->getResponsePayload();
|
$responsePayload = $this->CRUD->getResponsePayload();
|
||||||
if (!empty($responsePayload)) {
|
if (!empty($responsePayload)) {
|
||||||
|
|
|
@ -75,12 +75,17 @@ echo $this->element('genericElements/IndexTable/index_table', [
|
||||||
'description' => __('A list of requests to be manually processed'),
|
'description' => __('A list of requests to be manually processed'),
|
||||||
'actions' => [
|
'actions' => [
|
||||||
[
|
[
|
||||||
'open_modal' => '/inbox/process/[onclick_params_data_path]',
|
'url' => '/inbox/view',
|
||||||
'modal_params_data_path' => 'id',
|
'url_params_data_paths' => ['id'],
|
||||||
'icon' => 'eye'
|
'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',
|
'modal_params_data_path' => 'id',
|
||||||
'icon' => 'trash'
|
'icon' => 'trash'
|
||||||
],
|
],
|
||||||
|
|
|
@ -43,6 +43,7 @@ echo $this->element(
|
||||||
[
|
[
|
||||||
'key' => 'data',
|
'key' => 'data',
|
||||||
'path' => 'data',
|
'path' => 'data',
|
||||||
|
'type' => 'json'
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'children' => []
|
'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-dialog" role="document">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<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">
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
</button>
|
</button>
|
||||||
|
@ -15,7 +21,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<?= $this->Form->postLink(
|
<?= $this->Form->postLink(
|
||||||
'Delete',
|
!empty($deletionConfirm) ? h($deletionConfirm) : __('Delete'),
|
||||||
(empty($postLinkParameters) ? ['action' => 'delete', $id] : $postLinkParameters),
|
(empty($postLinkParameters) ? ['action' => 'delete', $id] : $postLinkParameters),
|
||||||
['class' => 'btn btn-danger button-execute', 'id' => 'submitButton']
|
['class' => 'btn btn-danger button-execute', 'id' => 'submitButton']
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue