Handle alert level
This commit is contained in:
parent
cb3b388fb6
commit
bad2a9db9e
2 changed files with 3 additions and 1 deletions
|
@ -109,6 +109,7 @@ TEMPLATE_CONTEXT_PROCESSORS += (
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
MIDDLEWARE_CLASSES += (
|
MIDDLEWARE_CLASSES += (
|
||||||
|
# 'django.middleware.transaction.TransactionMiddleware',
|
||||||
)
|
)
|
||||||
|
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
|
@ -54,7 +54,8 @@
|
||||||
var $div = $('#reveal-container').trigger('reveal:close');
|
var $div = $('#reveal-container').trigger('reveal:close');
|
||||||
});
|
});
|
||||||
L.Chickpea.on('alert', function (e) {
|
L.Chickpea.on('alert', function (e) {
|
||||||
$div = $('<div>').addClass('alert-box success global').html(e.content);
|
var level_class = e.level && e.level == "info"? "success": "alert";
|
||||||
|
$div = $('<div>').addClass('alert-box global').addClass(level_class).html(e.content);
|
||||||
$div.append('<a href="#" class="close">×</a>');
|
$div.append('<a href="#" class="close">×</a>');
|
||||||
$("body").prepend($div);
|
$("body").prepend($div);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue