Completed first-found updates of the zone remove view.

Tweaked cancel button style and help text on the zone add view.
This commit is contained in:
Matt Scott 2023-02-19 12:13:13 -05:00
parent 75e262e7e9
commit 6e10f97e9d
2 changed files with 119 additions and 119 deletions

View File

@ -128,7 +128,7 @@
</div> </div>
<!-- /.card-body --> <!-- /.card-body -->
<div class="card-footer"> <div class="card-footer">
<button type="button" title="Cancel" class="btn btn-danger" <button type="button" title="Cancel" class="btn btn-secondary"
onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'"> onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">
<i class="fa-solid fa-window-close"></i>&nbsp;Cancel <i class="fa-solid fa-window-close"></i>&nbsp;Cancel
</button> </button>
@ -145,7 +145,7 @@
<div class="col-12 col-sm-6 col-lg-8"> <div class="col-12 col-sm-6 col-lg-8">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Zone Field Details</h3> <h3 class="card-title">Zone Editor Help</h3>
</div> </div>
<!-- /.card-header --> <!-- /.card-header -->
<div class="card-body"> <div class="card-body">

View File

@ -1,137 +1,137 @@
{% extends "base.html" %} {% extends "base.html" %}
{% set active_page = "remove_domain" %} {% set active_page = "remove_domain" %}
{% block title %}<title>Remove Zone - {{ SITE_NAME }}</title>{% endblock %}
{% block title %}
<title>
Remove Domain - {{ SITE_NAME }}
</title>
{% endblock %}
{% block dashboard_stat %} {% block dashboard_stat %}
<div class="content-header"> <div class="content-header">
<div class="container-fluid"> <div class="container-fluid">
<div class="row mb-2"> <div class="row mb-2">
<div class="col-sm-6"> <div class="col-sm-6">
<h1 class="m-0 text-dark"> <h1 class="m-0 text-dark">
Domain Remove Zone
<small>Remove</small> </h1>
</h1> </div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">Remove Zone</li>
</ol>
</div>
</div>
</div> </div>
<div class="col-sm-6">
<ol class="breadcrumb float-sm-right">
<li class="breadcrumb-item"><a href="{{ url_for('dashboard.dashboard') }}">Dashboard</a></li>
<li class="breadcrumb-item active">Domain - Remove Domain</li>
</ol>
</div>
</div>
</div> </div>
</div>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="content"> <section class="content">
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-4"> <div class="col-12 col-sm-6 col-lg-4">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<h3 class="card-title">Remove Domain</h3> <h3 class="card-title">Zone Selector</h3>
</div> </div>
<form role="form" method="post" action="{{ url_for('domain.remove') }}"> <form role="form" method="post" action="{{ url_for('domain.remove') }}">
<input type="hidden" name="_csrf_token" value="{{ csrf_token() }}"> <input type="hidden" name="_csrf_token" value="{{ csrf_token() }}">
<div class="card-body"> <div class="card-body">
<select id=domainid class="form-control" style="width:15em;"> <div class="form-group">
<option value="0">- Select Domain -</option> <label for="domainid">Zone</label>
{% for domain in domainss %} <select id=domainid class="form-control" style="width:15em;">
<option value="{{ domain.id }}">{{ domain.name }}</option> <option value="0">- Select Domain -</option>
{% endfor %} {% for domain in domainss %}
</select> <option value="{{ domain.id }}">{{ domain.name }}</option>
<br /> {% endfor %}
</select>
</div>
</div>
<div class="card-footer">
<button type="button" title="Cancel" class="btn btn-secondary"
onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">
<i class="fa-solid fa-window-close"></i>&nbsp;Cancel
</button>
<button type="button" title="Remove Zone"
class="btn btn-danger button_delete float-right">
<i class="fa-solid fa-trash-alt"></i>&nbsp;Remove Zone
</button>
</div>
</form>
</div>
</div>
<div class="col-12 col-sm-6 col-lg-8">
<div class="card">
<div class="card-header">
<h3 class="card-title">Zone Selector Help</h3>
</div>
<div class="card-body">
<dl class="dl-horizontal">
<dt>Zone</dt>
<dd>Select the zone you wish to remove from the system.</dd>
</dl>
<p>Find more details at <a href="https://docs.powerdns.com/md/" target="_blank">https://docs.powerdns.com/md/</a>
</p>
</div>
</div>
</div>
</div> </div>
<div class="card-footer">
<button type="button" class="btn btn-secondary" onclick="window.location.href='{{ url_for('dashboard.dashboard') }}'">
<i class="fa-solid fa-window-close"></i>&nbsp;Cancel
</button>
<button type="button" class="btn btn-danger button_delete float-right">
<i class="fa-solid fa-trash-alt"></i>&nbsp;Remove
</button>
</div>
</form>
</div> </div>
</div> </section>
<div class="col-8">
<div class="card">
<div class="card-header">
<h3 class="card-title">Help with removing a domain</h3>
</div>
<div class="card-body">
<dl class="dl-horizontal">
<dt>Domain Name</dt>
<dd>Select the domain you wish to remove from the system.</dd>
</dl>
<p>Find more details at <a href="https://docs.powerdns.com/md/">https://docs.powerdns.com/md/</a></p>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}
<script> <script>
// handle delete button // handle delete button
$(document.body).on("click", ".button_delete", function(e) { $(document.body).on("click", ".button_delete", function (e) {
e.stopPropagation(); e.stopPropagation();
if ( $("#domainid").val() == 0 ){ if ($("#domainid").val() == 0) {
showErrorModal("Please select domain to remove."); showErrorModal("Please select domain to remove.");
return; return;
} }
var modal = $("#modal_delete"); var modal = $("#modal_delete");
var domain = $("#domainid option:selected").text(); var domain = $("#domainid option:selected").text();
var info = "Are you sure you want to delete " + domain + "?"; var info = "Are you sure you want to delete the zone " + domain + "?";
modal.find('.modal-body p').text(info); modal.find('.modal-body p').text(info);
modal.find('#button_delete_confirm').click(function () { modal.find('#button_delete_confirm').click(function () {
$.post($SCRIPT_ROOT + '/domain/remove' , { $.post($SCRIPT_ROOT + '/domain/remove', {
'_csrf_token': '{{ csrf_token() }}', '_csrf_token': '{{ csrf_token() }}',
'domainid': domain, 'domainid': domain,
}, function () { }, function () {
window.location.href = '{{ url_for('dashboard.dashboard') }}'; window.location.href = '{{ url_for('dashboard.dashboard') }}';
}); });
modal.modal('hide'); modal.modal('hide');
}) })
modal.modal('show'); modal.modal('show');
$("#button_delete_cancel").unbind().one('click', function(e) { $("#button_delete_cancel").unbind().one('click', function (e) {
modal.modal('hide'); modal.modal('hide');
}); });
}); });
</script> </script>
{% endblock %} {% endblock %}
{% block modals %} {% block modals %}
<div class="modal fade modal-warning" id="modal_delete"> <div class="modal fade modal-warning" id="modal_delete">
<div class="modal-dialog"> <div class="modal-dialog">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title">Confirmation</h4> <h4 class="modal-title">Zone Removal Confirmation</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span> <span aria-hidden="true">&times;</span>
</button> </button>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<p></p> <p></p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" id="button_delete_cancel" data-dismiss="modal"> <button type="button" title="Cancel" class="btn btn-secondary" id="button_delete_cancel"
<i class="fa-solid fa-window-close"></i>&nbsp;Cancel data-dismiss="modal">
</button> <i class="fa-solid fa-window-close"></i>&nbsp;Cancel
<button type="button" class="btn btn-danger float-right" id="button_delete_confirm"> </button>
<i class="fa-solid fa-trash-alt"></i>&nbsp;Remove <button type="button" title="Remove Zone" class="btn btn-danger float-right"
</button> id="button_delete_confirm">
</div> <i class="fa-solid fa-trash-alt"></i>&nbsp;Remove Zone
</button>
</div>
</div>
</div>
</div> </div>
</div>
</div>
{% endblock %} {% endblock %}