2021-02-28 02:48:10 +00:00
|
|
|
{% load i18n %}
|
2021-01-31 18:34:25 +00:00
|
|
|
{% csrf_token %}
|
2021-09-26 05:56:52 +00:00
|
|
|
{% load utilities %}
|
2021-01-31 18:34:25 +00:00
|
|
|
<input type="hidden" name="user" value="{{ request.user.id }}">
|
|
|
|
|
|
|
|
<div class="columns">
|
2021-09-06 17:03:00 +00:00
|
|
|
<div class="column is-two-thirds">
|
2021-01-31 18:34:25 +00:00
|
|
|
<div class="field">
|
2021-02-28 02:48:10 +00:00
|
|
|
<label class="label" for="id_name">{% trans "Name:" %}</label>
|
2021-01-31 18:34:25 +00:00
|
|
|
{{ list_form.name }}
|
|
|
|
</div>
|
|
|
|
<div class="field">
|
2021-02-28 02:48:10 +00:00
|
|
|
<label class="label" for="id_description">{% trans "Description:" %}</label>
|
2021-01-31 18:34:25 +00:00
|
|
|
{{ list_form.description }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="column">
|
|
|
|
<fieldset class="field">
|
2021-02-28 02:48:10 +00:00
|
|
|
<legend class="label">{% trans "List curation:" %}</legend>
|
2021-01-31 18:34:25 +00:00
|
|
|
|
2021-09-27 01:03:41 +00:00
|
|
|
<label class="field" data-hides="list_group_selector">
|
2021-02-28 02:48:10 +00:00
|
|
|
<input type="radio" name="curation" value="closed"{% if not list or list.curation == 'closed' %} checked{% endif %}> {% trans "Closed" %}
|
|
|
|
<p class="help mb-2">{% trans "Only you can add and remove books to this list" %}</p>
|
2021-01-31 18:34:25 +00:00
|
|
|
</label>
|
|
|
|
|
2021-09-27 01:03:41 +00:00
|
|
|
<label class="field" data-hides="list_group_selector">
|
2021-02-28 02:48:10 +00:00
|
|
|
<input type="radio" name="curation" value="curated"{% if list.curation == 'curated' %} checked{% endif %}> {% trans "Curated" %}
|
|
|
|
<p class="help mb-2">{% trans "Anyone can suggest books, subject to your approval" %}</p>
|
2021-01-31 18:34:25 +00:00
|
|
|
</label>
|
|
|
|
|
2021-09-27 01:03:41 +00:00
|
|
|
<label class="field" data-hides="list_group_selector">
|
2021-10-06 23:24:23 +00:00
|
|
|
<input type="radio" name="curation" value="open"{% if list.curation == 'open' %} checked{% endif %}> {% trans "Open" context "curation type" %}
|
2021-02-28 02:48:10 +00:00
|
|
|
<p class="help mb-2">{% trans "Anyone can add books to this list" %}</p>
|
2021-01-31 18:34:25 +00:00
|
|
|
</label>
|
2021-09-26 05:56:52 +00:00
|
|
|
|
2021-09-27 01:03:41 +00:00
|
|
|
<label class="field hidden-form">
|
|
|
|
<input type="radio" name="curation" value="group"{% if list.curation == 'group' %} checked{% endif %} > {% trans "Group" %}
|
|
|
|
<p class="help mb-2">{% trans "Group members can add to and remove from this list" %}</p>
|
|
|
|
<fieldset class="{% if list.curation != 'group' %}is-hidden{% endif %}" id="list_group_selector">
|
2021-10-15 21:18:55 +00:00
|
|
|
{% if user.memberships.exists %}
|
2021-10-04 11:18:51 +00:00
|
|
|
<label class="label" for="id_group" id="group">{% trans "Select Group" %}</label>
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="select control">
|
|
|
|
<select name="group" id="id_group">
|
|
|
|
<option value="" disabled {% if not list.group %} selected{% endif %}>{% trans "Select a group" %}</option>
|
|
|
|
{% for membership in user.memberships.all %}
|
|
|
|
<option value="{{ membership.group.id }}" {% if list.group.id == membership.group.id %} selected{% endif %}>{{ membership.group.name }}</option>
|
|
|
|
{% endfor %}
|
|
|
|
</select>
|
|
|
|
</div>
|
2021-09-27 01:03:41 +00:00
|
|
|
</div>
|
|
|
|
{% else %}
|
2021-10-04 11:18:51 +00:00
|
|
|
{% with user|username as username %}
|
|
|
|
{% url 'user-groups' user|username as url %}
|
|
|
|
<div>
|
|
|
|
<p>{% trans "You don't have any Groups yet!" %}</p>
|
|
|
|
<p>
|
|
|
|
<a class="help has-text-weight-normal" href="{{ url }}">{% trans "Create a Group" %}</a>
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
{% endwith %}
|
|
|
|
{% endif %}
|
|
|
|
</fieldset>
|
2021-09-27 01:03:41 +00:00
|
|
|
</label>
|
2021-01-31 18:34:25 +00:00
|
|
|
</fieldset>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-09-06 17:03:00 +00:00
|
|
|
<div class="columns is-mobile">
|
|
|
|
<div class="column">
|
|
|
|
<div class="field has-addons">
|
|
|
|
<div class="control">
|
|
|
|
{% include 'snippets/privacy_select.html' with current=list.privacy %}
|
|
|
|
</div>
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" class="button is-primary">{% trans "Save" %}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|
2021-09-20 21:25:11 +00:00
|
|
|
{% if list.id %}
|
2021-09-06 17:03:00 +00:00
|
|
|
<div class="column is-narrow">
|
|
|
|
{% trans "Delete list" as button_text %}
|
|
|
|
{% include 'snippets/toggle/toggle_button.html' with class="is-danger" text=button_text icon_with_text="x" controls_text="delete_list" controls_uid=list.id focus="modal_title_delete_list" %}
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|
2021-09-20 21:25:11 +00:00
|
|
|
{% endif %}
|
2021-01-31 18:34:25 +00:00
|
|
|
</div>
|