user dashboard

This commit is contained in:
2025-03-01 23:12:56 +08:00
parent eb2500a74d
commit a202488ff7
2 changed files with 41 additions and 1 deletions
+36
View File
@@ -0,0 +1,36 @@
{% extends 'base.html' %}
{% block title %}User Dashboard{% endblock %}
{% block content %}
<div class="container mt-4">
<h1 class="text-center">Your Bookings</h1>
{% if bookings %}
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Listing</th>
<th>Location</th>
<th>Property Type</th>
<th>Check-in</th>
<th>Check-out</th>
</tr>
</thead>
<tbody>
{% for booking in bookings %}
<tr>
<td>{{ booking.listing.title if booking.listing else 'Unknown' }}</td>
<td>{{ booking.listing.location if booking.listing else 'Unknown' }}</td>
<td>{{ booking.listing.PROPERTY_TYPES.get(booking.listing.property_type, 'Unknown') if booking.listing else 'Unknown' }}</td>
<td>{{ booking.check_in.strftime('%Y-%m-%d') }}</td>
<td>{{ booking.check_out.strftime('%Y-%m-%d') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% else %}
<p class="text-center">You have no bookings yet.</p>
{% endif %}
</div>
{% endblock %}