Group, list, and shelve form buttons

This commit is contained in:
Mouse Reeve 2022-03-10 10:49:33 -08:00
parent d4be0ca58b
commit 9977b33a8d
9 changed files with 44 additions and 33 deletions

View file

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block header %} {% block header %}
{% trans "Create Group" %} {% trans "Create group" %}
{% endblock %} {% endblock %}
{% block form %} {% block form %}

View file

@ -8,13 +8,15 @@
{% endblock %} {% endblock %}
{% block modal-footer %} {% block modal-footer %}
<form name="delete-group-{{ group.id }}" action="{% url 'delete-group' group.id %}" method="POST"> <form name="delete-group-{{ group.id }}" action="{% url 'delete-group' group.id %}" method="POST" class="is-flex-grow-1">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="id" value="{{ group.id }}"> <input type="hidden" name="id" value="{{ group.id }}">
<div class="buttons is-right is-flex-grow-1">
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
<button class="button is-danger" type="submit"> <button class="button is-danger" type="submit">
{% trans "Delete" %} {% trans "Delete" %}
</button> </button>
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button> </div>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -16,12 +16,14 @@
</div> </div>
<div class="is-flex"> <div class="is-flex">
{% if group.id %} {% if group.id %}
<div class="is-flex-grow-1"> <div>
<button type="button" data-modal-open="delete_group" class="button is-danger"> <button type="button" data-modal-open="delete_group" class="button is-danger">
{% trans "Delete group" %} {% trans "Delete group" %}
</button> </button>
</div> </div>
{% endif %} {% endif %}
<div class="is-flex is-flex-grow-1 is-justify-content-flex-end">
<div class="field has-addons"> <div class="field has-addons">
<div class="control"> <div class="control">
{% include 'snippets/privacy_select_no_followers.html' with current=group.privacy %} {% include 'snippets/privacy_select_no_followers.html' with current=group.privacy %}
@ -30,4 +32,5 @@
<button type="submit" class="button is-primary">{% trans "Save" %}</button> <button type="submit" class="button is-primary">{% trans "Save" %}</button>
</div> </div>
</div> </div>
</div>
</div> </div>

View file

@ -32,14 +32,16 @@
{% endblock %} {% endblock %}
{% block modal-footer %} {% block modal-footer %}
<button type="submit" class="button is-link"> <div class="buttons is-right is-flex-grow-1">
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
<button type="submit" class="button is-link">
{% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %} {% if list.curation == 'open' or request.user == list.user or list.group|is_member:request.user %}
{% trans "Add" %} {% trans "Add" %}
{% else %} {% else %}
{% trans "Suggest" %} {% trans "Suggest" %}
{% endif %} {% endif %}
</button> </button>
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button> </div>
{% endblock %} {% endblock %}
{% block modal-form-close %}</form>{% endblock %} {% block modal-form-close %}</form>{% endblock %}

View file

@ -8,15 +8,17 @@
{% endblock %} {% endblock %}
{% block modal-footer %} {% block modal-footer %}
<form name="delete-list-{{ list.id }}" action="{% url 'delete-list' list.id %}" method="POST"> <form name="delete-list-{{ list.id }}" action="{% url 'delete-list' list.id %}" method="POST" class="is-flex-grow-1">
{% csrf_token %} {% csrf_token %}
<input type="hidden" name="id" value="{{ list.id }}"> <input type="hidden" name="id" value="{{ list.id }}">
<button class="button is-danger" type="submit"> <div class="buttons is-right is-flex-grow-1">
{% trans "Delete" %}
</button>
<button type="button" class="button" data-modal-close> <button type="button" class="button" data-modal-close>
{% trans "Cancel" %} {% trans "Cancel" %}
</button> </button>
<button class="button is-danger" type="submit">
{% trans "Delete" %}
</button>
</div>
</form> </form>
{% endblock %} {% endblock %}

View file

@ -114,7 +114,7 @@
</fieldset> </fieldset>
</div> </div>
</div> </div>
<div class="is-flex"> <div class="is-flex is-justify-content-end">
{% if list.id %} {% if list.id %}
<div class="is-flex-grow-1"> <div class="is-flex-grow-1">
<button type="button" data-modal-open="delete_list" class="button is-danger"> <button type="button" data-modal-open="delete_list" class="button is-danger">

View file

@ -18,8 +18,10 @@
{% endblock %} {% endblock %}
{% block modal-footer %} {% block modal-footer %}
<button type="submit" class="button is-primary">{% trans "Set" %}</button> <div class="buttons is-right is-flex-grow-1">
<button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button> <button type="button" class="button" data-modal-close>{% trans "Cancel" %}</button>
<button type="submit" class="button is-primary">{% trans "Set" %}</button>
</div>
{% endblock %} {% endblock %}
{% block modal-form-close %}</form>{% endblock %} {% block modal-form-close %}</form>{% endblock %}

View file

@ -2,7 +2,7 @@
{% load i18n %} {% load i18n %}
{% block header %} {% block header %}
{% trans "Create Shelf" %} {% trans "Create shelf" %}
{% endblock %} {% endblock %}
{% block form %} {% block form %}

View file

@ -17,7 +17,7 @@
<label class="label" for="id_description_{{ uuid }}">{% trans "Description:" %}</label> <label class="label" for="id_description_{{ uuid }}">{% trans "Description:" %}</label>
<textarea name="description" cols="40" rows="5" maxlength="500" class="textarea" id="id_description_{{ uuid }}">{{ form.description.value|default:'' }}</textarea> <textarea name="description" cols="40" rows="5" maxlength="500" class="textarea" id="id_description_{{ uuid }}">{{ form.description.value|default:'' }}</textarea>
</div> </div>
<div class="field has-addons"> <div class="field has-addons is-justify-content-end">
<div class="control"> <div class="control">
{% include 'snippets/privacy_select.html' with current=privacy %} {% include 'snippets/privacy_select.html' with current=privacy %}
</div> </div>