mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-24 19:48:36 +02:00
Add sublabels and nonfunctional add-another button
This commit is contained in:
parent
6d83add0e5
commit
56df44643e
3 changed files with 20 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
{{ formset.management_form }}
|
||||
|
||||
{% for form in formset %}
|
||||
{% with sublabel_text="Example: ns"|concat:forloop.counter|concat:".nameserver.com" %}
|
||||
{% if forloop.counter <= 2 %}
|
||||
{% with attr_required=True %}
|
||||
{% input_with_errors form.server %}
|
||||
|
@ -25,9 +26,17 @@
|
|||
{% else %}
|
||||
{% input_with_errors form.server %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
{% endfor %}
|
||||
|
||||
<button
|
||||
<button type="submit" name="submit_button" value="save" class="usa-button usa-button--unstyled display-block">
|
||||
<svg class="usa-icon" aria-hidden="true" focusable="false" role="img" width="24" height="24">
|
||||
<use xlink:href="{%static 'img/sprite.svg'%}#add_circle"></use>
|
||||
</svg><span class="margin-left-05">Add another name server</span>
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="usa-button"
|
||||
>Save</button>
|
||||
|
|
|
@ -28,6 +28,10 @@ error messages, if necessary.
|
|||
{% include "django/forms/label.html" %}
|
||||
{% endif %}
|
||||
|
||||
{% if sublabel_text %}
|
||||
<p id="{{ widget.attrs.id }}__sublabel" class="text-base">{{ sublabel_text }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if field.errors %}
|
||||
<div id="{{ widget.attrs.id }}__error-message">
|
||||
{% for error in field.errors %}
|
||||
|
@ -71,4 +75,4 @@ error messages, if necessary.
|
|||
</span>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
|
@ -6,3 +6,8 @@ from django.template.defaulttags import register
|
|||
@register.filter
|
||||
def get_item(dictionary, key):
|
||||
return dictionary.get(key)
|
||||
|
||||
@register.filter
|
||||
def concat(arg1, arg2):
|
||||
"""concatenate arg1 & arg2"""
|
||||
return str(arg1) + str(arg2)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue