Skip to content

Commit

Permalink
Merge pull request #33 from drewuse/book-filters
Browse files Browse the repository at this point in the history
  • Loading branch information
KaranErry authored Apr 14, 2019
2 parents 2a185a0 + 2e65b7b commit 710d808
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
Binary file modified public/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@ a.dropdown-item{
}
#sellButton{
margin-right:10px;
}

#asterisk{
color: red;
}
2 changes: 1 addition & 1 deletion routes/sellForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ router.post('/insert', imageParser.single('image'), /* this middleware processe
// Populate DB schema
var item = {
title: req.body.title,
description: req.body.description,
price: req.body.price,
imgs: null,
datePosted: current_timestamp,
Expand All @@ -91,6 +90,7 @@ router.post('/insert', imageParser.single('image'), /* this middleware processe
// }],
condition: condition,
booktype: booktype,
description: req.body.description ? req.body.description : '',
dateSold: null,
postedBy: req.session.passport.user._json.email,
boughtBy: null,
Expand Down
32 changes: 17 additions & 15 deletions views/sellForm.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,24 @@
<form action="/sell/insert" method="post" enctype="multipart/form-data">
<!-- Title Input -->
<div class="input">
<label for="title">Title</label>
<input type="text" id="title" name="title">
<label for="title">Title <span id="asterisk">*</span></label>
<input required type="text" id="title" name="title">
</div>
<!-- Price Input -->
<div class="input">
<label for="content">Price</label>
<input type="number" id="price" name="price">
</div>
<!-- Item Description Input -->
<div class="input">
<label for="author">Description</label>
<input type="text" id="description" name="description">
<label for="content">Price <span id="asterisk">*</span></label>
<input required type="number" id="price" name="price">
</div>
<!-- Image Input -->
<div class="input">
<label for="image">Image</label>
<input type="file" id="image" name="image">
<label for="image">Image <span id="asterisk">*</span></label>
<input required type="file" id="image" name="image">
</div>
<!-- Condition Dropdown -->
<div class="input">
<label for="condition"><strong>Book Condition</strong></label>
<select class="form-control" id="condition" name="condition">
<label for="condition">Book Condition: <span id="asterisk">*</span></label>
<select required class="form-control" id="condition" name="condition">
<option value="">Choose a book condition...</option>
<option value="new">New</option>
<option value="used-vg">Used - Very Good</option>
<option value="used-gd">Used - Good</option>
Expand All @@ -33,12 +29,18 @@
</div>
<!-- Book Type Dropdown -->
<div class="input">
<label for="booktype"><strong>Book Type</strong></label>
<select class="form-control" id="booktype" name="booktype">
<label for="booktype">Book Type: <span id="asterisk">*</span></label>
<select required class="form-control" id="booktype" name="booktype">
<option value="">Choose a book type...</option>
<option value="textbook">Textbook</option>
<option value="course-rr">Required Course Reading (non-textbook)</option>
<option value="other">Other (non-textbook)</option>
</select>
</div>
<!-- Item Description Input -->
<div class="input">
<label for="author">Additional Description</label>
<input type="text" id="description" name="description">
</div>
<button class="btn btn-primary" type="submit">Start Selling</button>
</form>

0 comments on commit 710d808

Please sign in to comment.