phase5: add saved searches, watchlist, and authenticated htmx flows
This commit is contained in:
16
templates/scouting/partials/favorite_button.html
Normal file
16
templates/scouting/partials/favorite_button.html
Normal file
@ -0,0 +1,16 @@
|
||||
<form
|
||||
id="favorite-form-{{ player.id }}"
|
||||
method="post"
|
||||
action="{% url 'scouting:favorite_toggle' player.id %}"
|
||||
hx-post="{% url 'scouting:favorite_toggle' player.id %}"
|
||||
hx-target="#favorite-form-{{ player.id }}"
|
||||
hx-swap="outerHTML"
|
||||
>
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="next" value="{{ next_url }}">
|
||||
{% if is_favorite %}
|
||||
<button type="submit" class="button ghost">Remove favorite</button>
|
||||
{% else %}
|
||||
<button type="submit" class="button ghost">Add favorite</button>
|
||||
{% endif %}
|
||||
</form>
|
||||
Reference in New Issue
Block a user