diff --git a/plugins/environment_notification/lib/ext/application_controller.rb b/plugins/environment_notification/lib/ext/application_controller.rb index 445bf0e..19c7472 100644 --- a/plugins/environment_notification/lib/ext/application_controller.rb +++ b/plugins/environment_notification/lib/ext/application_controller.rb @@ -3,7 +3,7 @@ require_dependency 'application_controller' class ApplicationController def hide_notifications invalid_id = -1 - hide_notifications_ids = [-1] + hide_notifications_ids = [invalid_id] hide_notifications_ids = JSON.parse(cookies[:hide_notifications]) unless cookies[:hide_notifications].blank? hide_notifications_ids end diff --git a/plugins/environment_notification/public/environment_notification_plugin.js b/plugins/environment_notification/public/environment_notification_plugin.js index 24df861..d11b622 100644 --- a/plugins/environment_notification/public/environment_notification_plugin.js +++ b/plugins/environment_notification/public/environment_notification_plugin.js @@ -5,7 +5,7 @@ notificationBar: function() { - var completeMessage = $(".notification-bar").remove(); + var completeMessage = $(".environment-notification-plugin-notification-bar").remove(); $("#content-inner").before(completeMessage); }, @@ -80,18 +80,18 @@ $(document).ready(function(){ environment_notification_plugin.notificationBar(); - $(".notification-close").on("click", environment_notification_plugin.closeNotification); - $(".notification-hide").on("click", environment_notification_plugin.hideNotification); + $(".environment-notification-plugin-notification-bar .notification-close").on("click", environment_notification_plugin.closeNotification); + $(".environment-notification-plugin-notification-bar .notification-hide").on("click", environment_notification_plugin.hideNotification); if($('.environment-notification-plugin-message').length > 0){ environment_notification_plugin.mceRestrict(); } - if($('.notification-bar').length > 0){ + if($('.environment-notification-plugin-notification-bar').length > 0){ environment_notification_plugin.hideUserNotification(); } - if($('[notification-display-popup="true"]').length > 0){ + if($('.environment-notification-plugin-notification-bar [notification-display-popup="true"]').length > 0){ environment_notification_plugin.showPopup(); } }); diff --git a/plugins/environment_notification/style.css b/plugins/environment_notification/style.css index e2f6c37..d8c0bb0 100644 --- a/plugins/environment_notification/style.css +++ b/plugins/environment_notification/style.css @@ -1,27 +1,33 @@ -.notification-bar { +.environment-notification-plugin-notification-bar{ display: block; } -.notification:hover { +.environment-notification-plugin-notification-bar .notification:hover, +.environment-notification-plugin-notification-notification-modal .notification:hover{ opacity: 0.8; } -#notification-manager { +#environment-notification-plugin-notification-manager{ overflow: auto; } -.notification .notification-close { +.environment-notification-plugin-notification-bar .notification .notification-close, +.environment-notification-plugin-notification-notification-modal .notification .notification-close{ background: url(public/images/close.png) no-repeat; background-position: center; width: 20px; height: 20px; } -.warningnotification, -.informationnotification, -.successnotification, -.dangernotification, -.adminnotification { +.environment-notification-plugin-notification-bar .warningnotification, +.environment-notification-plugin-notification-bar .informationnotification, +.environment-notification-plugin-notification-bar .successnotification, +.environment-notification-plugin-notification-bar .dangernotification, +.environment-notification-plugin-notification-bar .adminnotification, +.environment-notification-plugin-notification-notification-modal .warningnotification, +.environment-notification-plugin-notification-notification-modal .informationnotification, +.environment-notification-plugin-notification-notification-modal .successnotification, +.environment-notification-plugin-notification-notification-modal .dangernotification{ margin-bottom: 10px; padding: 7px 10px; border-radius: 5px; @@ -31,87 +37,101 @@ overflow: auto; } -.warningnotification p, -.informationnotification p, -.successnotification p, -.dangernotification p, -.adminnotification p { +.environment-notification-plugin-notification-bar .warningnotification p, +.environment-notification-plugin-notification-bar .informationnotification p, +.environment-notification-plugin-notification-bar .successnotification p, +.environment-notification-plugin-notification-bar .dangernotification p, +.environment-notification-plugin-notification-bar .adminnotification p, +.environment-notification-plugin-notification-notification-modal .warningnotification p, +.environment-notification-plugin-notification-notification-modal .informationnotification p, +.environment-notification-plugin-notification-notification-modal .successnotification p, +.environment-notification-plugin-notification-notification-modal .dangernotification p{ margin: 0px; } -.warningnotification { +.environment-notification-plugin-notification-bar .warningnotification, +.environment-notification-plugin-notification-notification-modal .warningnotification{ background: #fcf8e3; border: 1px solid #faebcc; color: #8a6d3b; } -.warningnotification p a{ +.environment-notification-plugin-notification-bar .warningnotification p a, +.environment-notification-plugin-notification-notification-modal .warningnotification p a{ font-weight: bold; color: #8a6d3b; } -.informationnotification { +.environment-notification-plugin-notification-bar .informationnotification, +.environment-notification-plugin-notification-notification-modal .informationnotification{ background: #d9edf7; border: 1px solid #bce8f1; color: #31708f; } -.informationnotification p a{ +.environment-notification-plugin-notification-bar .informationnotification p a, +.environment-notification-plugin-notification-notification-modal .informationnotification p a{ font-weight: bold; color: #31708f; } -.successnotification { +.environment-notification-plugin-notification-bar .successnotification, +.environment-notification-plugin-notification-notification-modal .successnotification{ background: #dff0d8; border: 1px solid #d6e9c6; color: #3c763d; } -.successnotification p a{ +.environment-notification-plugin-notification-bar .successnotification p a +.environment-notification-plugin-notification-notification-modal .successnotification p a{ font-weight: bold; color: #3c763d; } -.dangernotification { +.environment-notification-plugin-notification-bar .dangernotification, +.environment-notification-plugin-notification-notification-modal .dangernotification{ background: #f2dede; border: 1px solid #ebccd1; color: #a94442; } -.dangernotification p a{ +.environment-notification-plugin-notification-bar .dangernotification p a, +.environment-notification-plugin-notification-notification-modal .dangernotification p a{ font-weight: bold; color: #a94442; } -.adminnotification { +.environment-notification-plugin-notification-bar .adminnotification, +.environment-notification-plugin-notification-notification-modal .adminnotification{ background: #9a959a; border: 1px solid #9a959a; } -.adminnotification p a{ +.environment-notification-plugin-notification-bar .adminnotification p a, +.environment-notification-plugin-notification-notification-modal .adminnotification p a{ font-weight: bold; color: white; } -a.button.icon-deactivate { +#environment-notification-plugin-notification-manager a.button.icon-deactivate{ background: url(public/images/hide.png) no-repeat; background-position: center; } -a.button.icon-activate { +#environment-notification-plugin-notification-manager a.button.icon-activate{ background: url(public/images/show.png) no-repeat; background-position: center; } -.notification-line { +#environment-notification-plugin-notification-manager .notification-line{ display: inline; padding-top: 10px; vertical-align: middle; border-bottom: 1px solid #ccc; } -.notification-title-bar { +#environment-notification-plugin-notification-manager .notification-title-bar{ float: left; width: 100%; font-style: 14px; @@ -120,24 +140,24 @@ a.button.icon-activate { padding: 9px 0; } -.notification-title { +#environment-notification-plugin-notification-manager .notification-title{ width: 80%; float: left; text-align: center; } -.notification-modal .notification-with-title { +.environment-notification-plugin-notification-notification-modal .notification-with-title{ margin-bottom: 0px; } -.notification-modal .notification .notification-title { +.environment-notification-plugin-notification-notification-modal .notification .notification-title{ width: 100%; float: left; font-weight: bold; text-align: left; } -.notification-modal .notification-with-title-message { +.environment-notification-plugin-notification-notification-modal .notification-with-title-message{ width: 100%; float: left; border-radius: 3px; @@ -147,59 +167,60 @@ a.button.icon-activate { overflow: auto; } -.notification-modal .notification-with-title-message p{ +.environment-notification-plugin-notification-notification-modal .notification-with-title-message p{ padding: 0px 7px; } -.notification-modal .notification-with-title-message p a{ +.environment-notification-plugin-notification-notification-modal .notification-with-title-message p a{ color: black; font-weight: bold; } -.action-title { +#environment-notification-plugin-notification-manager .action-title{ width: 20%; float: left; text-align: center; } -.notification-action { +#environment-notification-plugin-notification-manager .notification-action{ width: 18%; float: left; height: 30px; padding-top: 9px; } -.main-bar .button, -.notification-action .button { +#environment-notification-plugin-notification-manager .main-bar .button, +#environment-notification-plugin-notification-manager .notification-action .button{ border-radius: 3px; } -.notification-message { +#environment-notification-plugin-notification-manager .notification-message{ width: 82%; float: left; } -.new-notification { +#environment-notification-plugin-notification-manager .new-notification{ float: right; width: auto; } -.back-button { +#environment-notification-plugin-notification-manager .back-button{ float: left; } -.main-bar { +#environment-notification-plugin-notification-manager .main-bar{ display: inline; width: 100%; } -.notification-bar .notification .notification-message { +.environment-notification-plugin-notification-bar .notification .notification-message, +.environment-notification-plugin-notification-notification-modal .notification .notification-message{ width: 90%; float: left; } -.notification-bar .notification .notification-close { +.environment-notification-plugin-notification-bar .notification .notification-close{ background: url(public/images/redclose.png) no-repeat; background-position: center; width: 20px; @@ -208,7 +229,7 @@ a.button.icon-activate { cursor: pointer; } -.notification-bar .notification .notification-hide { +.environment-notification-plugin-notification-bar .notification .notification-hide{ background: url(public/images/greenhide.png) no-repeat; background-position: center; width: 20px; @@ -217,8 +238,13 @@ a.button.icon-activate { cursor: pointer; } -.notification-modal { +.environment-notification-plugin-notification-notification-modal{ display: block; min-width: 400px; max-width: 700px; +} + +.environment-notification-plugin-form .notification-variables-options{ + font-style: italic; + color: red; } \ No newline at end of file diff --git a/plugins/environment_notification/views/environment_notification_plugin_admin/_form.html.erb b/plugins/environment_notification/views/environment_notification_plugin_admin/_form.html.erb index d8327f5..418f420 100644 --- a/plugins/environment_notification/views/environment_notification_plugin_admin/_form.html.erb +++ b/plugins/environment_notification/views/environment_notification_plugin_admin/_form.html.erb @@ -1,36 +1,38 @@ -<% abstract_options = {:value => @notification.message, :style => 'width: 100%; height: 200px;', :class => "environment-notification-plugin-message" } %> +