From 8cbf5e8f740383c56c1c92de85df3421b0e1a5d0 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Mar 2013 11:37:27 +0100 Subject: Fax indicator test. --- app/controllers/trigger_controller.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index 1a5bfca..2e97711 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -110,6 +110,13 @@ class TriggerController < ApplicationController end if errors.count == 0 + # Indicate a new fax in the navigation bar. + # + if fax_document.fax_accountable.class == User + user = fax_document.fax_accountable + PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide.delay(250).show('slow').hide.delay(250).show('slow');") + end + render( :status => 200, :layout => false, -- cgit v1.2.3 From 685b8dc4987965e1450627e831ea40847bb5b19c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Mar 2013 11:52:01 +0100 Subject: JavaScript fix --- app/controllers/trigger_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index 2e97711..7ab90c2 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -44,7 +44,7 @@ class TriggerController < ApplicationController # 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');") + PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide('fast').show('slow');") render( :status => 200, @@ -114,7 +114,7 @@ class TriggerController < ApplicationController # if fax_document.fax_accountable.class == User user = fax_document.fax_accountable - PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide.delay(250).show('slow').hide.delay(250).show('slow');") + PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide('fast').show('slow');") end render( -- cgit v1.2.3 From aa46f61cc84043a81f760c961ec53786671e7e50 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Mar 2013 12:12:36 +0100 Subject: Moved the voicemail and fax indicator. --- app/controllers/trigger_controller.rb | 4 ++-- app/views/layouts/_navbar.html.haml | 14 +++++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index 7ab90c2..db379f9 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -44,7 +44,7 @@ class TriggerController < ApplicationController # Indicate a new voicemail in the navigation bar. # - PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide('fast').show('slow');") + PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_or_fax_indicator').hide('fast').show('slow');") render( :status => 200, @@ -114,7 +114,7 @@ class TriggerController < ApplicationController # if fax_document.fax_accountable.class == User user = fax_document.fax_accountable - PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_indicator').hide('fast').show('slow');") + PrivatePub.publish_to("/users/#{user.id}/messages/new", "$('#new_voicemail_or_fax_indicator').hide('fast').show('slow');") end render( diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml index fe5f48f..3e1da1c 100644 --- a/app/views/layouts/_navbar.html.haml +++ b/app/views/layouts/_navbar.html.haml @@ -22,12 +22,8 @@ =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 %li.display @@ -43,10 +39,18 @@ - if current_page?(tenant_user_path(current_user.current_tenant, current_user)) %li.active %a.navbar-link{:href => tenant_user_path(current_user.current_tenant, current_user)} + %i.icon-star.icon-white{:id => 'new_voicemail_or_fax_indicator'} + :javascript + $("#new_voicemail_or_fax_indicator").hide() + = subscribe_to "/users/#{current_user.id}/messages/new" = current_user - else %li %a.navbar-link{:href => tenant_user_path(current_user.current_tenant, current_user)} + %i.icon-star.icon-white{:id => 'new_voicemail_or_fax_indicator'} + :javascript + $("#new_voicemail_or_fax_indicator").hide() + = subscribe_to "/users/#{current_user.id}/messages/new" = current_user - if single_sign_on_system? == false -- cgit v1.2.3 From 64afdeacb1444b319abfcad6c9a8cfd656fe2dd4 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 11 Mar 2013 12:19:57 +0100 Subject: Reload FaxDocument#show when a fax was send. --- app/controllers/trigger_controller.rb | 4 ++++ app/views/fax_documents/show.html.haml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/app/controllers/trigger_controller.rb b/app/controllers/trigger_controller.rb index db379f9..0de9223 100644 --- a/app/controllers/trigger_controller.rb +++ b/app/controllers/trigger_controller.rb @@ -110,6 +110,10 @@ class TriggerController < ApplicationController end if errors.count == 0 + # Reload FaxDocument#show + # + PrivatePub.publish_to("/fax_documents/#{fax_document.id}", "location.reload();") + # Indicate a new fax in the navigation bar. # if fax_document.fax_accountable.class == User diff --git a/app/views/fax_documents/show.html.haml b/app/views/fax_documents/show.html.haml index b8f3e9e..f860143 100644 --- a/app/views/fax_documents/show.html.haml +++ b/app/views/fax_documents/show.html.haml @@ -65,3 +65,6 @@ .row .span12 = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @fax_document.fax_account, :child => @fax_document } + +- if @fax_document.state == 'sending' || @fax_document.state == 'queued_for_sending' + = subscribe_to "/fax_documents/#{@fax_document.id}" \ No newline at end of file -- cgit v1.2.3