Skip to content

Commit

Permalink
fixed dealer details page and add review page
Browse files Browse the repository at this point in the history
  • Loading branch information
seymoneg committed Dec 15, 2023
1 parent 5bd4459 commit 25c7a2d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
Binary file modified server/db.sqlite3
Binary file not shown.
15 changes: 9 additions & 6 deletions server/djangoapp/templates/djangoapp/add_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</head>
<body>
<!--Add review form here -->
<h1>Review dealer {{dealer_id}}</h1>
<h1>Review dealer {{dealer.full_name}}</h1>
<form action="{% url 'djangoapp:add_review' dealer.id %}" method="post">
{% csrf_token %}
<div class="form-group">
Expand All @@ -21,17 +21,15 @@ <h1>Review dealer {{dealer_id}}</h1>
</div>
<div class="form-group">
<input class="form-check-input" type="checkbox" name="purchasecheck" id="purchasecheck">
<label>Has purchased the car from {{dealer_id}}? (Select purchased car info below if checked)</label>
<label>Has purchased the car from {{dealer.full_name}}? (Select purchased car info below if checked)</label>
</div>
<div class="form-group">
<label>Select your car (model-make-year)</label>
<select name="car" id="car" class="form-select" required>
{% for car in cars %}
<option selected value="{{car.id}}">
{{car.name}}-{{car.make.name}}-{{ car.year|date:"Y" }}
</option>
<option selected value={{car.id}}>{{car.name}}-{{car.make.name}}-{{ car.year|date:"Y" }}</option>
{% endfor %}
</select>
</select>
</div>
<div class="form-group">
<label>Select your purchase date: </label>
Expand All @@ -40,4 +38,9 @@ <h1>Review dealer {{dealer_id}}</h1>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</body>
<script type="text/javascript">
$('.date-own').datepicker({
format: 'mm/dd/yyyy'
});
</script>
</html>
1 change: 1 addition & 0 deletions server/djangoapp/templates/djangoapp/dealer_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
</nav>

<!-- Add reviews as cards -->
<h3>Reviews for {{dealer.full_name}}</h3>
<div class="card-columns">
{% for review in reviews %}
<div class="card">
Expand Down
2 changes: 1 addition & 1 deletion server/djangobackend/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

APPEND_SLASH = True

ALLOWED_HOSTS = ["localhost", "127.0.0.1"]
ALLOWED_HOSTS = ["localhost"]


# Application definition
Expand Down

0 comments on commit 25c7a2d

Please sign in to comment.