Handle alert level

This commit is contained in:
Yohan Boniface 2012-12-06 18:09:45 +01:00
parent cb3b388fb6
commit bad2a9db9e
2 changed files with 3 additions and 1 deletions

View file

@ -109,6 +109,7 @@ TEMPLATE_CONTEXT_PROCESSORS += (
#============================================================================== #==============================================================================
MIDDLEWARE_CLASSES += ( MIDDLEWARE_CLASSES += (
# 'django.middleware.transaction.TransactionMiddleware',
) )
#============================================================================== #==============================================================================

View file

@ -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">&times;</a>'); $div.append('<a href="#" class="close">&times;</a>');
$("body").prepend($div); $("body").prepend($div);
}); });