product upvote

This commit is contained in:
2020-03-10 14:28:13 -07:00
parent b46e94fda0
commit f79c29b7e0
3 changed files with 17 additions and 1 deletions

View File

@ -19,7 +19,7 @@
<img src="{{ product.image.url }}" class="img-fluid" \>
</div>
<div class="col-4">
<a href=""><button class="btn btn-primary btn-lg btn-block"><span class="oi oi-caret-top"></span> Up Vote : {{ product.votes_total }}</button></a>
<a href="javascript:{document.getElementById('upvote').submit()}"><button class="btn btn-primary btn-lg btn-block"><span class="oi oi-caret-top"></span> Up Vote : {{ product.votes_total }}</button></a>
</div>
</div>
<hr />
@ -37,4 +37,10 @@
<p>{{ product.body }}</p>
</div>
</div>
<form id="upvote" method="POST" action="{% url 'upvote' product.id %}">
{% csrf_token %}
<input type="hidden">
</form>
{% endblock %}