mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 14:40:27 +00:00
Added Jinja filter for handle formatting of zone type labels to enforce modern social standards.
Removed text label of dashboard domain list action menu to reduce size. Continuing work on re-design and clean-up of dashboard view.
This commit is contained in:
parent
d70ded18c2
commit
4f83879e95
@ -77,6 +77,7 @@ def create_app(config=None):
|
||||
app.jinja_env.filters['display_setting_state'] = utils.display_setting_state
|
||||
app.jinja_env.filters['pretty_domain_name'] = utils.pretty_domain_name
|
||||
app.jinja_env.filters['format_datetime_local'] = utils.format_datetime
|
||||
app.jinja_env.filters['format_zone_type'] = utils.format_zone_type
|
||||
|
||||
# Register context proccessors
|
||||
from .models.setting import Setting
|
||||
|
@ -132,6 +132,16 @@ def display_master_name(data):
|
||||
return ", ".join(matches)
|
||||
|
||||
|
||||
def format_zone_type(data):
|
||||
"""Formats the given zone type for modern social standards."""
|
||||
data = str(data).lower()
|
||||
if data == 'master':
|
||||
data = 'primary'
|
||||
elif data == 'slave':
|
||||
data = 'secondary'
|
||||
return data.title()
|
||||
|
||||
|
||||
def display_time(amount, units='s', remove_seconds=True):
|
||||
"""
|
||||
Convert timestamp to normal time format
|
||||
|
@ -199,7 +199,7 @@
|
||||
<!-- /.card-header -->
|
||||
<div class="card-body table-responsive p-0 pt-2">
|
||||
<table id='tbl_domain_list_{{ boxId }}'
|
||||
class="table table-striped table-hover">
|
||||
class="table table-striped table-hover records table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
@ -236,6 +236,9 @@
|
||||
|
||||
{% block head_styles %}
|
||||
<style type="text/css">
|
||||
table.records thead th, table.records tbody td { text-align: center; vertical-align: middle; }
|
||||
table.records tbody td:first-of-type { text-align: left; }
|
||||
table.records thead th:last-of-type { width: 50px; }
|
||||
div.table-responsive > div.dataTables_wrapper > div.row:first-of-type { margin: 0 0.5em 0 0.5em; }
|
||||
div.table-responsive > div.dataTables_wrapper > div.row:last-of-type { margin: 0.4em 0.5em 0.4em 0.5em; }
|
||||
div.table-responsive > div.dataTables_wrapper table.dataTable { margin: 0!important; }
|
||||
|
@ -11,7 +11,7 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro type(domain) %}
|
||||
{{ domain.type }}
|
||||
{{ domain.type | format_zone_type }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro serial(domain) %}
|
||||
@ -19,12 +19,12 @@
|
||||
{% endmacro %}
|
||||
|
||||
{% macro master(domain) %}
|
||||
{% if domain.master == '[]'%}-{% else %}{{ domain.master | display_master_name }}{% endif %}
|
||||
{% if domain.master == '[]'%}N/A{% else %}{{ domain.master | display_master_name }}{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro account(domain) %}
|
||||
{% if current_user.role.name in ['Administrator', 'Operator'] %}
|
||||
{{ domain.account.name if domain.account else '-' }}
|
||||
{{ domain.account.name if domain.account else 'None' }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
<td width="6%">
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa-solid fa-bars"></i> Actions
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenu">
|
||||
{% if current_user.role.name in ['Administrator', 'Operator'] %}
|
||||
|
Loading…
Reference in New Issue
Block a user