Skip to content

Commit

Permalink
Update alerts.html
Browse files Browse the repository at this point in the history
  • Loading branch information
sondregronas committed Aug 21, 2023
1 parent 27dd2f9 commit 72a7a0d
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions BookingSystem/templates/templates/alerts.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,14 @@
});

function customAlert(header, msg, type, fullscreen = false) {
let icon;
let color;
const typeMapping = {
success: {icon: 'fa fa-check-circle', color: 'green'},
warning: {icon: 'fa fa-exclamation-circle', color: 'orange'},
error: {icon: 'fa fa-times-circle', color: 'red'},
default: {icon: 'fa fa-info-circle', color: 'blue'}
}
let {icon, color} = typeMapping[type] || typeMapping.default;
if (fullscreen) {
const typeMapping = {
success: {icon: 'fa fa-check-circle', type: 'green',},
warning: {icon: 'fa fa-exclamation-circle', type: 'orange',},
error: {icon: 'fa fa-times-circle', type: 'red',},
default: {icon: 'fa fa-info-circle', type: 'blue',}
}
icon = typeMapping[type].icon || typeMapping.default.icon;
color = typeMapping[type].type || typeMapping.default.type;
$.alert({
title: header,
content: msg,
Expand Down

0 comments on commit 72a7a0d

Please sign in to comment.