From 72778a2d789fb60b2b0fa89dbff51b90b0135be6 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Thu, 7 Mar 2013 11:34:42 +0100 Subject: [PATCH] Improved escalation notice. --- .../app/controllers/_application_controller.js.coffee | 4 +++- app/models/sla.rb | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.js.coffee b/app/assets/javascripts/app/controllers/_application_controller.js.coffee index 286b0b862..6d06a229c 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.js.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.js.coffee @@ -114,8 +114,10 @@ class App.Controller extends Spine.Controller if escalation if diff > 0 escalated = '-' - if diff > -60 * 60 + if diff >= 0 style = "class=\"label label-important\"" + else if diff > -60 * 60 + style = "class=\"label label-warning\"" else style = "class=\"label label-success\"" diff --git a/app/models/sla.rb b/app/models/sla.rb index 69575f62f..8e47028b8 100644 --- a/app/models/sla.rb +++ b/app/models/sla.rb @@ -3,8 +3,9 @@ class Sla < ApplicationModel store :data validates :name, :presence => true - after_create :escalation_calculation_rebuild - after_update :escalation_calculation_rebuild + after_create :escalation_calculation_rebuild + after_update :escalation_calculation_rebuild + after_destroy :escalation_calculation_rebuild private def escalation_calculation_rebuild