From: Ciro Scognamiglio Date: Tue, 6 May 2014 15:52:27 +0000 (+0200) Subject: mysliceMessage() js function can be used to display a message X-Git-Tag: myslice-1.1~117 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=6049329c319ed167723f805f732977fc1c462b39;p=unfold.git mysliceMessage() js function can be used to display a message --- diff --git a/portal/static/js/myslice-ui.js b/portal/static/js/myslice-ui.js index 5b8e7f6a..e2e8ad94 100644 --- a/portal/static/js/myslice-ui.js +++ b/portal/static/js/myslice-ui.js @@ -1,14 +1,18 @@ -function mysliceAlert(msg) { - $('#myslice-message').find('.message').text(msg); - $('#myslice-message').fadeIn('fast'); +/* + * Call it with level: success, info, warning, danger + */ +function mysliceAlert(msg, level = 'warning') { + var el = $('#myslice-message') + el.find('.message').text(msg); + el.addClass('alert-' + level); + el.fadeIn('fast'); } /* Table initialisation */ $(document).ready(function() { var platformParameters = {}; - diff --git a/portal/templates/_widget-message.html b/portal/templates/_widget-message.html index 278bca4a..5985f9a2 100644 --- a/portal/templates/_widget-message.html +++ b/portal/templates/_widget-message.html @@ -1,4 +1,4 @@ -