moviewyrm/bookwyrm/templates/snippets/goal_form.html
2021-02-28 17:10:30 -08:00

36 lines
1.5 KiB
HTML

{% load i18n %}
<form method="post" name="goal" action="{{ request.user.local_path }}/goal/{{ year }}">
{% csrf_token %}
<input type="hidden" name="year" value="{% if goal %}{{ goal.year }}{% else %}{{ year }}{% endif %}">
<input type="hidden" name="user" value="{{ request.user.id }}">
<div class="columns">
<div class="column">
<label class="label" for="id_goal">{% trans "Reading goal:" %}</label>
<div class="field has-addons">
<div class="control">
<input type="number" class="input" name="goal" min="1" id="id_goal" value="{% if goal %}{{ goal.goal }}{% else %}12{% endif %}">
</div>
<p class="button is-static" aria-hidden="true">{% trans "books" %}</p>
</div>
</div>
<div class="column">
<label class="label"><p class="mb-2">{% trans "Goal privacy:" %}</p>
{% include 'snippets/privacy_select.html' with no_label=True current=goal.privacy %}
</label>
</div>
</div>
<label for="post_status" class="label">
<input type="checkbox" name="post-status" id="post_status" class="checkbox" checked>
{% trans "Post to feed" %}
</label>
<p>
<button type="submit" class="button is-link">{% trans "Set goal" %}</button>
{% if goal %}
{% trans "Cancel" as button_text %}
{% include 'snippets/toggle/close_button.html' with text=button_text controls_text="show-edit-goal" %}
{% endif %}
</p>
</form>