demo-mode
Wes Holland 1 year ago
parent d3364af395
commit d219c136c0

@ -1,10 +1,6 @@
{% extends "problem.html" %} {% extends "problem.html" %} {% block content %}
{% block content %}
<h1>Error</h1> <h1>Error</h1>
<p> <p>Oops, something went wrong. Press the back button to try again.</p>
Oops, something went wrong. Press the back button to try again.
</p>
{% endblock %} {% endblock %}

@ -1,36 +1,50 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Items {% endblock %} {% block
content %}
{% block title %} Items {% endblock %} <div class="mx-auto mb-4 px-4">
<label
{% block content %} for="item-filter"
class="sr-only mb-2 text-sm font-medium text-gray-900 dark:text-white"
<div class="mx-auto px-4 mb-4"> >Search</label
<label for="item-filter" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label> >
<div class="relative content-center mb-4 max-w-56"> <div class="relative mb-4 max-w-56 content-center">
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none"> <div
<svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3"
fill="none" viewBox="0 0 20 20"> >
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <svg
d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/> class="h-4 w-4 text-gray-500 dark:text-gray-400"
</svg> aria-hidden="true"
</div> xmlns="http://www.w3.org/2000/svg"
<input id="item-filter" fill="none"
class="block w-full p-4 ps-10 text-sm bg-slate-100 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100 border border-gray-300 rounded-lg focus:ring-paynes-gray focus:border-paynes-gray" viewBox="0 0 20 20"
type="search" name="q" >
placeholder="Filter" <path
aria-label="Filter" stroke="currentColor"
value='{{ query.search.as_deref().unwrap_or("") }}' stroke-linecap="round"
hx-get="/items" stroke-linejoin="round"
hx-trigger="search, keyup delay:500ms changed" stroke-width="2"
hx-target="#items" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
hx-push-url="true"
/> />
</svg>
</div> </div>
<input
id="item-filter"
class="block w-full rounded-lg border border-gray-300 bg-slate-100 p-4 ps-10 text-sm text-neutral-900 focus:border-paynes-gray focus:ring-paynes-gray dark:bg-neutral-900 dark:text-slate-100"
type="search"
name="q"
placeholder="Filter"
aria-label="Filter"
value='{{ query.search.as_deref().unwrap_or("") }}'
hx-get="/items"
hx-trigger="search, keyup delay:500ms changed"
hx-target="#items"
hx-push-url="true"
/>
</div>
<div id="items" class="container"> <div id="items" class="container">
{% include "catalog_item_fragment.html" %} {% include "catalog_item_fragment.html" %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

@ -1,10 +1,13 @@
<div class="mx-auto "> <div class="mx-auto">
<div class="flex flex-col"> <div class="flex flex-col">
{% for item in items %} {% for item in items %}
<div class="mb-4 mx-1 flex flex-row"> <div class="mx-1 mb-4 flex flex-row">
<div class="basis-1/2"> <div class="basis-1/2">
<a class="font-medium text-paynes-gray dark:text-paynes-gray hover:underline" <a
href="/item/{{item.id}}/" hx-push-url="true"> class="font-medium text-paynes-gray hover:underline dark:text-paynes-gray"
href="/item/{{item.id}}/"
hx-push-url="true"
>
{{ item.name }} {{ item.name }}
</a> </a>
</div> </div>

@ -1,11 +1,10 @@
{% extends "problem.html" %} {% extends "problem.html" %} {% block content %}
{% block content %}
<h1>Forbidden</h1> <h1>Forbidden</h1>
<p> <p>
You are forbidden from accessing this resource. Please contact your supervisor or <a href="/auth/logout">logout</a> You are forbidden from accessing this resource. Please contact your supervisor
and log back in with a different user. or <a href="/auth/logout">logout</a>
and log back in with a different user.
</p> </p>
{% endblock %} {% endblock %}

@ -1,38 +1,64 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Audit Log {% endblock %} {% block
content %}
{% block title %} Audit Log {% endblock %}
{% block content %}
<h1>Audit Log (Coming soon)</h1> <h1>Audit Log (Coming soon)</h1>
<section class="container mb-4"> <section class="container mb-4">
<form action="/history" hx-get="/history" hx-trigger="change" hx-target="#items"> <form
<div class="row"> action="/history"
<div class="col-sm-2"> hx-get="/history"
<label for="start-date" class="form-label">Start Date</label> hx-trigger="change"
<input type="date" id="start-date" name="start-date" value="{{ start_date }}" class="form-control" /> hx-target="#items"
</div> >
<div class="col-sm-2"> <div class="row">
<label for="start-time" class="form-label">Start Time</label> <div class="col-sm-2">
<input type="time" id="start-time" name="start-time" value="{{ start_time }}" class="form-control"/> <label for="start-date" class="form-label">Start Date</label>
<small class="form-text">Timezone {{ time_zone }}</small> <input
</div> type="date"
<div class="col-sm-2"> id="start-date"
<label for="end-date" class="form-label">End Date</label> name="start-date"
<input type="date" id="end-date" name="end-date" value="{{ end_date }}" class="form-control"/> value="{{ start_date }}"
</div> class="form-control"
<div class="col-sm-2"> />
<label for="end-time" class="form-label">End Time</label> </div>
<input type="time" id="end-time" name="end-time" value="{{ end_time }}" class="form-control"/> <div class="col-sm-2">
<small class="form-text">Timezone {{ time_zone }}</small> <label for="start-time" class="form-label">Start Time</label>
</div> <input
</div> type="time"
</form> id="start-time"
name="start-time"
value="{{ start_time }}"
class="form-control"
/>
<small class="form-text">Timezone {{ time_zone }}</small>
</div>
<div class="col-sm-2">
<label for="end-date" class="form-label">End Date</label>
<input
type="date"
id="end-date"
name="end-date"
value="{{ end_date }}"
class="form-control"
/>
</div>
<div class="col-sm-2">
<label for="end-time" class="form-label">End Time</label>
<input
type="time"
id="end-time"
name="end-time"
value="{{ end_time }}"
class="form-control"
/>
<small class="form-text">Timezone {{ time_zone }}</small>
</div>
</div>
</form>
</section> </section>
<section id="items" class="container"> <section id="items" class="container">
{% include "history_item_fragment.html" %} {% include "history_item_fragment.html" %}
</section> </section>
{% endblock %} {% endblock %}

@ -1,4 +1,3 @@
<div class="card"> <div class="card">
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for item in items %} {% for item in items %}
@ -8,15 +7,14 @@
<p class="col">{{ item.item_name }}</p> <p class="col">{{ item.item_name }}</p>
<p class="col">{{ item.user_name }}</p> <p class="col">{{ item.user_name }}</p>
<p class="col"> <p class="col">
{% match item.item_type %} {% match item.item_type %} {% when
{% when HistoryItemEntry::PositiveAdjustment with (entry) %} HistoryItemEntry::PositiveAdjustment with (entry) %} {{ entry.amount
{{ entry.amount }} @ {{ entry.unit_value }} }} @ {{ entry.unit_value }} {% when
{% when HistoryItemEntry::NegativeAdjustment with (entry) %} HistoryItemEntry::NegativeAdjustment with (entry) %} {{ entry.amount
{{ entry.amount }} {{ entry.reason }} }} {{ entry.reason }} {% endmatch %}
{% endmatch %}
</p> </p>
</div> </div>
</li> </li>
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>

