mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2025-06-16 04:56:05 +00:00
Clean up dashboard zone tabs
* Rename `customBoxes` to be more descriptive and follow CamelCase name convention for classes * Change the tab info from a tuple to a named tuple * Change all access to the tab info tuple from index to (new) property name * Rename/Relabel the tabs * Add docstrings * Simplify the domain filter logic * Simplify/Unify the tab html template
This commit is contained in:
@ -176,17 +176,11 @@
|
||||
<div class="nav-tabs-custom">
|
||||
<ul class="nav nav-tabs card-header-tabs" id="custom-content-below-tab"
|
||||
role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" href="#tab_{{ custom_boxes.order[0] }}"
|
||||
data-toggle="pill" role="tab">
|
||||
Zones <b>{{ custom_boxes.boxes[custom_boxes.order[0]][0] }}</b>
|
||||
</a>
|
||||
</li>
|
||||
{% for boxId in custom_boxes.order[1:] %}
|
||||
{% for tab_id in zone_tabs.order %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#tab_{{ boxId }}" data-toggle="pill"
|
||||
role="tab">
|
||||
Zones <b>{{ custom_boxes.boxes[boxId][0] }}</b>
|
||||
<a class="nav-link {% if loop.first %}active{% endif %}"
|
||||
href="#tab_{{ tab_id }}" data-toggle="pill" role="tab">
|
||||
Zones <b>{{ zone_tabs.tabs[tab_id].display_name }}</b>
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
@ -197,10 +191,11 @@
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body p-0">
|
||||
<div class="tab-content">
|
||||
{% for boxId in custom_boxes.order %}
|
||||
<div class="tab-pane show" id='tab_{{ boxId }}'>
|
||||
{% for tab_id in zone_tabs.order %}
|
||||
<div id='tab_{{ tab_id }}'
|
||||
class="tab-pane show {% if loop.first %}active{% endif %}">
|
||||
<div class="card-body table-responsive records p-0 pt-2">
|
||||
<table id='tbl_domain_list_{{ boxId }}'
|
||||
<table id='tbl_domain_list_{{ tab_id }}'
|
||||
class="table table-striped table-hover table-sm records">
|
||||
<thead>
|
||||
<tr>
|
||||
@ -274,9 +269,8 @@
|
||||
});
|
||||
}
|
||||
|
||||
$('#tab_{{custom_boxes.order[0]}}').addClass("active");
|
||||
{% for boxId in custom_boxes.order %}
|
||||
setUpDomainList("#tbl_domain_list_{{boxId}}", "{{url_for('dashboard.domains_custom',boxId=boxId)}}");
|
||||
{% for tab_id in zone_tabs.order %}
|
||||
setUpDomainList("#tbl_domain_list_{{tab_id}}", "{{url_for('dashboard.domains_custom',tab_id=tab_id)}}");
|
||||
{% endfor %}
|
||||
//SYBPATCH END//
|
||||
|
||||
|
Reference in New Issue
Block a user