diff --git a/app/templates/tenant/appointments/index.html b/app/templates/tenant/appointments/index.html index e7ae811..b16a947 100644 --- a/app/templates/tenant/appointments/index.html +++ b/app/templates/tenant/appointments/index.html @@ -4,13 +4,12 @@

Appointments

- + - + onchange="window.location='{{ url_for('appointments.index') }}?date='+this.value" style="width:150px;"> + + New
@@ -19,7 +18,15 @@
- + + + + + + + + + {% for appt in appointments %} @@ -29,28 +36,28 @@ {% else %} - + + + {% endfor %}
TimeCustomerServiceStaffStatusType
TimeCustomerServiceStaffStatusType
{{ appt.service.name if appt.service else '—' }} {{ appt.staff.name if appt.staff else '—' }} - + {{ appt.status }} {{ 'Walk-in' if appt.is_walk_in else 'Booked' }} - View + View {% if appt.status in ['pending','confirmed','in_progress'] %} - Checkout + Checkout {% endif %}
No appointments for this day.
No appointments for this day.
-{% endblock %} -{% block scripts %} - {% endblock %} \ No newline at end of file diff --git a/app/tenant/appointments/routes.py b/app/tenant/appointments/routes.py index 9bd1038..f53b61b 100644 --- a/app/tenant/appointments/routes.py +++ b/app/tenant/appointments/routes.py @@ -46,8 +46,12 @@ def index(): tenant_id=g.tenant.id, is_active=True).filter( Service.deleted_at.is_(None)).order_by(Service.name).all() + prev_date = view_date - timedelta(days=1) + next_date = view_date + timedelta(days=1) + return render_template("tenant/appointments/index.html", appointments=appts, view_date=view_date, + prev_date=prev_date, next_date=next_date, staff_list=staff_list, services=services) @@ -224,4 +228,4 @@ def _user_db_id(): uid_str = current_user.get_id() return int(uid_str.split(":")[1]) if uid_str and ":" in uid_str else None except Exception: - return None + return None \ No newline at end of file