@ -1,35 +1,50 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Home {% endblock %} {% block content
%}
{% block title %} Home {% endblock %} <div class="mx-auto mb-4 px-4">
<label
{% block content %} for="default-search"
class="sr-only mb-2 text-sm font-medium text-gray-900 dark:text-white"
<div class="mx-auto px-4 mb-4"> >Search</label
<label for="default-search" class="mb-2 text-sm font-medium text-gray-900 sr-only dark:text-white">Search</label> >
<div class="relative content-center mb-4 max-w-56"> <div class="relative mb-4 max-w-56 content-center">
<div class="absolute inset-y-0 start-0 flex items-center ps-3 pointer-events-none"> <div
<svg class="w-4 h-4 text-gray-500 dark:text-gray-400" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" class="pointer-events-none absolute inset-y-0 start-0 flex items-center ps-3"
fill="none" viewBox="0 0 20 20"> >
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" <svg
d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"/> class="h-4 w-4 text-gray-500 dark:text-gray-400"
</svg> aria-hidden="true"
</div> xmlns="http://www.w3.org/2000/svg"
<input id="default-search" fill="none"
class="block w-full p-4 ps-10 text-sm bg-slate-100 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100 border border-gray-300 rounded-lg focus:ring-paynes-gray focus:border-paynes-gray" viewBox="0 0 20 20"
type="search" name="q" >
placeholder="Search" <path
aria-label="Search" stroke="currentColor"
value='{{ query.search.as_deref().unwrap_or("") }}' stroke-linecap="round"
hx-get="/home/search" stroke-linejoin="round"
hx-trigger="search, keyup delay:500ms changed" stroke-width="2"
hx-target="#items" d="m19 19-4-4m0-7A7 7 0 1 1 1 8a7 7 0 0 1 14 0Z"
hx-push-url="true"
/> />
</svg>
</div> </div>
<input
id="default-search"
class="block w-full rounded-lg border border-gray-300 bg-slate-100 p-4 ps-10 text-sm text-neutral-900 focus:border-paynes-gray focus:ring-paynes-gray dark:bg-neutral-900 dark:text-slate-100"
type="search"
name="q"
placeholder="Search"
aria-label="Search"
value='{{ query.search.as_deref().unwrap_or("") }}'
hx-get="/home/search"
hx-trigger="search, keyup delay:500ms changed"
hx-target="#items"
hx-push-url="true"
/>
</div>
<div id="items" class="container"> <div id="items" class="container">
{% include "home_search_item_fragment.html" %} {% include "home_search_item_fragment.html" %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

@ -1,22 +1,29 @@
{% if items.len() > 0 %} {% if items.len() > 0 %}
<div class="mx-auto "> <div class="mx-auto">
<div class="flex flex-col"> <div class="flex flex-col">
{% for item in items %} {% for item in items %}
<div class="mb-4 mx-1 flex flex-row"> <div class="mx-1 mb-4 flex flex-row">
<div class="basis-1/2"> <div class="basis-1/2">
<a class="font-medium text-paynes-gray dark:text-paynes-gray hover:underline" <a
href="/item/{{item.id}}/" hx-push-url="true"> class="font-medium text-paynes-gray hover:underline dark:text-paynes-gray"
{{ item.name }} href="/item/{{item.id}}/"
</a> hx-push-url="true"
</div> >
<div class="basis-1/4"> {{ item.name }}
Count: <span id="item-{{item.id}}-count" hx-get="/item/{{item.id}}/count" hx-trigger="load">0</span> </a>
</div> </div>
<div class="basis-1/4"> <div class="basis-1/4">
Reorder Point: {{ item.reorder_point }} Count:
</div> <span
</div> id="item-{{item.id}}-count"
{% endfor %} hx-get="/item/{{item.id}}/count"
hx-trigger="load"
>0</span
>
</div>
<div class="basis-1/4">Reorder Point: {{ item.reorder_point }}</div>
</div> </div>
{% endfor %}
</div>
</div> </div>
{% endif %} {% endif %}

@ -1,25 +1,31 @@
<table
<table class="w-full text-sm text-left rtl:text-right" hx-get="/item/{{item_id}}/adjustments" hx-trigger="new-adjustment from:body" hx-swap="outerHTML"> class="w-full text-left text-sm rtl:text-right"
<thead class="text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> hx-get="/item/{{item_id}}/adjustments"
hx-trigger="new-adjustment from:body"
hx-swap="outerHTML"
>
<thead
class="bg-gray-50 text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400"
>
<tr> <tr>
<th class="px-6 py-3" scope="col">Date</th> <th class="px-6 py-3" scope="col">Date</th>
<th class="px-6 py-3" scope="col">Amount</th> <th class="px-6 py-3" scope="col">Amount</th>
<th class="px-6 py-3" scope="col">Reason</th> <th class="px-6 py-3" scope="col">Reason</th>
<th class="px-6 py-3" scope="col">Unit Value</th> <th class="px-6 py-3" scope="col">Unit Value</th>
<th class="px-6 py-3" scope="col">Running Total</th> <th class="px-6 py-3" scope="col">Running Total</th>
<th class="px-6 py-3" scope="col">Running Value</th> <th class="px-6 py-3" scope="col">Running Value</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for item in adjustments %} {% for item in adjustments %}
<tr> <tr>
<td class="px-6 py-4">{{ item.date }}</td> <td class="px-6 py-4">{{ item.date }}</td>
<td class="px-6 py-4">{{ item.amount }}</td> <td class="px-6 py-4">{{ item.amount }}</td>
<td class="px-6 py-4">{{ item.reason }}</td> <td class="px-6 py-4">{{ item.reason }}</td>
<td class="px-6 py-4">{{ item.unit_value }}</td> <td class="px-6 py-4">{{ item.unit_value }}</td>
<td class="px-6 py-4">{{ item.tally }}</td> <td class="px-6 py-4">{{ item.tally }}</td>
<td class="px-6 py-4">{{ item.tally_value }}</td> <td class="px-6 py-4">{{ item.tally_value }}</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>

