Skip to content

Commit

Permalink
Updated add_review.html and updated review[name] parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhanduzel committed Dec 14, 2023
1 parent 5304cae commit 1e43372
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 0 additions & 2 deletions server/djangoapp/templates/djangoapp/add_review.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ <h3 class="mb-5 mt-3">Add Review for <strong> {{dealer.full_name}} </strong> </h
<form class="d-flex flex-column justify-content-center w-50" action = "{% url 'djangoapp:add_review' dealer.id %}" method="post">
{% csrf_token %}
<div class="col-auto">
<H5>Your Name:</H5><br>
{% csrf_token %}
<input class="form-control" id="name" name="name" size="30" required><br>
<div class="form-group">
<h5>Enter your review here:</h5>
<textarea class="form-control my-2" id="content" name="content" rows="2" required></textarea>
Expand Down
8 changes: 5 additions & 3 deletions server/djangoapp/templates/djangoapp/dealer_details.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,13 @@ <h3> Reviews for <strong> {{ dealer.full_name }} </strong> </h3>
{% for review in reviews_list %}
<div class="card text-dark bg-light mb-3 text-left">
{% if review.sentiment == "positive" %}
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/positive.png"/>
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/positive.png" style="height: 70px; width: 70px;"/>
{% elif review.sentiment == "neutral" %}
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/neutral.png"/>
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/neutral.png" style="height: 70px; width: 70px;"/>
{% elif review.sentiment == "negative" %}
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/negative.png"/>
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/negative.png" style="height: 70px; width: 70px;"/>
{% else %}
<img class="card-img-left" src="{{MEDIA_URL}}/emoji/neutral.png" style="height: 70px; width: 70px;"/>
{% endif %}

<div class="card-body bg-light">
Expand Down
2 changes: 1 addition & 1 deletion server/djangoapp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def add_review(request, dealer_id):
car = CarModel.objects.get(pk=car_id)
review = {}
review["id"] = dealer_id
review["name"] = request.POST['name']
review["name"] = username
review["dealership"] = dealer_id
review["review"] = request.POST['content']
review["purchase"] = was_purchased
Expand Down

0 comments on commit 1e43372

Please sign in to comment.