Files
MyPOS/app/templates/tenant/appointments/form.html
T
2026-05-07 12:17:19 -04:00

75 lines
3.4 KiB
HTML

{% extends "tenant/layouts/base.html" %}
{% block title %}{{ 'Edit' if mode == 'edit' else 'New' }} Appointment{% endblock %}
{% block content %}
<div class="row justify-content-center">
<div class="col-md-7">
<div class="card shadow-sm">
<div class="card-header fw-semibold">{{ 'Edit' if mode == 'edit' else 'New' }} Appointment</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="row g-3 mb-3">
<div class="col-md-6">
<label class="form-label">Start Date & Time <span class="text-danger">*</span></label>
<input type="datetime-local" class="form-control" name="start_time" required
value="{{ appointment.start_time.strftime('%Y-%m-%dT%H:%M') if appointment else '' }}">
</div>
<div class="col-md-6">
<label class="form-label">Service</label>
<select class="form-select" name="service_id">
<option value="">— None —</option>
{% for s in services %}
<option value="{{ s.id }}"
{{ 'selected' if appointment and appointment.service_id == s.id }}>
{{ s.name }} ({{ s.duration_min }} min)
</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label class="form-label">Customer</label>
<select class="form-select" name="customer_id">
<option value="">— Walk-in —</option>
{% for c in customers %}
<option value="{{ c.id }}"
{{ 'selected' if appointment and appointment.customer_id == c.id }}>
{{ c.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-md-6">
<label class="form-label">Staff</label>
<select class="form-select" name="staff_id">
<option value="">— Any —</option>
{% for s in staff_list %}
<option value="{{ s.id }}"
{{ 'selected' if appointment and appointment.staff_id == s.id }}>
{{ s.name }}
</option>
{% endfor %}
</select>
</div>
<div class="col-12">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="is_walk_in" value="1"
id="is_walk_in" {{ 'checked' if appointment and appointment.is_walk_in }}>
<label class="form-check-label" for="is_walk_in">Walk-in (no appointment)</label>
</div>
</div>
<div class="col-12">
<label class="form-label">Notes</label>
<textarea class="form-control" name="notes" rows="2">{{ appointment.notes if appointment else '' }}</textarea>
</div>
</div>
<div class="d-flex gap-2">
<button type="submit" class="btn btn-primary">Save</button>
<a href="{{ url_for('appointments.index') }}" class="btn btn-outline-secondary">Cancel</a>
</div>
</form>
</div>
</div>
</div>
</div>
{% endblock %}