@ -1,82 +1,119 @@
<form hx-post="/item/{{item_id}}/adjustment/negative" <form
hx-target="this" hx-swap="outerHTML" hx-post="/item/{{item_id}}/adjustment/negative"
x-ref="formNegativeAdjustment" hx-target="this"
x-data="{ reason: 'Sale', reason_dropdown_show: false }"> hx-swap="outerHTML"
<div class="mb-5"> x-ref="formNegativeAdjustment"
<label for="amount" class="block mb-2 text-sm font-medium">Amount</label> x-data="{ reason: 'Sale', reason_dropdown_show: false }"
<input type="number" >
id="amount" <div class="mb-5">
name="amount" <label for="amount" class="mb-2 block text-sm font-medium">Amount</label>
step="0.01" <input
class="border border-neutral-900 text-neutral-900 dark:text-slate-100 text-sm rounded-lg focus:ring-paynes-gray focus:border-paynes-gray block max-w-56 p-2.5" type="number"
placeholder="Amount" id="amount"
aria-label="amount" name="amount"
required step="0.01"
{% if !amount_error.is_empty() -%} class="block max-w-56 rounded-lg border border-neutral-900 p-2.5 text-sm text-neutral-900 focus:border-paynes-gray focus:ring-paynes-gray dark:text-slate-100"
aria-invalid="true" placeholder="Amount"
aria-describedby="invalid-amount" aria-label="amount"
{% endif -%} required
/> {%
{% if !amount_error.is_empty() -%} if
<small id="invalid-amount" class="mt-2 text-sm text-cerise"> !amount_error.is_empty()
{{ amount_error }} -%}
</small> aria-invalid="true"
{% endif -%} aria-describedby="invalid-amount"
{%
endif
-%}
/>
{% if !amount_error.is_empty() -%}
<small id="invalid-amount" class="mt-2 text-sm text-cerise">
{{ amount_error }}
</small>
{% endif -%}
</div>
<div class="mb-5 flex justify-start">
<button
class="rounded-l-lg bg-english-violet 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"
x-text="reason"
>
Sale
</button>
<div
x-data="{ isOpen: false, openedWithKeyboard: false }"
class="relative w-fit"
x-on:keydown.esc.window="isOpen = false; openedWithKeyboard = false"
>
<button
type="button"
x-on:click="isOpen = ! isOpen"
class="rounded-radius inline-flex items-center whitespace-nowrap rounded-r-lg border-l-2 border-slate-100 bg-english-violet px-3.5 py-3.5 text-sm font-medium tracking-wide text-slate-100 transition hover:bg-dark-cyan focus:outline-none focus:ring-4 focus:ring-dark-cyan dark:border-neutral-900"
aria-haspopup="true"
x-on:keydown.space.prevent="openedWithKeyboard = true"
x-on:keydown.enter.prevent="openedWithKeyboard = true"
x-on:keydown.down.prevent="openedWithKeyboard = true"
x-bind:class="isOpen || openedWithKeyboard ? 'text-on-surface-strong dark:text-on-surface-dark-strong' : 'text-on-surface dark:text-on-surface-dark'"
x-bind:aria-expanded="isOpen || openedWithKeyboard"
>
<span class="sr-only">Reason Options</span>
<svg
aria-hidden="true"
fill="none"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
stroke-width="2"
stroke="currentColor"
class="size-4 rotate-0"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
d="M19.5 8.25l-7.5 7.5-7.5-7.5"
/>
</svg>
</button>
<!-- Dropdown Menu -->
<div
x-cloak
x-show="isOpen || openedWithKeyboard"
x-transition
x-trap="openedWithKeyboard"
x-on:click.outside="isOpen = false, openedWithKeyboard = false"
x-on:keydown.down.prevent="$focus.wrap().next()"
x-on:keydown.up.prevent="$focus.wrap().previous()"
class="rounded-radius border-outline absolute left-0 top-11 flex w-fit min-w-48 flex-col overflow-hidden border border-neutral-900 bg-slate-100 dark:border-slate-100 dark:bg-neutral-900"
role="menu"
>
<a
class="focus-visible:outline-hidden px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold"
role="menuitem"
@click="reason = 'Sale'; isOpen = false"
>
Sale
</a>
<a
class="focus-visible:outline-hidden px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold"
role="menuitem"
@click="reason = 'Destruction'; isOpen = false"
>
Destruction
</a>
<a
class="focus-visible:outline-hidden px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold"
role="menuitem"
@click="reason = 'Expiration'; isOpen = false"
>
Expiration
</a>
<a
class="focus-visible:outline-hidden px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold"
role="menuitem"
@click="reason = 'Theft'; isOpen = false"
>
Theft
</a>
</div>
</div> </div>
<div class="mb-5 flex justify-start"> </div>
<button <input id="reason" name="reason" type="hidden" x-model="reason" />
class="text-slate-100 bg-english-violet hover:bg-dark-cyan focus:ring-4 focus:ring-dark-cyan font-medium rounded-l-lg text-sm px-5 py-2.5 focus:outline-none"
x-text="reason">
Sale
</button>
<div x-data="{ isOpen: false, openedWithKeyboard: false }"
class="relative w-fit"
x-on:keydown.esc.window="isOpen = false; openedWithKeyboard = false">
<button type="button" x-on:click="isOpen = ! isOpen"
class="text-slate-100 bg-english-violet hover:bg-dark-cyan focus:ring-4 focus:ring-dark-cyan font-medium rounded-r-lg text-sm px-3.5 py-3.5 focus:outline-none inline-flex items-center whitespace-nowrap rounded-radius border-l-2 border-slate-100 dark:border-neutral-900 tracking-wide transition"
aria-haspopup="true" x-on:keydown.space.prevent="openedWithKeyboard = true"
x-on:keydown.enter.prevent="openedWithKeyboard = true"
x-on:keydown.down.prevent="openedWithKeyboard = true"
x-bind:class="isOpen || openedWithKeyboard ? 'text-on-surface-strong dark:text-on-surface-dark-strong' : 'text-on-surface dark:text-on-surface-dark'"
x-bind:aria-expanded="isOpen || openedWithKeyboard">
<span class="sr-only">Reason Options</span>
<svg aria-hidden="true" fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" class="size-4 rotate-0">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 8.25l-7.5 7.5-7.5-7.5"/>
</svg>
</button>
<!-- Dropdown Menu -->
<div x-cloak
x-show="isOpen || openedWithKeyboard"
x-transition
x-trap="openedWithKeyboard"
x-on:click.outside="isOpen = false, openedWithKeyboard = false"
x-on:keydown.down.prevent="$focus.wrap().next()"
x-on:keydown.up.prevent="$focus.wrap().previous()"
class="bg-slate-100 dark:bg-neutral-900 absolute top-11 left-0 flex w-fit min-w-48 flex-col overflow-hidden rounded-radius border border-outline border-neutral-900 dark:border-slate-100"
role="menu">
<a class="px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold focus-visible:outline-hidden"
role="menuitem"
@click="reason = 'Sale'; isOpen = false">
Sale
</a>
<a class="px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold focus-visible:outline-hidden"
role="menuitem"
@click="reason = 'Destruction'; isOpen = false">
Destruction
</a>
<a class="px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold focus-visible:outline-hidden"
role="menuitem"
@click="reason = 'Expiration'; isOpen = false">
Expiration
</a>
<a class="px-4 py-2 text-sm hover:bg-dark-cyan hover:font-semibold focus-visible:bg-dark-cyan focus-visible:font-semibold focus-visible:outline-hidden"
role="menuitem"
@click="reason = 'Theft'; isOpen = false">
Theft
</a>
</div>
</div>
</div>
<input id="reason" name="reason" type="hidden" x-model="reason"/>
</form> </form>

