added filters
This commit is contained in:
parent
709f54be28
commit
630571bb56
@ -7,5 +7,6 @@ urlpatterns = [
|
|||||||
path('adminpage', views.admin, name='admin'),
|
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('search', views.search, name='search'),
|
||||||
path('search', views.location_based_search, name='location-based-search'),
|
path('location_search', views.location_based_search, name='location-based-search'),
|
||||||
|
path('filter_search', views.filter_search, name='filter-search'),
|
||||||
]
|
]
|
||||||
|
|||||||
@ -34,3 +34,12 @@ def favorites(request):
|
|||||||
|
|
||||||
def location_based_search(request):
|
def location_based_search(request):
|
||||||
return render(request, 'favorites.jinja', {"title": "rooF(i)S is love rooF(i)S is live!!"})
|
return render(request, 'favorites.jinja', {"title": "rooF(i)S is love rooF(i)S is live!!"})
|
||||||
|
|
||||||
|
|
||||||
|
def filter_search(request):
|
||||||
|
if request.method=="POST":
|
||||||
|
logger.info(request.POST)
|
||||||
|
|
||||||
|
|
||||||
|
return render(request, 'search.jinja',{"title": "rooF(i)S is love rooF(i)S is live!!"})
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,53 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col"></div>
|
<div class="col"></div>
|
||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
|
<p>
|
||||||
|
|
||||||
|
|
||||||
<form class="form-inline my-2 my-lg-0">
|
<form class="form-inline my-2 my-lg-0">
|
||||||
|
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button"
|
||||||
|
aria-expanded="false" aria-controls="collapseExample">
|
||||||
|
Filter
|
||||||
|
</a>
|
||||||
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
||||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
||||||
</form>
|
</form>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="collapse" id="collapseExample" style="max-width: 200px">
|
||||||
|
<form action="{{url('roomservice:filter-search')}}" method="POST" id="FormFilter">
|
||||||
|
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
|
||||||
|
<div class="card card-body">
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input type="checkbox" class="form-check-input" id="checkboxbarrierfree">
|
||||||
|
<label class="form-check-label" for="checkbox">barrierfree</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input type="checkbox" class="form-check-input" id="checkbox">
|
||||||
|
<label class="form-check-label" for="checkbox">seating</label>
|
||||||
|
</div>
|
||||||
|
<div class="form-check form-check-inline">
|
||||||
|
<input type="checkbox" class="form-check-input" id="checkbox">
|
||||||
|
<label class="form-check-label" for="checkbox">cooling</label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="dropdown">
|
||||||
|
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton"
|
||||||
|
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
|
Capacity
|
||||||
|
</button>
|
||||||
|
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||||
|
<a class="dropdown-item" href="#">no selection</a>
|
||||||
|
<a class="dropdown-item" href="#">20</a>
|
||||||
|
<a class="dropdown-item" href="#">30</a>
|
||||||
|
<a class="dropdown-item" href="#">60</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Use filters</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -19,13 +62,14 @@
|
|||||||
<label for="sel1">Select list:</label>
|
<label for="sel1">Select list:</label>
|
||||||
<select multiple name="room" class="form-control" form="form" id="sel1">
|
<select multiple name="room" class="form-control" form="form" id="sel1">
|
||||||
{% for room in rooms %}
|
{% for room in rooms %}
|
||||||
<option value="{{room.id}}">{{room.room_number}}</option>
|
<option value="{{ room.id }}">{{ room.room_number }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" method="POST" value=" Send" class="btn btn-success" id="submit"> Submit </button>
|
<button type="submit" method="POST" value=" Send" class="btn btn-success" id="submit"> Submit
|
||||||
</div>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
<div class="col"></div>
|
<div class="col"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user