From 0a27cb9cb162982a356445272d7f910e854d9070 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Sat, 2 Aug 2014 06:45:10 +0000 Subject: [PATCH] Enhanced Theme: Message alert style adjustments. Devices Edit: Check, alert and prevent duplicate MAC address (only on submit). --- app/devices/device_edit.php | 25 +++++++------------------ themes/enhanced/template.php | 19 +++++++++++++------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/app/devices/device_edit.php b/app/devices/device_edit.php index 2b99a5bf31..47a3a6f418 100644 --- a/app/devices/device_edit.php +++ b/app/devices/device_edit.php @@ -248,7 +248,6 @@ require_once "resources/require.php"; if ($action == "add") { //save the message to a session variable $_SESSION['message'] = $text['message-add']; - $_SESSION['message_mood'] = 'positive'; //redirect the browser header("Location: device_edit.php?id=$device_uuid"); exit; @@ -256,7 +255,6 @@ require_once "resources/require.php"; if ($action == "update") { //save the message to a session variable $_SESSION['message'] = $text['message-update']; - $_SESSION['message_mood'] = 'positive'; } } } @@ -383,33 +381,24 @@ require_once "resources/require.php"; obj[0].parentNode.removeChild(obj[2]); } - function check_mac_duplicate(mac_addr, device_uuid_to_ignore) { if (mac_addr != '') { - var response; check_url = "device_edit.php?mac="+mac_addr+"&id="+device_uuid_to_ignore; $("#duplicate_mac_response").load(check_url, function() { - var duplicate_mac_response = $("#duplicate_mac_response").html(); - if (duplicate_mac_response != '') { + if ($("#duplicate_mac_response").html() != '') { $('#device_mac_address').addClass('formfld_highlight_bad'); - display_message(duplicate_mac_response, 'negative'); - $('#duplicate_mac_found').val(true); + display_message($("#duplicate_mac_response").html(), 'negative'); } else { $('#device_mac_address').removeClass('formfld_highlight_bad'); - $('#duplicate_mac_found').val(false); + $('#frm').submit(); } }); - return ($('#duplicate_mac_found').val() == "true") ? false : true; } else { - return true; + $('#frm').submit(); } } - - - - \n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; - echo " \n"; + echo " \n"; echo "
\n"; echo $text['description-device_mac_address']."\n"; echo "\n"; @@ -1092,7 +1081,7 @@ require_once "resources/require.php"; if ($action == "update") { echo " \n"; } - echo " \n"; + echo " \n"; echo " \n"; echo " "; echo ""; diff --git a/themes/enhanced/template.php b/themes/enhanced/template.php index 2bd59b8fae..e437ee9fbf 100644 --- a/themes/enhanced/template.php +++ b/themes/enhanced/template.php @@ -788,13 +788,11 @@ legend { padding: 8px 0; text-align: center; font-family: arial, san-serif; - font-weight: bold; font-size: 10pt; - color: #000; } .message_container_mood_default { - background-color: #ccc; + background-color: #ccffcc; } .message_container_mood_negative { @@ -802,11 +800,19 @@ legend { } .message_container_mood_alert { - background-color: #feff9d; + background-color: #ffe585; } - .message_container_mood_positive { - background-color: #ccffcc; + .message_text_mood_default { + color: #004200; + } + + .message_text_mood_negative { + color: #670000; + } + + .message_text_mood_alert { + color: #d66721; } #domains_show_icon { @@ -993,6 +999,7 @@ legend { helper_div.remove(); // add class by mood $("#message_container").addClass('message_container_mood_'+mood); + $("#message_text").addClass('message_text_mood_'+mood); // output message $("#message_text").html(msg); $("#message_container").css({height: $("#message_text").css("height")});