@ -1,47 +1,66 @@
<form
<form hx-post="/item/{{item_id}}/adjustment/positive" hx-post="/item/{{item_id}}/adjustment/positive"
hx-target="this" hx-swap="outerHTML"> hx-target="this"
<div class="mb-5"> hx-swap="outerHTML"
<label for="amount" class="block mb-2 text-sm font-medium">Amount</label> >
<input <div class="mb-5">
type="number" <label for="amount" class="mb-2 block text-sm font-medium">Amount</label>
id="amount" <input
name="amount" type="number"
class="border border-neutral-900 text-neutral-900 dark:text-slate-100 text-sm rounded-lg focus:ring-paynes-gray focus:border-paynes-gray block max-w-56 p-2.5" id="amount"
step="0.01" name="amount"
placeholder="Amount" class="block max-w-56 rounded-lg border border-neutral-900 p-2.5 text-sm text-neutral-900 focus:border-paynes-gray focus:ring-paynes-gray dark:text-slate-100"
aria-label="amount" step="0.01"
required placeholder="Amount"
{% if !amount_error.is_empty() -%} aria-label="amount"
aria-invalid="true" required
aria-describedby="invalid-amount" {%
{% endif -%} if
/> !amount_error.is_empty()
{% if !amount_error.is_empty() -%} -%}
<small id="invalid-amount" class="mt-2 text-sm text-cerise"> aria-invalid="true"
{{ amount_error }} aria-describedby="invalid-amount"
</small> {%
{% endif -%} endif
</div> -%}
<div class="mb-5"> />
<label for="price" class="block mb-2 text-sm font-medium">Price</label> {% if !amount_error.is_empty() -%}
<input type="text" <small id="invalid-amount" class="mt-2 text-sm text-cerise">
id="price" {{ amount_error }}
name="price" </small>
class="border border-neutral-900 text-neutral-900 dark:text-slate-100 text-sm rounded-lg focus:ring-paynes-gray focus:border-paynes-gray block max-w-56 p-2.5" {% endif -%}
placeholder="Price" </div>
aria-label="price" <div class="mb-5">
required <label for="price" class="mb-2 block text-sm font-medium">Price</label>
{% if !price_error.is_empty() -%} <input
aria-invalid="true" type="text"
aria-describedby="invalid-price" id="price"
{% endif -%} name="price"
/> class="block max-w-56 rounded-lg border border-neutral-900 p-2.5 text-sm text-neutral-900 focus:border-paynes-gray focus:ring-paynes-gray dark:text-slate-100"
{% if !price_error.is_empty() -%} placeholder="Price"
<small id="invalid-price" class="mt-2 text-sm text-cerise">{{ price_error }}</small> aria-label="price"
{% endif -%} required
</div> {%
<div class="mb-5"> if
<button class="text-slate-100 bg-english-violet hover:bg-dark-cyan focus:ring-4 focus:ring-dark-cyan font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none">Add</button> !price_error.is_empty()
</div> -%}
aria-invalid="true"
aria-describedby="invalid-price"
{%
endif
-%}
/>
{% if !price_error.is_empty() -%}
<small id="invalid-price" class="mt-2 text-sm text-cerise"
>{{ price_error }}</small
>
{% endif -%}
</div>
<div class="mb-5">
<button
class="mb-2 me-2 rounded-lg bg-english-violet 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"
>
Add
</button>
</div>
</form> </form>

