Working on dashboard zone list action controls and styling.

This commit is contained in:
Matt Scott 2023-02-19 10:45:19 -05:00
parent 4a5db674f4
commit 1cd5ce9ccc

View File

@ -1,17 +1,23 @@
{% macro name(domain) %} {% macro name(domain) %}
<a href="{{ url_for('domain.domain', domain_name=domain.name) }}"><strong>{{ domain.name | pretty_domain_name }}</strong></a> <a href="{{ url_for('domain.domain', domain_name=domain.name) }}"><strong>{{ domain.name | pretty_domain_name }}</strong></a>
{% endmacro %} {% endmacro %}
{% macro dnssec(domain) %} {% macro dnssec(domain) %}
{% if domain.dnssec %} {% if domain.dnssec %}
<td><span style="cursor:pointer" class="badge badge-success button_dnssec" id="{{ domain.name }}"><i class="fa-solid fa-lock"></i>&nbsp;Enabled</span></td> <td>
{% else %} <button class="btn badge btn-success button_dnssec" title="Edit DNSSEC" id="{{ domain.name }}"><i
<td><span style="cursor:pointer" class="badge badge-danger button_dnssec" id="{{ domain.name }}"><i class="fa-solid fa-lock-open"></i>&nbsp;Disabled</span></td> class="fa-solid fa-lock"></i></button>
{% endif %} </td>
{% else %}
<td>
<button class="btn badge btn-danger button_dnssec" title="Enable DNSSEC" id="{{ domain.name }}"><i
class="fa-solid fa-lock-open"></i></button>
</td>
{% endif %}
{% endmacro %} {% endmacro %}
{% macro type(domain) %} {% macro type(domain) %}
{{ domain.type | format_zone_type }} {{ domain.type | format_zone_type }}
{% endmacro %} {% endmacro %}
{% macro serial(domain) %} {% macro serial(domain) %}
@ -19,61 +25,53 @@
{% endmacro %} {% endmacro %}
{% macro master(domain) %} {% macro master(domain) %}
{% if domain.master == '[]'%}N/A{% else %}{{ domain.master | display_master_name }}{% endif %} {% if domain.master == '[]' %}N/A{% else %}{{ domain.master | display_master_name }}{% endif %}
{% endmacro %} {% endmacro %}
{% macro account(domain) %} {% macro account(domain) %}
{% if current_user.role.name in ['Administrator', 'Operator'] %} {% if current_user.role.name in ['Administrator', 'Operator'] %}
{{ domain.account.name if domain.account else 'None' }} {{ domain.account.name if domain.account else 'None' }}
{% endif %} {% endif %}
{% endmacro %} {% endmacro %}
{% macro actions(domain) %} {% macro actions(domain) %}
<td width="6%"> <td>
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown"
<i class="fa-solid fa-bars"></i> aria-haspopup="true" aria-expanded="false">
</button> <i class="fa-solid fa-bars"></i>
<div class="dropdown-menu" aria-labelledby="dropdownMenu"> </button>
{% if current_user.role.name in ['Administrator', 'Operator'] %} <div class="dropdown-menu" aria-labelledby="dropdownMenu">
<button class="dropdown-item btn-success button_template" id="{{ domain.name }}" type="button"> <button class="dropdown-item btn-success" type="button"
<i class="fa-solid fa-clone"></i>&nbsp;Clone to Template onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'">
</button> <i class="fa-solid fa-pencil"></i>&nbsp;Edit Records
<button class="dropdown-item btn-success" type="button" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'"> </button>
<i class="fa-solid fa-cog"></i>&nbsp;Manage Domain
</button> {% if current_user.role.name in ['Administrator', 'Operator'] %}
<button class="dropdown-item btn-danger" type="button" onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'"> <button class="dropdown-item btn-danger" type="button"
<i class="fa-solid fa-cog"></i>&nbsp;Admin Settings onclick="window.location.href='{{ url_for('domain.setting', domain_name=domain.name) }}'">
</button> <i class="fa-solid fa-cog"></i>&nbsp;Zone Settings
<button class="dropdown-item btn-primary" type="button" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'"> </button>
<i class="fa-solid fa-history" aria-hidden="true"></i>&nbsp;Domain Changelog <button class="dropdown-item btn-success button_template" id="{{ domain.name }}" type="button">
</button> <i class="fa-solid fa-clone"></i>&nbsp;Create Template
<div class="dropdown-divider"></div> </button>
<button type="button"class="dropdown-item btn-secondary button_delete" onclick="window.location.href='{{ url_for('domain.remove') }}'"> {% endif %}
<font color="red">
<i class="fa-solid fa-trash"></i>&nbsp;Remove Domain {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_view_history %}
</font> <button class="dropdown-item btn-primary" type="button"
</button> onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'">
</div> <i class="fa-solid fa-history" aria-hidden="true"></i>&nbsp;Zone Changelog
{% else %} </button>
<button class="dropdown-item btn-success" type="button" onclick="window.location.href='{{ url_for('domain.domain', domain_name=domain.name) }}'"> {% endif %}
<i class="fa-solid fa-cog"></i>&nbsp;Manage Domain
</button> {% if current_user.role.name in ['Administrator', 'Operator'] or allow_user_remove_domain %}
{% if allow_user_view_history %} <div class="dropdown-divider"></div>
<button class="dropdown-item btn-primary" type="button" onclick="window.location.href='{{ url_for('domain.changelog', domain_name=domain.name) }}'"> <button type="button" class="dropdown-item btn-secondary button_delete"
<i class="fa-solid fa-history" aria-hidden="true"></i>&nbsp;Domain Changelog onclick="window.location.href='{{ url_for('domain.remove') }}'">
</button> <span style="color: red;"><i class="fa-solid fa-trash"></i>&nbsp;Remove Zone</span>
{% endif %} </button>
{% if allow_user_remove_domain %} {% endif %}
<div class="dropdown-divider"></div> </div>
<button type="button"class="dropdown-item btn-secondary button_delete" onclick="window.location.href='{{ url_for('domain.remove') }}'"> </div>
<font color="red"> </td>
<i class="fa-solid fa-trash"></i>&nbsp;Remove Domain
</font>
</button>
{% endif %}
{% endif %}
</div>
</div>
</td>
{% endmacro %} {% endmacro %}