Add JS to vote on reviews without form submit

Fixes #329
This commit is contained in:
rubenwardy
2023-08-21 00:13:22 +01:00
parent 2a9f2924da
commit dca6e82594
9 changed files with 104 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
{% macro render_review_vote(review, current_user, next_url) %}
{% set (positive, negative, is_positive) = review.get_totals(current_user) %}
<form class="-group" method="post" action="{{ review.get_vote_url(next_url) }}">
<form class="review-helpful-vote" method="post" action="{{ review.get_vote_url(next_url) }}">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<div class="btn-group">
<button class="btn {% if is_positive == true %}btn-primary{% else %}btn-secondary{% endif %}" name="is_positive" value="yes">