nomilo/templates/pages/records.html

103 lines
4.5 KiB
HTML
Raw Permalink Normal View History

2025-04-30 08:38:03 +00:00
{% import "macros/display_rrset.html" as rrset %}
2024-12-22 21:36:26 +00:00
{% extends "bases/app.html" %}
2025-03-31 00:16:10 +00:00
2025-04-01 22:49:56 +00:00
{% block title %}{{ tr(msg="zone-content-title", lang=lang) }} - {{ current_zone }} - {% endblock title %}
2024-12-22 21:36:26 +00:00
{% block main %}
2025-04-01 22:49:56 +00:00
<h1>{{ tr(msg="zone-header", lang=lang, zone_name="<strong>" ~ current_zone ~ "</strong>") | safe }}</h1>
2025-03-31 00:16:10 +00:00
<svg width="0" height="0" aria-hidden="true" style="position: absolute;">
2024-12-22 21:36:26 +00:00
<defs>
<clipPath id="corner-folder-tab-right" clipPathUnits="objectBoundingBox">
<path d="m 0,0 c .25,0 0.75,1 1,1 l -1,0 z"/>
</clipPath>
</defs>
</svg>
2025-05-11 11:40:35 +00:00
2024-12-22 21:36:26 +00:00
<section>
2025-04-01 22:49:56 +00:00
<h2>{{ tr(msg="zone-content-records-header", lang=lang) }}</h2>
2025-05-11 11:40:35 +00:00
{% for node in records.records %}
2024-12-22 21:36:26 +00:00
<article class="domain">
<header>
2025-05-11 11:40:35 +00:00
<h3 class="folder-tab">{{ node.name }}</h3>
2024-12-22 21:36:26 +00:00
<span class="sep"></span>
2025-05-11 11:40:35 +00:00
<a href="{{ url }}/new?subdomain={{ node.name | trim_end_matches(pat=current_zone) | trim_end_matches(pat=".") }}" class="button">
2024-12-22 21:36:26 +00:00
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-plus-circle" viewBox="0 0 16 16" aria-hidden="true">
<path d="M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14m0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16"/>
<path d="M8 4a.5.5 0 0 1 .5.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3A.5.5 0 0 1 8 4"/>
</svg>
2025-04-01 22:49:56 +00:00
{{ tr(msg="zone-content-new-record-button", lang=lang) }}
2024-12-22 21:36:26 +00:00
</a>
</header>
2025-05-11 11:40:35 +00:00
{% set sections = node.records | group_by(attribute="record_section") %}
2024-12-22 21:36:26 +00:00
<div class="records">
2025-05-11 11:40:35 +00:00
{% if sections.web %}
{% set records = sections.web | group_by(attribute="record_type") %}
2025-04-01 22:49:56 +00:00
<h4>{{ tr(msg="zone-content-section-web-header", lang=lang) }}</h4>
2024-12-22 21:36:26 +00:00
<ul>
2025-05-11 11:40:35 +00:00
{% if records.addresses %}
2025-04-30 08:38:03 +00:00
{{ rrset::rrset(
2025-05-11 11:40:35 +00:00
record=records.addresses.0,
2025-04-01 18:03:15 +00:00
zone=current_zone,
lang=lang) }}
2025-03-31 00:16:10 +00:00
{% endif %}
</ul>
{% endif %}
2025-05-11 11:40:35 +00:00
{% if sections.mail %}
{% set records = sections.mail | group_by(attribute="record_type") %}
2025-04-01 22:49:56 +00:00
<h4>{{ tr(msg="zone-content-section-mail-header", lang=lang) }}</h4>
2025-03-31 00:16:10 +00:00
<ul>
2025-05-11 11:40:35 +00:00
{% if records.mailservers %}
2025-04-30 08:38:03 +00:00
{{ rrset::rrset(
2025-05-11 11:40:35 +00:00
record=records.mailservers.0,
2025-04-01 18:03:15 +00:00
zone=current_zone,
lang=lang) }}
2025-03-31 00:16:10 +00:00
{% endif %}
2025-05-11 11:40:35 +00:00
{% if records.spf %}
2025-04-30 08:38:03 +00:00
{{ rrset::rrset(
2025-05-11 11:40:35 +00:00
record=records.spf.0,
2025-04-01 18:03:15 +00:00
zone=current_zone,
lang=lang) }}
2024-12-22 21:36:26 +00:00
{% endif %}
2025-03-31 00:16:10 +00:00
</ul>
2025-05-09 14:57:06 +00:00
{% endif %}
2025-05-11 11:40:35 +00:00
{% if sections.services %}
2025-05-09 14:57:06 +00:00
<h4>{{ tr(msg="zone-content-section-services-header", lang=lang) }}</h4>
<ul>
2025-05-11 11:40:35 +00:00
{% for service in sections.services %}
2025-05-09 14:57:06 +00:00
{{ rrset::rrset(
2025-05-11 11:40:35 +00:00
record=service,
2025-05-09 14:57:06 +00:00
zone=current_zone,
2025-05-11 11:40:35 +00:00
lang=lang) }}
2025-05-09 14:57:06 +00:00
{% endfor %}
</ul>
2025-03-31 00:16:10 +00:00
{% endif %}
2025-05-11 11:40:35 +00:00
{% if sections.miscellaneous %}
2025-04-01 22:49:56 +00:00
<h4>{{ tr(msg="zone-content-section-general-header", lang=lang) }}</h4>
2025-03-31 00:16:10 +00:00
<ul>
2025-05-11 11:40:35 +00:00
{% for record in sections.miscellaneous %}
2025-04-30 08:38:03 +00:00
{{ rrset::rrset(
2025-05-11 11:40:35 +00:00
record=record,
2025-04-01 18:03:15 +00:00
zone=current_zone,
lang=lang) }}
2025-03-31 00:16:10 +00:00
{% endfor %}
</ul>
{% endif %}
</div>
</article>
{% endfor %}
</section>
<section>
2025-04-01 22:49:56 +00:00
<h2>{{ tr(msg="zone-content-aliases-header", lang=lang) }}</h2>
2025-03-31 00:16:10 +00:00
<ul>
{% for alias in records.aliases %}
<li>{{ alias.from }} → {{ alias.target }}</li>
2024-12-22 21:36:26 +00:00
{% endfor %}
2025-03-31 00:16:10 +00:00
</ul>
2024-12-22 21:36:26 +00:00
</section>
{% endblock main %}