@ -1,48 +1,66 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Items {% endblock %} {% block
content %}
{% block title %} Items {% endblock %} <h2 class="mb-4 flex items-center text-4xl font-extrabold">
{{item.name}} {% if !item.active %}
{% block content %} <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"
<h2 class="flex items-center text-4xl font-extrabold mb-4"> >
{{item.name}} Inactive
{% if !item.active %} </span>
<span class="bg-orchid-pink text-cerise border border-cerise text-2xl font-semibold me-2 px-2.5 py-0.5 rounded ms-2"> {% endif %}
Inactive
</span>
{% endif %}
</h2> </h2>
<section hx-get="/item/{{item_id}}/stats" hx-trigger="load" hx-swap="outerHTML"></section> <section
hx-get="/item/{{item_id}}/stats"
hx-trigger="load"
hx-swap="outerHTML"
></section>
{% if item.active %} {% if item.active %}
<section class="mx-auto mb-5" <section
x-data="{ negative_form_open: false, positive_form_open: false }"> class="mx-auto mb-5"
<div class="flex justify-evenly"> x-data="{ negative_form_open: false, positive_form_open: false }"
<button class="text-slate-100 bg-paynes-gray hover:bg-dark-cyan focus:ring-4 focus:ring-dark-cyan font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none" >
@click="negative_form_open = ! negative_form_open"> <div class="flex justify-evenly">
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"
<button class="text-slate-100 bg-paynes-gray hover:bg-dark-cyan focus:ring-4 focus:ring-dark-cyan font-medium rounded-lg text-sm px-5 py-2.5 me-2 mb-2 focus:outline-none" @click="negative_form_open = ! negative_form_open"
@click="positive_form_open = ! positive_form_open"> >
Plus Minus
</button> </button>
</div> <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"
<div x-show="negative_form_open" @click.outside="negative_form_open = false"> @click="positive_form_open = ! positive_form_open"
<div hx-get="/item/{{item_id}}/adjustment/negative" hx-trigger="load" hx-swap="outerHTML"></div> >
</div> Plus
</button>
</div>
<div x-show="positive_form_open" @click.outside="positive_form_open = false"> <div x-show="negative_form_open" @click.outside="negative_form_open = false">
<div hx-get="/item/{{item_id}}/adjustment/positive" hx-trigger="load" hx-swap="outerHTML"></div> <div
</div> hx-get="/item/{{item_id}}/adjustment/negative"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
<div x-show="positive_form_open" @click.outside="positive_form_open = false">
<div
hx-get="/item/{{item_id}}/adjustment/positive"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</div>
</section> </section>
{% endif %} {% endif %}
<section class="mx-auto"> <section class="mx-auto">
<div hx-get="/item/{{item_id}}/adjustments" hx-trigger="load" hx-swap="outerHTML"> <div
</div> hx-get="/item/{{item_id}}/adjustments"
hx-trigger="load"
hx-swap="outerHTML"
></div>
</section> </section>
{% endblock %} {% endblock %}

