Added a page to view info about an item

This commit is contained in:
2022-11-02 23:23:20 -04:00
parent 1b46e7c3fb
commit 4a0241dd2b
4 changed files with 49 additions and 1 deletions

View File

@ -39,7 +39,7 @@
<tbody>
{% for item in inventory %}
<tr>
<td>{{ item.name }}</td>
<td><a href="/item/{{ item.id }}">{{ item.name }}</a></td>
<td>{{ item.manufacturer }}</td>
<td>{{ item.type }}</td>
</tr>

36
views/item/view.twig Normal file
View File

@ -0,0 +1,36 @@
{% extends 'layout.twig' %}
{% block title %}{{ item.name }}{% endblock %}
{% block content %}
<!-- page header -->
<header class="row">
<div class="columns twelve">
<h1>{{ item.name }}</h1>
</div>
</header>
<!-- item information -->
<section class="row">
<table class="columns twelve">
<thead>
<tr>
<th>Name</th>
<th>Manufacturer</th>
<th>Type</th>
<th>Created date</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{ item.name }}</td>
<td>{{ item.manufacturer }}</td>
<td>{{ item.type }}</td>
<td>{{ item.createdAt | date("m/d/Y h:i:s A") }}</td>
</tr>
</tbody>
</table>
</section>
{% endblock %}