mirror of
https://forge.dns-witch.net/dns-witch/nomilo.git
synced 2026-08-15 07:15:05 +02:00
68 lines
2.6 KiB
HTML
68 lines
2.6 KiB
HTML
<h1>{{ tr(msg="record-config-texts-heading", name=new_record_name) }}</h1>
|
|
|
|
<form id="main-form" method="post" action="">
|
|
{% include "partials/advanced_mode.html" %}
|
|
|
|
{% if advanced %}
|
|
<div class="form-input">
|
|
{{
|
|
<form.input
|
|
id="texts-ttl"
|
|
name="texts[ttl]"
|
|
value={input_data?.texts?.ttl}
|
|
type="number"
|
|
errors
|
|
errors_keys={[ "/texts/ttl" ]}
|
|
error_msg_id="record-input-ttl"
|
|
description={tr(msg="record-input-ttl", attr="help")}
|
|
label={tr(msg="record-input-ttl", attr="input-label")}
|
|
lang
|
|
/>
|
|
}}
|
|
</div>
|
|
{% else %}
|
|
<input
|
|
type="hidden"
|
|
name="texts[ttl]"
|
|
value="{{ input_data?.texts?.ttl | default(value="") }}"
|
|
>
|
|
{% endif %}
|
|
|
|
{%- for text in input_data?.texts?.data?.texts | default(value=[ none ]) -%}
|
|
<div class="form-input" data-new-item-template="text">
|
|
{{
|
|
<form.input
|
|
id={"text-" ~ loop.index0}
|
|
name={"texts[data][texts][" ~loop.index0 ~ "][text]"}
|
|
value={text?.text}
|
|
type="text"
|
|
errors
|
|
errors_keys={[
|
|
"/texts/data",
|
|
"/texts/data/texts/" ~ loop.index0 ~ "/text",
|
|
]}
|
|
error_msg_id="record-input-texts"
|
|
label={tr(msg="record-input-texts", attr="input-label", index=loop.index)}
|
|
label_attributes={ {"data-new-item-template-attr": "for",
|
|
"data-template-for": "address-{i}",
|
|
"data-new-item-template-content": tr(msg="record-input-texts", attr="input-label", index="{i}")
|
|
} }
|
|
delete_button_msg={tr(msg="record-input-texts", attr="delete-button", index=loop.index)}
|
|
delete_button_msg_template={tr(msg="record-input-texts", attr="delete-button", index="{i}")}
|
|
attributes={ {
|
|
"data-new-item-template-attr": "name id",
|
|
"data-template-name": "texts[data][texts][{i}][text]",
|
|
"data-template-id": "text-{i}",
|
|
} }
|
|
lang
|
|
/>
|
|
}}
|
|
</div>
|
|
{%- endfor -%}
|
|
<button class="link" type="button" data-new-item="text">
|
|
{{ <icon.plus_circle /> }}
|
|
{{ tr(msg="button-add-text") }}
|
|
</button>
|
|
|
|
{% include "partials/form_submit.html" %}
|
|
</form>
|