Enable echomail subscription by any of a systems address
This commit is contained in:
@@ -30,7 +30,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="offset-2 col-3" id="echoarea-summary">
|
||||
<!-- Select Address -->
|
||||
<div class="col-3">
|
||||
<div class="d-none" id="address-select">
|
||||
<label for="address_id" class="form-label">Address</label>
|
||||
<div class="input-group">
|
||||
<span class="input-group-text"><i class="bi bi-hash"></i></span>
|
||||
<select class="form-select" id="address_id" name="address_id" required>
|
||||
<option></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Summary of Addresses -->
|
||||
<div class="offset-3 col-3" id="echoarea-summary">
|
||||
<table class="table monotable">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -65,8 +79,45 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#domain_id').on('change',function() {
|
||||
if (! $(this).val()) {
|
||||
$('#echoarea-summary').removeClass('d-none');
|
||||
$('#address-select').addClass('d-none');
|
||||
return;
|
||||
} else {
|
||||
$('#address-select').removeClass('d-none');
|
||||
}
|
||||
|
||||
var item = this;
|
||||
icon = $(item).parent().find('i');
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: {domain_id: $(item).val()},
|
||||
beforeSend: function() {
|
||||
icon.addClass('spinner-grow spinner-grow-sm');
|
||||
},
|
||||
success: function(data) {
|
||||
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||
$('#address_id')
|
||||
.empty()
|
||||
.append($('<option>'))
|
||||
.append(data.map(function(item) {
|
||||
return $('<option>').val(item.id).text(item.value);
|
||||
}));
|
||||
},
|
||||
error: function(e) {
|
||||
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||
|
||||
if (e.status != 412)
|
||||
alert('That didnt work? Please try again....');
|
||||
},
|
||||
url: '{{ url('api/system/address',[$o->id]) }}',
|
||||
cache: false
|
||||
})
|
||||
});
|
||||
|
||||
$('#address_id').on('change',function() {
|
||||
if (! $(this).val()) {
|
||||
$('#echoarea-summary').removeClass('d-none');
|
||||
$('#echoarea-select').addClass('d-none');
|
||||
@@ -83,7 +134,7 @@
|
||||
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
data: {domain_id: $(item).val()},
|
||||
data: {address_id: $(item).val()},
|
||||
beforeSend: function() {
|
||||
icon.addClass('spinner-grow spinner-grow-sm');
|
||||
},
|
||||
@@ -91,7 +142,6 @@
|
||||
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||
$('#echoarea-select').empty().append(data);
|
||||
$('#echoareas').checkboxes('range',true);
|
||||
//eval(document.getElementById('echoarea-javascript').innerHTML);
|
||||
},
|
||||
error: function(e) {
|
||||
icon.removeClass('spinner-grow spinner-grow-sm');
|
||||
@@ -103,6 +153,6 @@
|
||||
cache: false
|
||||
})
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@append
|
Reference in New Issue
Block a user