first standalone plugin commit
This commit is contained in:
28
templates/Addresses/add.php
Normal file
28
templates/Addresses/add.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $cities
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $states
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Addresses'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses form content">
|
||||
<?= $this->Form->create($address) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add Address') ?></legend>
|
||||
<?= $this->element('Addresses/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
47
templates/Addresses/edit.php
Normal file
47
templates/Addresses/edit.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $cities
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $states
|
||||
* @var string[]|\Cake\Collection\CollectionInterface $countries
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
[
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'delete',
|
||||
$address->id,
|
||||
],
|
||||
[
|
||||
'confirm' => __('Are you sure you want to delete # {0}?', $address->id),
|
||||
'class' => 'side-nav-item',
|
||||
]
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Addresses'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'index',
|
||||
], [
|
||||
'class' => 'side-nav-item',
|
||||
]) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses form content">
|
||||
<?= $this->Form->create($address) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit Address') ?></legend>
|
||||
<?= $this->element('Addresses/form'); ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
89
templates/Addresses/index.php
Normal file
89
templates/Addresses/index.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\Cake\Datasource\EntityInterface|\CakeAddresses\Model\Entity\Address> $addresses
|
||||
*/
|
||||
?>
|
||||
<div class="addresses index content">
|
||||
<?= $this->Html->link(__('New Address'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'add'
|
||||
], [
|
||||
'class' => 'button float-right'
|
||||
]) ?>
|
||||
<h3><?= __('Addresses') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('address_name') ?></th>
|
||||
<th><?= $this->Paginator->sort('contact_name') ?></th>
|
||||
<th><?= $this->Paginator->sort('address_line1') ?></th>
|
||||
<th><?= $this->Paginator->sort('address_line2') ?></th>
|
||||
<th><?= $this->Paginator->sort('city') ?></th>
|
||||
<th><?= $this->Paginator->sort('city_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('state') ?></th>
|
||||
<th><?= $this->Paginator->sort('state_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('postal_code') ?></th>
|
||||
<th><?= $this->Paginator->sort('country') ?></th>
|
||||
<th><?= $this->Paginator->sort('country_id') ?></th>
|
||||
<th><?= $this->Paginator->sort('phone_number') ?></th>
|
||||
<th><?= $this->Paginator->sort('email') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($addresses as $address): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($address->id) ?></td>
|
||||
<td><?= h($address->address_name) ?></td>
|
||||
<td><?= h($address->contact_name) ?></td>
|
||||
<td><?= h($address->address_line1) ?></td>
|
||||
<td><?= h($address->address_line2) ?></td>
|
||||
<td><?= h($address->city) ?></td>
|
||||
<td><?= $address->hasValue('city_entity') ? $this->Html->link($address->city_entity->name, ['controller' => 'Cities', 'action' => 'view', $address->city_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->state) ?></td>
|
||||
<td><?= $address->hasValue('state_entity') ? $this->Html->link($address->state_entity->name, ['controller' => 'States', 'action' => 'view', $address->state_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->postal_code) ?></td>
|
||||
<td><?= h($address->country) ?></td>
|
||||
<td><?= $address->hasValue('country_entity') ? $this->Html->link($address->country_entity->name, ['controller' => 'Countries', 'action' => 'view', $address->country_entity->id]) : '' ?></td>
|
||||
<td><?= h($address->phone_number) ?></td>
|
||||
<td><?= h($address->email) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'view',
|
||||
$address->id,
|
||||
]); ?>
|
||||
<?= $this->Html->link(__('Edit'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'edit',
|
||||
$address->id,
|
||||
]) ?>
|
||||
<?= $this->Form->postLink(__('Delete'), [
|
||||
'plugin' => 'CakeAddresses',
|
||||
'controller' => 'Addresses',
|
||||
'action' => 'delete',
|
||||
$address->id,
|
||||
], ['confirm' => __('Are you sure you want to delete # {0}?', $address->id)]) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
86
templates/Addresses/view.php
Normal file
86
templates/Addresses/view.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \Cake\Datasource\EntityInterface $address
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Address'), ['action' => 'edit', $address->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Address'), ['action' => 'delete', $address->id], ['confirm' => __('Are you sure you want to delete # {0}?', $address->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Addresses'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Address'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="addresses view content">
|
||||
<h3><?= h($address->address_line1) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Address Name') ?></th>
|
||||
<td><?= h($address->address_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Contact Name') ?></th>
|
||||
<td><?= h($address->contact_name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Address Line1') ?></th>
|
||||
<td><?= h($address->address_line1) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Address Line2') ?></th>
|
||||
<td><?= h($address->address_line2) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('City') ?></th>
|
||||
<td><?= h($address->city) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('City') ?></th>
|
||||
<td><?= $address->hasValue('city_entity') ? $this->Html->link($address->city_entity->name, ['controller' => 'Cities', 'action' => 'view', $address->city_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State') ?></th>
|
||||
<td><?= h($address->state) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('State') ?></th>
|
||||
<td><?= $address->hasValue('state_entity') ? $this->Html->link($address->state_entity->name, ['controller' => 'States', 'action' => 'view', $address->state_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Postal Code') ?></th>
|
||||
<td><?= h($address->postal_code) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= h($address->country) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Country') ?></th>
|
||||
<td><?= $address->hasValue('country_entity') ? $this->Html->link($address->country_entity->name, ['controller' => 'Countries', 'action' => 'view', $address->country_entity->id]) : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Phone Number') ?></th>
|
||||
<td><?= h($address->phone_number) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Email') ?></th>
|
||||
<td><?= h($address->email) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($address->id) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Notes') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($address->notes)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user