diff options
-rw-r--r-- | app/controllers/sip_accounts_controller.rb | 5 | ||||
-rw-r--r-- | app/views/sip_accounts/show.html.haml | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index b34172d..0d7cbfe 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -10,7 +10,10 @@ class SipAccountsController < ApplicationController end def show - @register_tel_protocol = "#{request.protocol}#{request.host_with_port}/sip_accounts/#{@sip_account.try(:id)}/calls/new?url=%s" + @register_protocols = { + :tel => "#{request.protocol}#{request.host_with_port}/sip_accounts/#{@sip_account.try(:id)}/calls/new?url=%s", + :callto => "#{request.protocol}#{request.host_with_port}/sip_accounts/#{@sip_account.try(:id)}/calls/new?url=%s", + } end def new diff --git a/app/views/sip_accounts/show.html.haml b/app/views/sip_accounts/show.html.haml index 9f84c92..e79907f 100644 --- a/app/views/sip_accounts/show.html.haml +++ b/app/views/sip_accounts/show.html.haml @@ -60,12 +60,14 @@ = render :partial => 'shared/show_edit_destroy_part', :locals => { :parent => @sip_account.sip_accountable, :child => @sip_account } -%p - %strong= t('sip_accounts.show.tel_protocol') + ':' -%p - %a.btn.btn-small.btn-default{ :href => '', :onclick => "navigator.registerProtocolHandler(\"tel\", \"#{@register_tel_protocol}\", \"#{@sip_account.to_s}\");" } - %i.icon-plus - = t('sip_accounts.show.register_tel_protocol') +- if @register_protocols.count > 0 + %p + %strong= t('sip_accounts.show.call_protocols') + ':' + %p + - @register_protocols.each do |protocol, url| + %a.btn.btn-small.btn-default{ :href => '', :onclick => "navigator.registerProtocolHandler(\"#{protocol}\", \"#{url}\", \"#{@sip_account.to_s}\");" } + %i.icon-plus + = t("sip_accounts.show.register_#{protocol}_protocol") %p %strong= t('ringtones.name') + ':' |