{% load i18n %}
{% load netbox_dhcp %}

{% if object.ddns_send_updates %}
<div class="card">
    <h5 class="card-header">{% trans "Dynamic DNS Update" %}</h5>
    <table class="table table-hover attr-table">
        <tr>
            <th scope="row">{% trans "Send DDNS updates" %}</th>
            <td>{% null_checkmark object.ddns_send_updates %}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Override client 'no update' flag" %}</th>
            <td>{% null_checkmark object.ddns_override_no_update %}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Override client delegation flags" %}</th>
            <td>{% null_checkmark object.ddns_override_client_update %}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Replace Client Name" %}</th>
            <td>{% badge object.get_ddns_replace_client_name_display bg_color=object.get_ddns_replace_client_name_color %}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Generated Prefix" %}</th>
            <td>{{ object.ddns_generated_prefix|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Qualifying Suffix" %}</th>
            <td>{{ object.ddns_qualifying_suffix|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Update DDNS on renew" %}</th>
            <td>{% null_checkmark object.ddns_update_on_renew %}</td>
        </tr>
        <th scope="row">{% trans "Conflict Resolution Mode" %}</th>
            <td>{% badge object.get_ddns_conflict_resolution_mode_display bg_color=object.get_ddns_conflict_resolution_mode_color %}</td>
        <tr>
            <th scope="row">{% trans "TTL Percent" %}</th>
            <td>{{ object.ddns_ttl_percent|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "TTL" %}</th>
            <td>{{ object.ddns_ttl|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Minimum TTL" %}</th>
            <td>{{ object.ttl_min|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Maximum TTL" %}</th>
            <td>{{ object.ddns_ttl_max|placeholder }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Allowed Characters in Host Names" %}</th>
            <td>{{ object.hostname_char_set }}</td>
        </tr>
        <tr>
            <th scope="row">{% trans "Replacement Character for Invalid Host Names" %}</th>
            <td>{{ object.hostname_char_replacement }}</td>
        </tr>
    </table>
</div>
{% endif %}
