what2watch/templates/elements/add_watch_button.html

60 lines
1.7 KiB
HTML
Raw Normal View History

{% match quest %}
{% when Some with (q) %}
{% let public %}
{% let np %}
{% if q.public -%}
{% let public = "public" %}
{% let np = "private" %}
{% else %}
{% let public = "private" %}
{% let np = "public" %}
{%- endif %}
{% let status %}
{% if q.watched -%}
{% let status = "want to watch" %}
{% else %}
{% let status = "watched" %}
{% endif %}
<table>
<tbody>
<tr>
<td>Added</td>
<td>{{- public -}}</td>
</tr>
<tr>
<td>
<form id="edit-quest-{{self.watch}}">
<button hx-post="/edit/quest" hx-target="#add-watch-{{self.watch}}" hx-trigger="click"
hx-swap="outerHTML">remove</button>
<input type="hidden" name="watch" value="{{self.watch}}">
<input type="hidden" name="act" value="remove">
</form>
</td>
<td>
<form id="edit-visibility-{{self.watch}}">
<button hx-post="/edit/quest" hx-target="#add-watch-{{self.watch}}" hx-trigger="click"
hx-swap="outerHTML">mark as {{ np }}</button>
<input type="hidden" name="watch" value="{{self.watch}}">
</form>
</td>
</tr>
</tbody>
</table>
{% when None %}
2024-01-02 01:27:17 +00:00
<form id="add-watch-{{self.watch}}">
<button hx-post="/add/watch" hx-target="#add-watch-{{self.watch}}" hx-trigger="click"
hx-swap="outerHTML">add</button>
<select name="public" id="add-public-watch">
<option value="true">public</option>
<option value="false">private</option>
</select>
2024-01-02 01:27:17 +00:00
<input type="hidden" name="watch" value="{{self.watch}}">
</form>
{% endmatch %}