05/07 Phase 3: initial codes

This commit is contained in:
2026-05-07 12:17:19 -04:00
parent 6e5518c103
commit ce462c57b2
107 changed files with 6365 additions and 208 deletions
@@ -0,0 +1,50 @@
{% extends "tenant/layouts/base.html" %}
{% block title %}{{ 'Edit' if mode == 'edit' else 'New' }} Product{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-5">
<div class="card shadow-sm">
<div class="card-header fw-semibold">{{ 'Edit' if mode == 'edit' else 'New' }} Product</div>
<div class="card-body">
{% if error %}<div class="alert alert-danger py-2">{{ error }}</div>{% endif %}
<form method="POST" novalidate>
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<div class="mb-3">
<label class="form-label">Name <span class="text-danger">*</span></label>
<input type="text" class="form-control" name="name"
value="{{ product.name if product else '' }}" required autofocus>
</div>
<div class="row g-2 mb-3">
<div class="col">
<label class="form-label">SKU</label>
<input type="text" class="form-control" name="sku"
value="{{ product.sku if product else '' }}">
</div>
<div class="col">
<label class="form-label">Category</label>
<input type="text" class="form-control" name="category"
value="{{ product.category if product else '' }}">
</div>
</div>
<div class="mb-3">
<label class="form-label">Sale Price ($) <span class="text-danger">*</span></label>
<input type="number" step="0.01" class="form-control" name="sale_price" min="0"
value="{{ "%.2f"|format(product.sale_price) if product else '' }}" required>
</div>
{% if mode == 'edit' %}
<div class="form-check form-switch mb-3">
<input class="form-check-input" type="checkbox" name="is_active" value="1"
id="is_active" {{ 'checked' if product and product.is_active }}>
<label class="form-check-label" for="is_active">Active</label>
</div>
{% endif %}
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ url_for('services.index') }}" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}