@ -1,18 +1,25 @@
<section
<section hx-get="/item/{{item_id}}/stats" hx-trigger="new-adjustment from:body" hx-swap="outerHTML" class="mb-4"> hx-get="/item/{{item_id}}/stats"
<div class="flex justify-start"> hx-trigger="new-adjustment from:body"
<div class="border border-space-cadet rounded px-4 py-4 me-4"> hx-swap="outerHTML"
<p class="text-xl uppercase text-center">Stock</p> class="mb-4"
<p class="text-xl text-center">{{item.amount}} {{item.display_unit_short}}</p> >
</div> <div class="flex justify-start">
<div class="border border-space-cadet rounded px-4 py-4 me-4"> <div class="me-4 rounded border border-space-cadet px-4 py-4">
<p class="text-xl uppercase text-center">Reorder</p> <p class="text-center text-xl uppercase">Stock</p>
<p class="text-xl text-center">{{item.reorder_point}} {{item.display_unit_short}}</p> <p class="text-center text-xl">
</div> {{item.amount}} {{item.display_unit_short}}
<div class="border border-space-cadet rounded px-4 py-4 me-4"> </p>
<p class="text-xl uppercase text-center">Value</p>
<p class="text-xl text-center">{{value}}</p>
</div>
</div> </div>
<div class="me-4 rounded border border-space-cadet px-4 py-4">
<p class="text-center text-xl uppercase">Reorder</p>
<p class="text-center text-xl">
{{item.reorder_point}} {{item.display_unit_short}}
</p>
</div>
<div class="me-4 rounded border border-space-cadet px-4 py-4">
<p class="text-center text-xl uppercase">Value</p>
<p class="text-center text-xl">{{value}}</p>
</div>
</div>
</section> </section>

