From 6049329c319ed167723f805f732977fc1c462b39 Mon Sep 17 00:00:00 2001 From: Ciro Scognamiglio Date: Tue, 6 May 2014 17:52:27 +0200 Subject: [PATCH] mysliceMessage() js function can be used to display a message --- portal/static/js/myslice-ui.js | 12 ++++++++---- portal/templates/_widget-message.html | 2 +- portal/templates/home-view.html | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) 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 @@ -