Uses details instead of javascript for inline forms

This commit is contained in:
Mouse Reeve 2022-03-10 11:12:01 -08:00
parent ad1969162f
commit b9eb40924a
3 changed files with 25 additions and 29 deletions

View file

@ -1,15 +1,15 @@
{% load i18n %}
<section class="card {% if not visible %}is-hidden {% endif %}{{ class }}" id="{{ controls_text }}{% if controls_uid %}-{{ controls_uid }}{% endif %}">
<header class="card-header has-background-secondary">
<h2 class="card-header-title" tabindex="0" id="{{ controls_text }}{% if controls_uid %}-{{ controls_uid }}{% endif %}_header">
{% block header %}{% endblock %}
</h2>
<span class="card-header-icon">
{% trans "Close" as button_text %}
{% include 'snippets/toggle/toggle_button.html' with label=button_text class="delete" nonbutton=True controls_text=controls_text %}
</span>
</header>
<section class="card-content content">
<details
class="details-panel box"
{% if visible %}open{% endif %}
open
>
<summary role="heading" aria-level="2">
<span class="title is-5">{% block header %}{% endblock %}</span>
<span class="details-close icon icon-x" aria-hidden="true"></span>
</summary>
<section class="{{ class }} mt-2">
{% block form %}{% endblock %}
</section>
</section>
</details>

View file

@ -7,11 +7,15 @@
<div class="column is-two-thirds">
<div class="field">
<label class="label" for="id_name">{% trans "Name:" %}</label>
{{ list_form.name }}
<div class="control">
{{ list_form.name }}
</div>
</div>
<div class="field">
<label class="label" for="id_description">{% trans "Description:" %}</label>
{{ list_form.description }}
<div class="control">
{{ list_form.description }}
</div>
</div>
</div>
<div class="column">

View file

@ -6,21 +6,13 @@
{% block content %}
<header class="block columns is-mobile">
<div class="column">
<h1 class="title">
{% trans "Lists" %}
{% if request.user.is_authenticated %}
<a class="help has-text-weight-normal" href="{% url 'user-lists' request.user|username %}">{% trans "Your Lists" %}</a>
{% endif %}
</h1>
</div>
{% if request.user.is_authenticated %}
<div class="column is-narrow">
{% trans "Create List" as button_text %}
{% include 'snippets/toggle/open_button.html' with controls_text="create_list" icon_with_text="plus" text=button_text focus="create_list_header" %}
</div>
{% endif %}
<header class="block">
<h1 class="title">
{% trans "Lists" %}
{% if request.user.is_authenticated %}
<a class="help has-text-weight-normal" href="{% url 'user-lists' request.user|username %}">{% trans "Your Lists" %}</a>
{% endif %}
</h1>
</header>
{% if request.user.is_authenticated %}
<div class="block">