summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/trigger_controller.rb4
-rw-r--r--app/views/layouts/_navbar.html.haml4
-rw-r--r--app/views/layouts/application.html.haml1
-rw-r--r--app/views/trigger/voicemail.html.erb4
4 files changed, 9 insertions, 4 deletions
diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb
index 5e836c4..1a5bfca 100644
--- a/app/controllers/trigger_controller.rb
+++ b/app/controllers/trigger_controller.rb
@@ -42,6 +42,10 @@ class TriggerController < ApplicationController
end
end
+ # Indicate a new voicemail in the navigation bar.
+ #
+ PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide.delay(250).show('slow').hide.delay(250).show('slow');")
+
render(
:status => 200,
:layout => false,
diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml
index 8004c0e..fe5f48f 100644
--- a/app/views/layouts/_navbar.html.haml
+++ b/app/views/layouts/_navbar.html.haml
@@ -22,7 +22,11 @@
=t("call_histories.index.page_title")
%li
%a{:href => sip_account_voicemail_messages_path(current_user.sip_accounts.first)}
+ %i.icon-star.icon-white{:id => 'new_voicemail_indicator'}
=t("voicemail_messages.index.page_title")
+ :javascript
+ $("#new_voicemail_indicator").hide()
+ = subscribe_to "/users/#{current_user.id}/messages/new"
- if current_user
%ul.nav.pull-right
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index eab6096..027f837 100644
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -36,4 +36,5 @@
.span12
%hr/
= render 'layouts/footer'
+
/ /container
diff --git a/app/views/trigger/voicemail.html.erb b/app/views/trigger/voicemail.html.erb
deleted file mode 100644
index 9bafe17..0000000
--- a/app/views/trigger/voicemail.html.erb
+++ /dev/null
@@ -1,4 +0,0 @@
-<h1>Trigger#voicemail</h1>
-<p>Find me in app/views/trigger/voicemail.html.erb</p>
-
-<%= debug(params) %>