diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-11-30 12:34:57 +0000 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2012-11-30 12:34:57 +0000 |
commit | 4556e36c732cf406177adba1bb55b26ec23140fa (patch) | |
tree | 2067b72daf0d8044479bc49e46bda4e03383676b /views | |
parent | f9433b22ec3fe323c7b76306dc190268b4379bfb (diff) |
Updated web interface to reinstate alert counts, and implement a working search box.
Diffstat (limited to 'views')
-rw-r--r-- | views/_alerts_table_alert_summary.haml | 4 | ||||
-rw-r--r-- | views/_head.haml | 7 | ||||
-rw-r--r-- | views/_navbar.haml | 11 |
3 files changed, 12 insertions, 10 deletions
diff --git a/views/_alerts_table_alert_summary.haml b/views/_alerts_table_alert_summary.haml index 3b03cb0..4159cf7 100644 --- a/views/_alerts_table_alert_summary.haml +++ b/views/_alerts_table_alert_summary.haml @@ -7,10 +7,10 @@ %label{ :for => "alerts[#{alert.id}]" } %strong= alert.subject = alert.summary + - if alert.suppressed? + (suppressed) %a{ :id => ["a","detail", alert.id], | :href => "/alert/#{alert.id}", | :onclick => "fetchDetail('#{alert.id}'); return false;"} - - if alert.suppressed? - (suppressed) Details ↓ %td= (alert.raised_at || alert.cleared_at || Time.now).to_s_relative diff --git a/views/_head.haml b/views/_head.haml index 642d408..5bcd6ae 100644 --- a/views/_head.haml +++ b/views/_head.haml @@ -1,5 +1,10 @@ %head - %title= @title + %title + = @title + - if[:urgent, :normal, :low].all?{|k| @alert_counts.has_key?(k) } + [ + = [:urgent, :normal, :low].collect{|l| @alert_counts[l]}.join(" / ") + ] %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0, maximum-scale=2.0, user-scalable=yes"}/ %link{:rel => "stylesheet", :href => "/stylesheets/bytemark.css"}/ %link{:rel => "stylesheet", :href => "/stylesheets/mauve.css", :media => "all", :type => "text/css"}/ diff --git a/views/_navbar.haml b/views/_navbar.haml index 8b16c55..bd23308 100644 --- a/views/_navbar.haml +++ b/views/_navbar.haml @@ -6,18 +6,15 @@ %li{:class => [ @alert_type == "raised" && "nav_selected"]} %a{:href => '/alerts/raised/'+@group_by} Raised ( - %span#count_raised><= @alerts_raised.length + %span#count_raised><= @alert_counts[:unacknowledged] ) %li{:class => [ @alert_type == "acknowledged" && "nav_selected"]} %a{:href => '/alerts/acknowledged/'+@group_by} Ack'd ( - %span#count_ackd><= @alerts_ackd.length - ) - %li{:class => [ @alert_type == "cleared" && "nav_selected"]} - %a{:href => '/alerts/cleared/'+@group_by} - Cleared ( - %span#count_cleared><= @alerts_cleared.length + %span#count_ackd><= @alert_counts[:acknowledged] ) + %li{:class => [ request.path_info =~ /^\/search/ && "nav_selected"]} + %a{:href => '/search'} Search %li{:class => [ request.path_info =~ /^\/events/ && "nav_selected"]} %a{:href => '/events/calendar'} Events %li |