@ -1,6 +1,4 @@
{% extends "main.html" %} {% extends "main.html" %} {% block content %}
{% block content %}
<h1>Logged out</h1> <h1>Logged out</h1>
<p>You have been logged out</p> <p>You have been logged out</p>

@ -1,60 +1,83 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/css/main.css" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="/js/htmx.min.js"></script> <script src="/js/htmx.min.js"></script>
<!--TODO Vendor this script --> <!--TODO Vendor this script -->
<script defer src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"></script> <script
defer
src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"
></script>
<title>{% block title %}Title{% endblock %}</title> <title>{% block title %}Title{% endblock %}</title>
</head> </head>
<body class="bg-slate-100 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100 min-h-screen"> <body
<header class="bg-space-cadet font-sans mb-4 mx-auto"> class="min-h-screen bg-slate-100 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100"
<nav class="mx-auto max-w-7xl px-2 py-4 sm:px-6 lg:px-8 flex justify-between gap-2"> >
<header class="mx-auto mb-4 bg-space-cadet font-sans">
<nav
class="mx-auto flex max-w-7xl justify-between gap-2 px-2 py-4 sm:px-6 lg:px-8"
>
<div> <div>
<a href="/home" class="rounded-md bg-english-violet px-3 py-2 text-sm font-medium text-white"> <a
Inventory App href="/home"
</a> class="rounded-md bg-english-violet px-3 py-2 text-sm font-medium text-white"
>
Inventory App
</a>
</div> </div>
<div> <div>
<a href="/overview" <a
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"> href="/overview"
Overview class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"
</a> >
<a href="/catalog" Overview
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"> </a>
Catalog <a
</a> href="/catalog"
<a href="/upload" class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"> >
Upload Catalog
</a> </a>
<a href="/reports" <a
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"> href="/upload"
Reports class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"
</a> >
<a href="/history" Upload
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"> </a>
History <a
</a> href="/reports"
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"
>
Reports
</a>
<a
href="/history"
class="rounded-md px-3 py-2 text-sm font-medium text-gray-300 hover:bg-gray-700 hover:text-white"
>
History
</a>
</div> </div>
</nav> </nav>
</header> </header>
<main class="bg-slate-100 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100 mx-auto px-1"> <main
{% block content %}<p>Content Missing</p>{% endblock %} class="mx-auto bg-slate-100 px-1 text-neutral-900 dark:bg-neutral-900 dark:text-slate-100"
</main> >
<footer> {% block content %}
<!-- <p>Content Missing</p>
{% endblock %}
</main>
<footer>
<!--
<script> <script>
// Needed for nice bootstrap dropdowns // Needed for nice bootstrap dropdowns
const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="dropdown"]'); const popoverTriggerList = document.querySelectorAll('[data-bs-toggle="dropdown"]');
const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl)) const popoverList = [...popoverTriggerList].map(popoverTriggerEl => new bootstrap.Popover(popoverTriggerEl))
</script> </script>
--> --></footer>
</footer> </body>
</body>
</html> </html>

