Initial commit: CakePHP project
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
Some checks failed
Mark stale issues and pull requests / stale (push) Has been cancelled
This commit is contained in:
29
templates/Users/add.php
Normal file
29
templates/Users/add.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\User $user
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('List Users'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="users form content">
|
||||
<?= $this->Form->create($user) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Add User') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('email');
|
||||
echo $this->Form->control('password');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
34
templates/Users/edit.php
Normal file
34
templates/Users/edit.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\User $user
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $user->id],
|
||||
['confirm' => __('Are you sure you want to delete # {0}?', $user->id), 'class' => 'side-nav-item']
|
||||
) ?>
|
||||
<?= $this->Html->link(__('List Users'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="users form content">
|
||||
<?= $this->Form->create($user) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Edit User') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('email');
|
||||
echo $this->Form->control('password');
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Submit')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
57
templates/Users/index.php
Normal file
57
templates/Users/index.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\App\Model\Entity\User> $users
|
||||
*/
|
||||
?>
|
||||
<div class="users index content">
|
||||
<?= $this->Html->link(__('New User'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||
<h3><?= __('Users') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name') ?></th>
|
||||
<th><?= $this->Paginator->sort('email') ?></th>
|
||||
<th><?= $this->Paginator->sort('created') ?></th>
|
||||
<th><?= $this->Paginator->sort('modified') ?></th>
|
||||
<th class="actions"><?= __('Actions') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($user->id) ?></td>
|
||||
<td><?= h($user->name) ?></td>
|
||||
<td><?= h($user->email) ?></td>
|
||||
<td><?= h($user->created) ?></td>
|
||||
<td><?= h($user->modified) ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('View'), ['action' => 'view', $user->id]) ?>
|
||||
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $user->id]) ?>
|
||||
<?= $this->Form->postLink(
|
||||
__('Delete'),
|
||||
['action' => 'delete', $user->id],
|
||||
[
|
||||
'method' => 'delete',
|
||||
'confirm' => __('Are you sure you want to delete # {0}?', $user->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>
|
||||
15
templates/Users/login.php
Normal file
15
templates/Users/login.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
*/
|
||||
?>
|
||||
<div class="users form content">
|
||||
<?= $this->Form->create() ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Strona Logowania') ?></legend>
|
||||
<?= $this->Form->control('email',['label'=>'Nazwa użytkownika']) ?>
|
||||
<?= $this->Form->control('password',['label'=>'Hasło']) ?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Zaloguj')); ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
44
templates/Users/view.php
Normal file
44
templates/Users/view.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\User $user
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit User'), ['action' => 'edit', $user->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete User'), ['action' => 'delete', $user->id], ['confirm' => __('Are you sure you want to delete # {0}?', $user->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Users'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New User'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="users view content">
|
||||
<h3><?= h($user->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Name') ?></th>
|
||||
<td><?= h($user->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Email') ?></th>
|
||||
<td><?= h($user->email) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= $this->Number->format($user->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Created') ?></th>
|
||||
<td><?= h($user->created) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Modified') ?></th>
|
||||
<td><?= h($user->modified) ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user