2021-02-18 16:31:23 +00:00

56 lines
1.8 KiB
Cheetah

{{define "notifymodal"}}
<div class="modal fade" id="notificationmodal" tabindex="-1" role="dialog" aria-labelledby="notificationmodal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"><b id="notification-title"></b></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="container-fluid">
<div class="row">
<div class="col-md-10 offset-md-1">
<p id="notification-message" style="text-align: center"></p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary btn-fill" onclick="closeNotificationModal()">Dismiss</button>
</div>
</div>
</div>
</div>
<script>
registerHideListener('notificationmodal');
function notify(title, message) {
document.getElementById('notification-title').textContent = title;
document.getElementById('notification-message').textContent = message;
$('#notificationmodal').modal('show');
showBackdrop();
}
function notifyError(message) {
notify('Error', message);
}
function notifySuccess(message) {
notify('Success', message);
}
function notifyRatelimit() {
notifyError("You're doing that too fast: please wait a few seconds and try again");
}
function closeNotificationModal() {
$('#notificationmodal').modal('hide');
}
</script>
{{end}}