diff --git a/routes.py b/routes.py index f6dc08a..6da59ad 100644 --- a/routes.py +++ b/routes.py @@ -119,4 +119,5 @@ def booking(listing_id): @app.route('/view/', methods=['GET']) def view_listing(listing_id): listing = Listing.query.get_or_404(listing_id) - return render_template('view.html', listing=listing) \ No newline at end of file + property_type_display = Listing.PROPERTY_TYPES.get(listing.property_type, 'Unknown') + return render_template('view.html', listing=listing, property_type_display=property_type_display) \ No newline at end of file diff --git a/templates/view.html b/templates/view.html index 3cfb980..2e735a5 100644 --- a/templates/view.html +++ b/templates/view.html @@ -10,7 +10,7 @@

Description: {{ listing.description }}

Price: ${{ listing.price }}

Location: {{ listing.location }}

-

Property Type: {{ listing.property_type }}

+

Property Type: {{ property_type_display }}

Max Guests: {{ listing.guests }}

Rooms: {{ listing.rooms }}

Bathrooms: {{ listing.bathrooms }}