You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
inventory-app/templates/item/item.html

93 lines
2.9 KiB

{% extends "main.html" %}
{% block title %} Items {% endblock %}
{% block content %}
<div class="relative h-auto mx-auto max-w-[68.75rem] w-[95vw] px-4 py-4">
<h2 class="mb-4 flex items-center text-4xl font-extrabold">
{{item.name}} {% if !item.active %}
<span
class="me-2 ms-2 rounded border border-cerise bg-orchid-pink px-2.5 py-0.5 text-2xl font-semibold text-cerise"
>
Inactive
</span>
{% endif %}
</h2>
<section
hx-get="/item/{{item_id}}/stats"
hx-trigger="load"
hx-swap="outerHTML"
></section>
{% if item.active %}
<section class="mx-auto mb-5">
<div class="flex justify-evenly">
<button
class="mb-2 me-2 rounded-lg bg-paynes-gray px-5 py-2.5 text-sm font-medium text-slate-100 hover:bg-dark-cyan focus:outline-none focus:ring-4 focus:ring-dark-cyan"
@click="showSidebar('negative-adjustment-form')"
>
Minus
</button>
<button
class="mb-2 me-2 rounded-lg bg-paynes-gray px-5 py-2.5 text-sm font-medium text-slate-100 hover:bg-dark-cyan focus:outline-none focus:ring-4 focus:ring-dark-cyan"
@click="showSidebar('positive-adjustment-form')"
>
Plus
</button>
<button
class="mb-2 me-2 rounded-lg bg-paynes-gray px-5 py-2.5 text-sm font-medium text-slate-100 hover:bg-dark-cyan focus:outline-none focus:ring-4 focus:ring-dark-cyan"
@click="showSidebar('item-edit-form')"
>
Edit
</button>
</div>
</section>
{% endif %}
<section class="mx-auto">
<div
hx-get="/item/{{item_id}}/adjustments"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</section>
</div>
{% endblock %}
{% block sidebar_title %}
<h2 class="text-lg font-semibold uppercase" x-show="sidebar.content === 'negative-adjustment-form'">Negative Adjustment</h2>
<h2 class="text-lg font-semibold uppercase" x-show="sidebar.content === 'positive-adjustment-form'">Positive Adjustment</h2>
<h2 class="text-lg font-semibold uppercase" x-show="sidebar.content === 'item-edit-form'">Edit</h2>
{% endblock %}
{% block sidebar_content %}
<div x-on:form-submit-success="hideSidebar()">
<div x-show="sidebar.content === 'positive-adjustment-form'">
<div
hx-get="/item/{{item_id}}/adjustment/positive"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
<div x-show="sidebar.content === 'negative-adjustment-form'">
<div
hx-get="/item/{{item_id}}/adjustment/negative"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
<div x-show="sidebar.content === 'item-edit-form'">
<div
hx-get="/item/{{item_id}}/edit"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
</div>
{% endblock %}

Powered by TurnKey Linux.