Browse Source

Use standard form styling for 'create task' form

Matt Westcott 3 years ago
parent
commit
05fdea0394

+ 0 - 21
client/scss/elements/_forms.scss

@@ -71,27 +71,6 @@ label,
     }
 }
 
-// Provide a way to "unfloat" all form elements
-.no-float-elements {
-    label,
-    .label {
-        display: block;
-        float: none;
-        padding: 1.2em 0 0.8em;
-        width: auto;
-    }
-
-    li > label,
-    li > .label {
-        padding-top: 0;
-    }
-
-    .helptext {
-        display: inline-block;
-        margin-bottom: 0.8em;
-    }
-}
-
 input:not([type=submit]),
 textarea,
 select,

+ 14 - 7
wagtail/admin/templates/wagtailadmin/workflows/task_chooser/includes/create_form.html

@@ -1,4 +1,4 @@
-{% load i18n %}
+{% load i18n wagtailadmin_tags %}
 
 {{ form.media.css }}
 {{ form.media.js }}
@@ -7,12 +7,19 @@
     <a href="{% url 'wagtailadmin_workflows:task_chooser_create' %}" class="choose-different-task-type">{% trans "Choose a different task type" %}</a>
 {% endif %}
 
-<form class="task-create no-float-elements" action="{{ add_url }}" enctype="multipart/form-data" method="POST" novalidate>
+<form class="task-create" action="{{ add_url }}" enctype="multipart/form-data" method="POST" novalidate>
     {% csrf_token %}
 
-    {{ form }}
-
-    <div class="clearfix">
-        <button type="submit" class="button action-save button-longrunning" data-clicked-text="{% trans 'Creating…' %}">{% trans "Create" %}</button>
-    </div>
+    <ul class="fields">
+        {% for field in form %}
+            {% if field.is_hidden %}
+                {{ field }}
+            {% else %}
+                {% include "wagtailadmin/shared/field_as_li.html" with field=field %}
+            {% endif %}
+        {% endfor %}
+        <li>
+            <button type="submit" class="button button-longrunning" data-clicked-text="{% trans 'Creating…' %}">{% icon name="spinner" %}<em>{% trans "Create" %}</em></button>
+        </li>
+    </ul>
 </form>