Add project
This commit is contained in:
40
templates/Tools/add.php
Normal file
40
templates/Tools/add.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Tool $tool
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Operacje') ?></h4>
|
||||
<?= $this->Html->link(__('Powrót'),
|
||||
['action' => 'index'],
|
||||
['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="tools form content">
|
||||
<?= $this->Form->create($tool) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Dodawanie narzędzia') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name',
|
||||
['label'=>'Nazwa',
|
||||
'placeholder'=>'Wpisz nazwę']);
|
||||
echo $this->Form->control('description',
|
||||
['label'=>'Opis',
|
||||
'placeholder'=>'Dowolny opis']);
|
||||
echo $this->Form->control('quantity',
|
||||
['label'=>'Ilość',
|
||||
'default'=>1]);
|
||||
echo $this->Form->control('active',
|
||||
['label'=>'Aktywny',
|
||||
'default'=>true]);
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Zapisz')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
40
templates/Tools/edit.php
Normal file
40
templates/Tools/edit.php
Normal file
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Tool $tool
|
||||
*/
|
||||
?>
|
||||
<<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Operacje') ?></h4>
|
||||
<?= $this->Html->link(__('Powrót'),
|
||||
['action' => 'index'],
|
||||
['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="tools form content">
|
||||
<?= $this->Form->create($tool) ?>
|
||||
<fieldset>
|
||||
<legend><?= __('Dodawanie narzędzia') ?></legend>
|
||||
<?php
|
||||
echo $this->Form->control('name',
|
||||
['label' => 'Nazwa',
|
||||
'placeholder' => 'Wpisz nazwę']);
|
||||
echo $this->Form->control('description',
|
||||
['label'=>'Opis',
|
||||
'placeholder'=>'Dowolny opis']);
|
||||
echo $this->Form->control('quantity',
|
||||
['label'=>'Ilość',
|
||||
'default'=>1]);
|
||||
echo $this->Form->control('active',
|
||||
['label'=>'Aktywny',
|
||||
'default'=>true]);
|
||||
?>
|
||||
</fieldset>
|
||||
<?= $this->Form->button(__('Zapisz')) ?>
|
||||
<?= $this->Form->end() ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
62
templates/Tools/index.php
Normal file
62
templates/Tools/index.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var iterable<\App\Model\Entity\Tool> $tools
|
||||
*/
|
||||
?>
|
||||
<div class="tools index content">
|
||||
<?= $this->Html->link(__('Dodaj nowe'),
|
||||
['action' => 'add'],
|
||||
['class' => 'button float-right'])
|
||||
?>
|
||||
<h3><?= __('Lista narzedzi') ?></h3>
|
||||
<div class="table-responsive">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><?= $this->Paginator->sort('id') ?></th>
|
||||
<th><?= $this->Paginator->sort('name','Nazwa') ?></th>
|
||||
<th><?= $this->Paginator->sort('quantity','Ilość') ?></th>
|
||||
<th><?= $this->Paginator->sort('active','Aktywne') ?></th>
|
||||
<th><?= $this->Paginator->sort('created','Utworzono') ?></th>
|
||||
<th><?= $this->Paginator->sort('modified','Zmodyfikowano') ?></th>
|
||||
<th class="actions"><?= __('Operacje') ?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($tools as $tool): ?>
|
||||
<tr>
|
||||
<td><?= $this->Number->format($tool->id) ?></td>
|
||||
<td><?= h($tool->name) ?></td>
|
||||
<td><?= $this->Number->format($tool->quantity) ?></td>
|
||||
<td><?= h($tool->active) ?></td>
|
||||
<td><?= $tool->created ? $tool->created->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
|
||||
<td><?= $tool->modified ? $tool->modified->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
|
||||
<td class="actions">
|
||||
<?= $this->Html->link(__('Podgląd'),
|
||||
['action' => 'view', $tool->id]) ?>
|
||||
<?= $this->Html->link(__('Edytuj'),
|
||||
['action' => 'edit', $tool->id]) ?>
|
||||
<?= $this->Form->postLink( __('Usuń'),
|
||||
['action' => 'delete', $tool->id],
|
||||
['method' => 'delete',
|
||||
'confirm' => __('Na pewno usunąć {0}?', $tool->name),])
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="paginator">
|
||||
<ul class="pagination">
|
||||
<?= $this->Paginator->first('<< ' . __('pierwszy')) ?>
|
||||
<?= $this->Paginator->prev('< ' . __('poprzedni')) ?>
|
||||
<?= $this->Paginator->numbers() ?>
|
||||
<?= $this->Paginator->next(__('następny') . ' >') ?>
|
||||
<?= $this->Paginator->last(__('ostatni') . ' >>') ?>
|
||||
</ul>
|
||||
<p><?= $this->Paginator->counter(__('Strona {{page}} z {{pages}},
|
||||
widok {{current}} rekordów z {{count}}')) ?></p>
|
||||
</div>
|
||||
</div>
|
||||
58
templates/Tools/view.php
Normal file
58
templates/Tools/view.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\Tool $tool
|
||||
*/
|
||||
?>
|
||||
<div class="row">
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Operacje') ?></h4>
|
||||
<?= $this->Html->link(__('Edytuj narzędzie'),
|
||||
['action' => 'edit', $tool->id],
|
||||
['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Usuń'),
|
||||
['action' => 'delete', $tool->id],
|
||||
['confirm' => __('Na pewno usunąć {0}?', $tool->name), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('Powrót'),
|
||||
['action' => 'index'],
|
||||
['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('Dodaj'),
|
||||
['action' => 'add'],
|
||||
['class' => 'side-nav-item']) ?>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="column column-80">
|
||||
<div class="tools view content">
|
||||
<h3><?= h($tool->name) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Nazwa') ?></th>
|
||||
<td><?= h($tool->name) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Ilość') ?></th>
|
||||
<td><?= $this->Number->format($tool->quantity) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Utworzono') ?></th>
|
||||
<td><?= $tool->created ? $tool->created->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Zmodyfikowano') ?></th>
|
||||
<td><?= $tool->modified ? $tool->modified->i18nFormat('dd.MM.yyyy HH:mm') : '' ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Aktywne') ?></th>
|
||||
<td><?= $tool->active ? __('Tak') : __('Nie'); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="text">
|
||||
<strong><?= __('Opis') ?></strong>
|
||||
<blockquote>
|
||||
<?= $this->Text->autoParagraph(h($tool->description)); ?>
|
||||
</blockquote>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user