2021-10-20 15:58:14 +00:00
|
|
|
{{define "components/error"}}
|
|
|
|
<div class="notification is-danger {{if not .Error}}is-hidden{{end}}" id="error_view">
|
2021-11-11 02:05:55 +00:00
|
|
|
<button class="delete" onclick="ErrorClose()"></button>
|
2021-10-20 15:58:14 +00:00
|
|
|
<p id="err_msg">{{.Error}}</p>
|
|
|
|
</div>
|
|
|
|
<script>
|
|
|
|
function ErrorTog(){
|
|
|
|
let el = document.getElementById('error_view');
|
|
|
|
el.classList.toggle('is-hidden');
|
|
|
|
}
|
2021-11-11 02:05:55 +00:00
|
|
|
function ErrorOpen(){
|
|
|
|
let el = document.getElementById('error_view');
|
|
|
|
el.classList.remove('is-hidden');
|
|
|
|
}
|
|
|
|
function ErrorClose(){
|
|
|
|
let el = document.getElementById('error_view');
|
|
|
|
el.classList.add('is-hidden');
|
|
|
|
}
|
2021-10-20 15:58:14 +00:00
|
|
|
function ShowError(msg){
|
|
|
|
let el = document.getElementById('err_msg');
|
|
|
|
el.innerHTML = msg;
|
2021-11-11 02:05:55 +00:00
|
|
|
ErrorOpen();
|
2021-10-20 15:58:14 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
{{end}}
|