diff --git a/assets/styles/main.css b/assets/styles/main.css index f6f68b0..92004d7 100644 --- a/assets/styles/main.css +++ b/assets/styles/main.css @@ -179,17 +179,6 @@ a.button { form h3 { margin: 0; margin-top: 2rem; - display: flex; - align-items: center; - - &::after { - /*content: '';*/ - height: 1px; - flex: 1; - display: block; - background-color: black; - margin-left: .5em; - } } fieldset { @@ -210,10 +199,6 @@ fieldset { bottom: -.55em; margin-bottom: .5rem; } - - & + button.form-new-item { - margin-top: 1rem; - } } input[type="text"] { @@ -238,6 +223,16 @@ textarea { flex-direction: column; } + & > div.input-group { + flex-direction: row; + align-items: baseline; + + input, + textarea { + flex: 1; + } + } + label { margin-bottom: .5rem; } diff --git a/templates/macros/display_rrset.html b/templates/macros/display_rrset.html index c0a9551..ec16ad5 100644 --- a/templates/macros/display_rrset.html +++ b/templates/macros/display_rrset.html @@ -12,9 +12,7 @@ {% endif %}
diff --git a/templates/macros/form.html b/templates/macros/form.html new file mode 100644 index 0000000..3575da0 --- /dev/null +++ b/templates/macros/form.html @@ -0,0 +1,51 @@ +{% macro input(id, name, value, type="text", description="", errors, error_msg_id, label, label_attributes, attributes) %} + +{% set filtered_errors = [] %} + +{% for error in errors %} + {% if error %} + {% set_global filtered_errors = filtered_errors | concat(with=error) %} + {% endif %} +{% endfor %} + + ++ {{ tr( + msg=error_msg_id, + attr="error-" ~ error.code | replace(from=":", to="-"), + lang=lang) }} +
+ {% endfor %} + {% if description %} ++ {{ description }} +
+ {% endif %} +- {{ tr( - msg="record-input-ttl", - attr="error-" ~ ttl_error.code | replace(from=":", to="-"), - lang=lang) }} -
- {% endif %} -- {{ tr(msg="record-input-ttl", attr="help", lang=lang) }} -
+ {{ + form::input( + id="address-ttl", + name="addresses[ttl]", + value=address.address | default(value=""), + type="number", + errors=[ ttl_error ], + error_msg_id="record-input-ttl", + description=tr(msg="record-input-ttl", attr="help", lang=lang), + label=tr(msg="record-input-ttl", attr="input-label", lang=lang), + label_attributes=[], + attributes=[], + ) + }}- {% if global_address_error %} - {{ tr( - msg="record-input-addresses", - attr="error-" ~ global_address_error.code | replace(from=":", to="-"), - lang=lang) }} - {% else %} - {{ tr( - msg="record-input-addresses", - attr="error-" ~ address_error.code | replace(from=":", to="-"), - lang=lang) }} - {% endif %} -
- {% endif %} -