diff --git a/roofis2/roomservice/urls.py b/roofis2/roomservice/urls.py index 8a0dacc..003cdfd 100644 --- a/roofis2/roomservice/urls.py +++ b/roofis2/roomservice/urls.py @@ -10,8 +10,7 @@ urlpatterns = [ path('success/', views.success, name='success'), path('adminpage', views.admin, name='admin'), - path('booking', views.booking, name='booking'), + path('booking/', views.booking, name='booking'), path('search', views.search, name='search'), path('location_search', views.location_based_search, name='location-based-search'), path('filter_search', views.filter_search, name='filter-search')] - diff --git a/roofis2/roomservice/views.py b/roofis2/roomservice/views.py index 64a7553..4f8c502 100644 --- a/roofis2/roomservice/views.py +++ b/roofis2/roomservice/views.py @@ -49,9 +49,8 @@ def search(request): return render(request, 'search.jinja', {"title": "rooF(i)S is love rooF(i)S is live!!", "rooms": rooms}) -def booking(request): - room_id = request.POST["room"] - return render(request, 'booking.jinja', {"title": "rooF(i)S is love rooF(i)S is live!!", "data": room_id}) +def booking(request, id): + return render(request, 'booking.jinja', {"title": "rooF(i)S is love rooF(i)S is live!!", "data": id}) def admin(request): diff --git a/roofis2/templates/search.jinja b/roofis2/templates/search.jinja index a9be85c..3ff73de 100644 --- a/roofis2/templates/search.jinja +++ b/roofis2/templates/search.jinja @@ -66,30 +66,32 @@ {# #} -
-
-

Results

-
-
-
- {% for room in rooms %} -
-
-
-
Room:{{ room.room_number }}
-
Building Name: {{ room.building.name }}
-
-

Capacity: {{ room.capacity }} Persons

-

Room type: {{ room.room_type.type }}

- Detail - Another link -
-
-


+ {% if rooms %} +
+
+

Results

- {% endfor %} -

Results: {{ result_count }}

-
+
+
+ {% for room in rooms %} +
+
+
+
Room:{{ room.room_number }}
+
Building Name: {{ room.building.name }}
+
+

Capacity: {{ room.capacity }} Persons

+

Room type: {{ room.room_type.type }}

+ Detail + Another link +
+
+


+
+ {% endfor %} +

Results: {{ result_count }}

+
+ {% endif %}
{% endblock %}