vibe
This commit is contained in:
parent
837cfb6d43
commit
939840a3ac
76 changed files with 6636 additions and 83 deletions
38
templates/base.html.twig
Normal file
38
templates/base.html.twig
Normal file
|
@ -0,0 +1,38 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
{% block stylesheets %}
|
||||
<link rel="stylesheet" href="/assets/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="/assets/css/styles.css">
|
||||
{% endblock %}
|
||||
|
||||
{% block javascripts %}
|
||||
<script src="/assets/js/app.js"></script>
|
||||
<script src="/assets/js/bootstrap.bundle.min.js"></script>
|
||||
{% endblock %}
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="/">{{ appName }}</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||||
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/">Home</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container mt-4">
|
||||
{% block body %}{% endblock %}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
4
templates/drink_type/_delete_form.html.twig
Normal file
4
templates/drink_type/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_drink_type_delete', {'id': drink_type.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ drink_type.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/drink_type/_form.html.twig
Normal file
4
templates/drink_type/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/drink_type/edit.html.twig
Normal file
13
templates/drink_type/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit DrinkType{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit DrinkType</h1>
|
||||
|
||||
{{ include('drink_type/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_drink_type_index') }}">back to list</a>
|
||||
|
||||
{{ include('drink_type/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
46
templates/drink_type/index.html.twig
Normal file
46
templates/drink_type/index.html.twig
Normal file
|
@ -0,0 +1,46 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}DrinkType index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>DrinkType index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>CreatedAt</th>
|
||||
<th>UpdatedAt</th>
|
||||
<th>Name</th>
|
||||
<th>Description</th>
|
||||
<th>DesiredStock</th>
|
||||
<th>DrinkStock</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for drink_stock in drink_stocks %}
|
||||
{% set drink_type = drink_stock.record.drinkType %}
|
||||
<tr>
|
||||
<td>{{ drink_type.id }}</td>
|
||||
<td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ drink_type.name }}</td>
|
||||
<td>{{ drink_type.description }}</td>
|
||||
<td>{{ drink_type.desiredStock }}</td>
|
||||
<td>{{ drink_stock.record.quantity }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_drink_type_show', {'id': drink_type.id}) }}">show</a>
|
||||
<a href="{{ path('app_drink_type_edit', {'id': drink_type.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="7">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_drink_type_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/drink_type/new.html.twig
Normal file
11
templates/drink_type/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New DrinkType{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new DrinkType</h1>
|
||||
|
||||
{{ include('drink_type/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_drink_type_index') }}">back to list</a>
|
||||
{% endblock %}
|
42
templates/drink_type/show.html.twig
Normal file
42
templates/drink_type/show.html.twig
Normal file
|
@ -0,0 +1,42 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}DrinkType{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>DrinkType</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ drink_type.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CreatedAt</th>
|
||||
<td>{{ drink_type.createdAt ? drink_type.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>UpdatedAt</th>
|
||||
<td>{{ drink_type.updatedAt ? drink_type.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ drink_type.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Description</th>
|
||||
<td>{{ drink_type.description }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>DesiredStock</th>
|
||||
<td>{{ drink_type.desiredStock }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_drink_type_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_drink_type_edit', {'id': drink_type.id}) }}">edit</a>
|
||||
|
||||
{{ include('drink_type/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
50
templates/index.html.twig
Normal file
50
templates/index.html.twig
Normal file
|
@ -0,0 +1,50 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Inventory Overview{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container">
|
||||
<h1>Drink Inventory</h1>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title">Drink Inventory Overview</h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Drink Name</th>
|
||||
<th>Current Stock</th>
|
||||
<th>Desired Stock</th>
|
||||
<th>Status</th>
|
||||
<th>Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for drinkStock in drinkStocks %}
|
||||
{% set rowClass = '' %}
|
||||
{% if drinkStock.stock.value == 'critical' %}
|
||||
{% set rowClass = 'table-danger' %}
|
||||
{% elseif drinkStock.stock.value == 'low' %}
|
||||
{% set rowClass = 'table-warning' %}
|
||||
{% elseif drinkStock.stock.value == 'high' %}
|
||||
{% set rowClass = 'table-success' %}
|
||||
{% endif %}
|
||||
<tr class="{{ rowClass }}">
|
||||
<td>{{ drinkStock.record.drinkType.name }}</td>
|
||||
<td>{{ drinkStock.record.quantity }}</td>
|
||||
<td>{{ drinkStock.record.drinkType.desiredStock }}</td>
|
||||
<td>{{ drinkStock.stock.value|capitalize }}</td>
|
||||
<td>{{ drinkStock.record.drinkType.description }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="mt-3">
|
||||
<a href="{{ path('app_drink_type_index') }}" class="btn btn-primary">View All Drinks</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue