{# DATA FIELDS current_data: dict schema: BaseModel.model_json_schema() system_fields: Optional[list] # An optional list of fields to disable when "system" # is not part of a user's ACL root_key: Optional[str] # A string to encapsulate a name in, # i.e. a root_key "profile" for a field "email" becomes "profile.email" #} {% for k, v in schema.properties.items() if k not in without %} {% if v.type in ["text", "email", "number"] %} {% set readonly = True if "readonly" in v.input_extra else False %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% elif v.type in ["date", "datetime-local"] %} {% set readonly = True if "readonly" in v.input_extra else False %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% elif v.type == "select:multi" or v.type == "select" %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% elif v.type == "tresor" %} {% if request.path == "/profile/" %}
{% if not current_data[k] %} Password Confirm password Setup encryption {% else %} Current password New password Confirm new password Change password {% endif %}
{% endif %} {% elif v.type == "datalist" %}
{% for option in v.options %} {% if v.description %} {{ v.description|safe }} {% endif %}
{% elif (v.type == "users:multi" or v.type == "users") and "system" in session["acl"] %} {% if not request.form_options.users or request.form_options.users == [] %}

No users found

{% else %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% endif %} {% elif v.type == "emailusers:multi" or v.type == "emailusers" %} {% if request.form_options.emailusers == [] %}

No email users available

{% else %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% endif %} {% elif v.type == "list:text" or v.type == "list:number" %} {% set readonly = True if "readonly" in v.input_extra else False %}
{{ v.title }} Add {{ "🚫" if readonly }} {% for list_value in current_data[k] or v.default %}
Remove
{% endfor %}
{% if v.description %} {{ v.description|safe }} {% endif %} {% elif v.type == "radio" %}
{{ v.title }} {% for radio_value in v.enum %} {% endfor %} {% if v.description %} {{ v.description|safe }} {% endif %}
{% elif v.type == "keypair" %} {% if not request.form_options.keypairs or request.form_options.keypairs == [] %}

No key pairs available

{% else %}
{% if v.description %} {{ v.description|safe }}
The required DNS TXT record's value for your convenience (force reload)
{% endif %}
{% endif %} {% elif v.type == "domain" %} {% if request.form_options.domains == [] %}

No domain available

{% else %}
{% if v.description %} {{ v.description|safe }} {% endif %}
{% endif %} {% endif %} {% endfor %}