Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/alignment of search bar #233

Open
wants to merge 2 commits into
base: test
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions views/campgrounds/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,38 @@

<link rel="stylesheet" href="stylesheets/searchCampground.css">

<div class="d-flex justify-content-between align-items-center mb-3">
<style>
#Search-Section{
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;

}
#Sort-section{
display: flex;
flex-direction: row;
justify-content: end;
margin-bottom: 10px;
}
@media only screen and (max-width: 600px) {
#Search-Section{
display: flex;
flex-direction: column;
}
#show-nearest-btn{
width: 200px;
}
#Sort-section{

justify-content: center;

}

}
</style>

<div id="Search-Section" class=" w-full mb-3">
<!-- Search Bar (left-aligned) -->
<form action="/campgrounds/search" method="GET" class="form-inline my-2 my-lg-0" id="search-form">
<div class="input-group">
Expand All @@ -16,15 +47,15 @@
</form>
<button id="show-nearest-btn" class="btn btn-info">Show Nearest to Me</button>
</div>
<div style="display: flex;flex-direction: row;justify-content: flex-end;margin-bottom: 10px;">
<form action="/campgrounds" method="GET" class="d-inline">
<div id="Sort-section" >
<form action="/campgrounds" method="GET" class="d-inline ">
<select name="sort" id="sort" class="btn btn-secondary">
<option value="">--Select--</option>
<option value="priceAsc" <%= (locals.query && query.sort === 'priceAsc') ? 'selected' : '' %>>Price: Low to High</option>
<option value="priceDesc" <%= (locals.query && query.sort === 'priceDesc') ? 'selected' : '' %>>Price: High to Low</option>
<option value="reviewsHighest" <%= (locals.query && query.sort === 'reviewsHighest') ? 'selected' : '' %>>Reviews: Highest Rated</option>
<option value="reviewsLowest" <%= (locals.query && query.sort === 'reviewsLowest') ? 'selected' : '' %>>Reviews: Lowest Rated</option>
</select>
</select>
<button type="submit" class="btn btn-primary">Sort</button>
</form>
</div>
Expand Down