@ -1,11 +1,10 @@
{% extends "problem.html" %} {% extends "problem.html" %} {% block content %}
{% block content %}
<h1>Not Found</h1> <h1>Not Found</h1>
<p> <p>
Sorry, we can't seem to find the page you're looking for. Please press back button or return Sorry, we can't seem to find the page you're looking for. Please press back
<a href="/">home</a>. button or return
<a href="/">home</a>.
</p> </p>
{% endblock %} {% endblock %}

@ -1,8 +1,5 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Overview {% endblock %} {% block
content %}
{% block title %} Overview {% endblock %}
{% block content %}
<h1>Overview (Coming soon)</h1> <h1>Overview (Coming soon)</h1>

@ -1,16 +1,18 @@
<!DOCTYPE html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="color-scheme" content="light dark"> <meta name="color-scheme" content="light dark" />
<link rel="stylesheet" href="/css/pico.min.css"> <link rel="stylesheet" href="/css/pico.min.css" />
<script src="/js/htmx.min.js"></script> <script src="/js/htmx.min.js"></script>
<title>Problem</title> <title>Problem</title>
</head> </head>
<body> <body>
<main class="container"> <main class="container">
{% block content %}<p>Something went wrong</p>{% endblock %} {% block content %}
</main> <p>Something went wrong</p>
</body> {% endblock %}
</main>
</body>
</html> </html>

@ -1,8 +1,5 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Reports {% endblock %} {% block
content %}
{% block title %} Reports {% endblock %}
{% block content %}
<h1>Reports (Coming soon)</h1> <h1>Reports (Coming soon)</h1>

@ -1,19 +1,27 @@
{% extends "main.html" %} {% extends "main.html" %} {% block title %} Upload {% endblock %} {% block
content %}
{% block title %} Upload {% endblock %} <form
action="/upload/catalog"
{% block content %} method="post"
enctype="multipart/form-data"
<form action="/upload/catalog" method="post" enctype="multipart/form-data" x-data="{ file: '' }"> x-data="{ file: '' }"
<fieldset class="grid"> >
<h3>Catalog Import</h3> <fieldset class="grid">
<label role="button" class="secondary" x-show="!file"> <h3>Catalog Import</h3>
Choose File <label role="button" class="secondary" x-show="!file">
<input type="file" name="file" x-model="file" style="display: none" required /> Choose File
</label> <input
<input type="submit" value="Upload" x-show="file"> type="file"
<input type="reset" value="Cancel" x-show="file"> name="file"
</fieldset> x-model="file"
style="display: none"
required
/>
</label>
<input type="submit" value="Upload" x-show="file" />
<input type="reset" value="Cancel" x-show="file" />
</fieldset>
</form> </form>
{% endblock %} {% endblock %}
Loading…
Cancel
Save

Powered by TurnKey Linux.