From f5a512fe34fff50bcc7e96b57120d56a79ea47cb Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 30 Dec 2012 22:25:52 +0100 Subject: Set a couple of :autofocus => true to make the UI better. --- app/views/call_forwards/_form_core.html.haml | 2 +- app/views/phone_numbers/_form_core.html.haml | 6 +++--- app/views/sip_accounts/_form_core.html.haml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/views/call_forwards/_form_core.html.haml b/app/views/call_forwards/_form_core.html.haml index 3dadb68..f75181f 100644 --- a/app/views/call_forwards/_form_core.html.haml +++ b/app/views/call_forwards/_form_core.html.haml @@ -1,5 +1,5 @@ .inputs - = f.input :call_forward_case_id, :as => :select, :collection => @available_call_forward_cases.map {|x| [I18n.t("call_forward_cases.#{x.value}"), x.id] }, :label => t('call_forwards.form.call_forward_case_id.label'), :hint => conditional_hint('call_forwards.form.call_forward_case_id.hint'), :include_blank => false + = f.input :call_forward_case_id, :as => :select, :collection => @available_call_forward_cases.map {|x| [I18n.t("call_forward_cases.#{x.value}"), x.id] }, :label => t('call_forwards.form.call_forward_case_id.label'), :hint => conditional_hint('call_forwards.form.call_forward_case_id.hint'), :include_blank => false, :autofocus => true = f.input :timeout, :label => t('call_forwards.form.timeout.label'), :hint => conditional_hint('call_forwards.form.timeout.hint') = f.input :call_forwarding_destination , :as => :select, :collection => @call_forwarding_destinations, :label => t('call_forwards.form.call_forwarding_destination.label'), :hint => conditional_hint('call_forwards.form.call_forwarding_destination.hint'), :include_blank => false diff --git a/app/views/phone_numbers/_form_core.html.haml b/app/views/phone_numbers/_form_core.html.haml index add3039..a1ce1f3 100644 --- a/app/views/phone_numbers/_form_core.html.haml +++ b/app/views/phone_numbers/_form_core.html.haml @@ -2,9 +2,9 @@ - if @phone_book_entry = f.input :name, :collection => ['Office', 'Home', 'Mobile', 'Fax'], :include_blank => false, :label => t('phone_numbers.form.name.label'), :hint => conditional_hint('phone_numbers.form.name.hint') - = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint') + = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :autofocus => true - else - if @callthrough || @hunt_group_member || @access_authorization || @current_user.current_tenant.array_of_available_internal_extensions_and_dids.count == 0 || @current_user.current_tenant.array_of_available_internal_extensions_and_dids.count > 250 - = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint') + = f.input :number, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :autofocus => true - else - = f.input :number, :collection => @current_user.current_tenant.array_of_available_internal_extensions_and_dids, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :include_blank => false + = f.input :number, :collection => @current_user.current_tenant.array_of_available_internal_extensions_and_dids, :label => t('phone_numbers.form.number.label'), :hint => conditional_hint('phone_numbers.form.number.hint'), :include_blank => false, :autofocus => true diff --git a/app/views/sip_accounts/_form_core.html.haml b/app/views/sip_accounts/_form_core.html.haml index dbd27fe..6a63da6 100644 --- a/app/views/sip_accounts/_form_core.html.haml +++ b/app/views/sip_accounts/_form_core.html.haml @@ -1,7 +1,7 @@ .inputs = f.input :auth_name, :as => :string, :label => t('sip_accounts.form.auth_name.label'), :hint => conditional_hint('sip_accounts.form.auth_name.hint') = f.input :password, :as => :string, :label => t('sip_accounts.form.password.label'), :hint => conditional_hint('sip_accounts.form.password.hint') - = f.input :caller_name, :as => :string, :label => t('sip_accounts.form.caller_name.label'), :hint => conditional_hint('sip_accounts.form.caller_name.hint') + = f.input :caller_name, :as => :string, :label => t('sip_accounts.form.caller_name.label'), :hint => conditional_hint('sip_accounts.form.caller_name.hint'), :autofocus => true = f.input :voicemail_pin, :as => :string, :label => t('sip_accounts.form.voicemail_pin.label'), :hint => conditional_hint('sip_accounts.form.voicemail_pin.hint') = f.input :call_waiting, :label => t('sip_accounts.form.call_waiting.label'), :hint => conditional_hint('sip_accounts.form.call_waiting.hint') = f.input :clir, :label => t('sip_accounts.form.clir.label'), :hint => conditional_hint('sip_accounts.form.clir.hint') -- cgit v1.2.3 From 12c8f4c82770ded6ea6b519e4451ed6757419ddf Mon Sep 17 00:00:00 2001 From: Sascha Daniels Date: Mon, 31 Dec 2012 02:09:05 +0100 Subject: Remove unused ontroller --- app/controllers/config_siemens_sort_controller.rb | 371 ---------------------- 1 file changed, 371 deletions(-) delete mode 100644 app/controllers/config_siemens_sort_controller.rb (limited to 'app') diff --git a/app/controllers/config_siemens_sort_controller.rb b/app/controllers/config_siemens_sort_controller.rb deleted file mode 100644 index c0739e5..0000000 --- a/app/controllers/config_siemens_sort_controller.rb +++ /dev/null @@ -1,371 +0,0 @@ -require 'nokogiri' -#doc.search('Message/ItemList').each do |a| puts a.children end -class ConfigSiemensController < ApplicationController -#TODO Authentication - # No access for admins though as this contains personal data. - - # We can't use load_and_authorize_resource() here because - # ConfigSiemensController isn't a resource. - # We can try client certificates - - skip_authorization_check - - - def index - os40_keys=7 - os60_keys=8 - os80_keys=9 - doc = Nokogiri::XML(request.body.read) - #logger.debug("#{params[:WorkpointMessage].to_xml}") - #logger.debug("#{params[:WorkpointMessage][:Message][:ItemList].to_xml}") - @phone_items=Hash.new - contact_reason = params[:WorkpointMessage][:Message][:ReasonForContact] - reply_status = doc.search('Message/ReasonForContact').first[:status] - reply_action = doc.search('Message/ReasonForContact').first[:action] - - doc.search('Message/ItemList/Item').each do |post_item| - @phone_items[post_item[:name]]=post_item.children.to_s - end - - mac_address = @phone_items['mac-addr'] - phone_type = @phone_items['device-type'] - if phone_type == "OpenStage 40" - max_keys = (os40_keys) * 2 - elsif phone_type == "OpenStage 60" - max_keys = (os60_keys) * 2 - elsif phone_type == "OpenStage 80" - max_keys = (os80_keys) * 2 - else - max_keys = 0 - end - - blf_keys_max = max_keys / 2 - shift_key_position = blf_keys_max - 1 - - #logger.debug(request.body.read) - @phone = Phone.find_by_mac_address(mac_address.gsub(':','').upcase) - if ! @phone.nil? - @phone.update_attributes(:ip_address => request.remote_ip) - sip_account = SipAccount.where(:sip_accountable_type == @phone.phoneable_type, - :sip_accountable_id == @phone.phoneable_id).first - end - - if ! @phone.nil? && ! sip_account.nil? - #logger.debug(@phone_items) - @my_nonce = params[:WorkpointMessage][:Message][:nonce] - @new_settings = Array.new - - @new_settings << ['dhcp', nil, 'true'] - @new_settings << ['hostname', nil, mac_address.gsub(':', '') ] - @new_settings << ['e164-hostname', nil, 'false'] - @new_settings << ['mobility-enabled', nil, 'false'] - @new_settings << ['mobility-password-on-logoff', nil, 'false'] - @new_settings << ['e164', nil, sip_account.try(:phone_numbers).first.number] - @new_settings << ['sip-user-id', nil, sip_account.auth_name] - @new_settings << ['reg-id', nil, sip_account.auth_name] - @new_settings << ['reg-number', nil, sip_account.auth_name] - @new_settings << ['fully-qualified-phone-no', nil, sip_account.auth_name] - @new_settings << ['sip-pwd', nil, sip_account.password] - @new_settings << ['sip-name', nil, sip_account.caller_name] - @new_settings << ['register-by-name', nil, 'false'] - #OPTIMIZE Display ID ? - @new_settings << ['display-id', nil, sip_account.try(:phone_numbers).first.number] - @new_settings << ['display-id-unicode', nil, sip_account.caller_name] - @new_settings << ['use-display-id', nil, 'true'] - @new_settings << ['reg-addr', nil, sip_account.sip_domain.host] - @new_settings << ['reg-port', nil, '5060'] - @new_settings << ['registrar-addr', nil, sip_account.sip_domain.host] - @new_settings << ['registrar-port', nil, '5060'] - @new_settings << ['outbound-proxy', nil, sip_account.sip_domain.host] - @new_settings << ['outbound-proxy-user', nil, sip_account.sip_domain.host] - @new_settings << ['sgnl-gateway-addr', nil, sip_account.sip_domain.host] - @new_settings << ['sgnl-gateway-addr-user', nil, sip_account.sip_domain.host] - @new_settings << ['sgnl-gateway-port', nil, '5060' ] - @new_settings << ['sgnl-gateway-port-user', nil, '5060'] - @new_settings << ['sgnl-route', nil, '0' ] - @new_settings << ['mwi-e164', nil, '' ] - @new_settings << ['rtp-base-port', nil, '5004'] - @new_settings << ['default-domain', nil, '' ] - @new_settings << ['sip-transport', nil, '0' ] - @new_settings << ['sip-transport-user', nil, '0' ] - @new_settings << ['server-type', nil, '0' ] - @new_settings << ['session-timer', nil, 'true'] - @new_settings << ['session-duration', nil, '3600' ] - @new_settings << ['reg-ttl', nil, '3600' ] - @new_settings << ['realm', nil, sip_account.sip_domain.realm] - @new_settings << ['emergency-e164', nil, '0110' ] - @new_settings << ['voice-mail-e164', nil, 'voicemail'] - @new_settings << ['auto-answer', nil, 'false'] - @new_settings << ['beep-on-auto-answer', nil, 'true'] - @new_settings << ['auto-reconnect', nil, 'false' ] - @new_settings << ['beep-on-auto-reconnect', nil, 'true'] - @new_settings << ['permit-decline-call', nil, 'true'] - @new_settings << ['transfer-on-ring', nil, 'false' ] - @new_settings << ['join-allowed-in-conference', nil, 'true'] - @new_settings << ['pickup-group-uri', nil, '*8*'] - @new_settings << ['pickup-group-uri', nil, '' ] - @new_settings << ['hot-line-warm-line-digits', nil, '' ] - @new_settings << ['initial-digit-timer', nil, '30' ] - @new_settings << ['conference-factory-uri', nil, ''] - @new_settings << ['callback-busy-allow', nil, 'false'] - @new_settings << ['callback-busy-code', nil, '' ] - @new_settings << ['callback-ring-allow', nil, 'false'] - @new_settings << ['callback-ring-code', nil, ''] - @new_settings << ['callback-cancel-code', nil, ''] - @new_settings << ['park-server', nil, ''] - #OPTIMIZE Callwaiting - @new_settings << ['call-waiting-enabled', nil, 'true'] - @new_settings << ['qos-layer2', nil, 'true'] - @new_settings << ['l2qos-voice', nil, '5' ] - @new_settings << ['l2qos-signalling', nil, '3' ] - @new_settings << ['l2qos-default', nil, '0'] - @new_settings << ['qos-layer3', nil, 'true'] - @new_settings << ['l3qos-voice', nil, '46'] - @new_settings << ['l3qos-signalling', nil, '26'] - @new_settings << ['vlan-method', nil, '1'] - #OPTIMIZE Timezone - @new_settings << ['sntp-tz-offset', nil, ''] - @new_settings << ['daylight-save', nil, ''] - @new_settings << ['daylight-save-minutes', nil, ''] - #OPTIMIZE Use SNMP? - @new_settings << ['snmp-trap-addr', nil, ''] - @new_settings << ['snmp-trap-port', nil, ''] - @new_settings << ['snmp-trap-pwd', nil, 'snmp' ] - @new_settings << ['snmp-traps-active', nil, 'false' ] - @new_settings << ['diagnostic-trap-addr', nil, ''] - @new_settings << ['diagnostic-trap-port', nil, ''] - @new_settings << ['diagnostic-trap-pwd', nil, 'snmp' ] - @new_settings << ['diagnostic-traps-active', nil, 'false' ] - @new_settings << ['diagnostic-snmp-active', nil, 'false'] - @new_settings << ['qdc-collection-unit-addr', nil, ''] - @new_settings << ['qdc-collection-unit-port', nil, '12010'] - - @new_settings << ['qdc-trap-pwd', nil, 'QOSDC'] - @new_settings << ['qdc-snmp-active', nil, 'false'] - @new_settings << ['qdc-qcu-active', nil, 'false'] - @new_settings << ['snmp-queries-allowed', nil, 'false'] - @new_settings << ['snmp-pwd', nil, ''] - @new_settings << ['disable-microphone', nil, 'false'] - @new_settings << ['loudspeech-enabled', nil, 'true'] - @new_settings << ['audio-silence-suppression', nil, 'false'] - - @new_settings << ['port1', nil, '0' ] # 0=Automatic (speed) - @new_settings << ['port2', nil, '0' ] - @new_settings << ['port2-mode', nil, '1' ] - @new_settings << ['port2-auto-mdix-enabled', nil, 'true' ] - @new_settings << ['originating-line-preference', nil, '0'] - @new_settings << ['terminating-line-preference', nil, '0'] - @new_settings << ['line-key-operating-mode', nil, '0'] - @new_settings << ['line-rollover-type', nil, '2'] - @new_settings << ['line-rollover-volume', nil, '5' ]# 1-5 - @new_settings << ['line-registration-leds', nil, 'true'] - @new_settings << ['keyset-use-focus', nil, 'true' ] - @new_settings << ['keyset-remote-forward-ind', nil, 'true'] - @new_settings << ['keyset-reservation-timer', nil, '60' ] # 0-300 - @new_settings << ['dial-plan-enabled', nil, '' ] - @new_settings << ['Canonical-dialing-international-prefix', nil, ''] - @new_settings << ['Canonical-dialing-local-country-code', nil, ''] - @new_settings << ['Canonical-dialing-national-prefix', nil, ''] - @new_settings << ['Canonical-dialing-local-area-code', nil, ''] - @new_settings << ['Canonical-dialing-local-node', nil, ''] - @new_settings << ['Canonical-dialing-external-access', nil, '0'] - @new_settings << ['Canonical-dialing-operator-code', nil, ''] - @new_settings << ['Canonical-dialing-emergency-number', nil, ''] - @new_settings << ['Canonical-dialing-dial-needs-access-code', nil, '0'] - @new_settings << ['Canonical-dialing-dial-needs-intGWcode', nil, '0'] - @new_settings << ['Canonical-dialing-min-local-number-length', nil, '10'] - @new_settings << ['Canonical-dialing-extension-initial-digits', nil, ''] - @new_settings << ['Canonical-dialing-dial-internal-form', nil, '0' ] - @new_settings << ['Canonical-dialing-dial-external-form', nil, '0' ] - @new_settings << ['Canonical-lookup-local-code', nil, '' ] - @new_settings << ['Canonical-lookup-international-code', nil, ''] - @new_settings << ['hot-keypad-dialing', nil, ''] - @new_settings << ['ldap-transport', nil, '0'] - @new_settings << ['ldap-server-address', nil, '' ] - @new_settings << ['ldap-server-port', nil, '389' ] - @new_settings << ['ldap-authentication', nil, '1'] - @new_settings << ['ldap-user', nil, '' ] - @new_settings << ['ldap-pwd', nil, '' ] - @new_settings << ['ldap-max-responses', nil, '25'] - @new_settings << ['backup-addr', nil, ''] - @new_settings << ['backup-registration', nil, 'false'] - @new_settings << ['qdc-qcu-active', nil, 'false' ] - @new_settings << ['min-admin-passw-length', nil, '6' ] - @new_settings << ['default-locked-config-menus', nil, 'true' ] - @new_settings << ['locked-config-menus', nil, 'true' ] - @new_settings << ['default-locked-local-function-menus', nil, 'true' ] - @new_settings << ['locked-local-function-menus', nil, 'true' ] - @new_settings << ['dls-mode-secure', nil, '0' ] - @new_settings << ['dls-chunk-size', nil, '9492'] - @new_settings << ['default-passw-policy', nil, 'false'] - @new_settings << ['deflect-destination', nil, ''] - @new_settings << ['display-skin', nil, ''] - @new_settings << ['enable-bluetooth-interface', nil, 'true'] - @new_settings << ['usb-access-enabled', nil, 'false' ] - @new_settings << ['usb-backup-enabled', nil, 'false' ] - @new_settings << ['line-button-mode', nil, '0' ] - @new_settings << ['lock-forwarding', nil, '' ] - @new_settings << ['loudspeaker-function-mode', nil, '0' ] - @new_settings << ['max-pin-retries', nil, '' ] - @new_settings << ['inactivity-timeout', nil, '30' ] - @new_settings << ['not-used-timeout', nil, '2' ] - @new_settings << ['passw-char-set', nil, '0' ] - @new_settings << ['refuse-call', nil, 'true' ] - @new_settings << ['restart-password', nil, ''] - #OPTIMIZE clock format - @new_settings << ['time-format', nil, '0' ]# 1=12 h - @new_settings << ['uaCSTA-enabled', nil, 'false' ] - @new_settings << ['enable-test-interface', nil, 'false'] - @new_settings << ['enable-WBM', nil, 'true'] - @new_settings << ['pixelsaver-timeout', nil, '2' ]# 2 hours? - @new_settings << ['voice-message-dial-tone', nil, '' ] - @new_settings << ['call-pickup-allowed', nil, 'true' ] - @new_settings << ['group-pickup-tone-allowed', nil, 'true'] - @new_settings << ['group-pickup-as-ringer', nil, 'false'] - @new_settings << ['group-pickup-alert-type', nil, '0' ] - @new_settings << ['default-profile', nil, '' ] - @new_settings << ['count-medium-priority', nil, '5'] - @new_settings << ['timer-medium-priority', nil, '60'] # 1 - 999 - @new_settings << ['timer-high-priority', nil, '5'] # 0 - 999 - @new_settings << ['dss-sip-detect-timer', nil, '10'] - @new_settings << ['dss-sip-deflect', nil, 'false' ] - @new_settings << ['dss-sip-refuse', nil, 'false' ] - @new_settings << ['feature-availability', nil, 'false'] - @new_settings << ['feature-availability', nil, 'true' ] - @new_settings << ['feature-availability', nil, 'true' ] - @new_settings << ['local-control-feature-availability', nil, 'false' ] - @new_settings << ['trace-level', nil, '0' ] # Off - @new_settings << ['default-locked-function-keys', nil, 'true' ]# "unknown item" - #OPTIMIZE Put pickup prefix into database/global constant? - @new_settings << ['blf-code', nil, 'f_ia_'] # pickup prefix for softkey function 59 (BLF) - @new_settings << ['stimulus-feature-code', nil, true] - @new_settings << ['stimulus-led-control-uri', nil, true] - - - @new_settings << ['min-user-passw-length', nil, '6' ]# 6 - 24 - #OPTIMIZE language - @new_settings << ['country-iso', nil, 'DE' ] - @new_settings << ['language-iso', nil, 'de'] - @new_settings << ['date-format', nil, '0' ] # DD.MM.YYYY - #OPTIMIZE ringtones - @new_settings << ['ringer-melody', nil, '1'] - - @new_settings << ['ringer-melody', nil, '2'] - @new_settings << ['ringer-tone-sequence', nil, '2'] - - soft_keys = Array.new - # Getting BLF keys only for the first level - blf_keys = sip_account.softkeys.find( - :all, - :conditions => {:function => ['blf', 'conference']}, - :limit => blf_keys_max) - #Getting other keys - non_blf_keys = sip_account.softkeys.find( - :all, - :conditions => {:function => ['speed_dial']}) - - # Fill softkey array with BLF keys up to shift key - blf_keys.each do |k| - soft_keys << k - end - # Fill sofkey with other keys up to end - non_blf_keys.each do |k| - if soft_keys.length < max_keys - soft_keys << k - end - end - # Delete unset softkeys - while soft_keys.length < max_keys - soft_keys << Softkey.new - end - - key_pos=1 - - #soft_keys.each do |sk| - - while key_pos < shift_key_position - - (1..shift_key_position-1).each do |key_idx| - sk = soft_keys.shift - logger.debug(sk.function, key_idx) - if sk.function == "blf" - @new_settings << ['function-key-def', key_idx, '59'] - @new_settings << ['select-dial', key_idx, sk.number ] - elsif sk.function == "log_out" - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, 'f_lo' ] - elsif sk.function == "log_in" - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, "f_li_#{sk.number}" ] - elsif sk.function == "dtmf" - @new_settings << ['function-key-def', key_idx, '54'] - @new_settings << ['stimulus-DTMF-sequence', key_idx, sk.number ] - elsif sk.function.nil? - @new_settings << ['function-key-def', key_idx, '0'] - else - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, sk.number ] - end - @new_settings << ['key-label', key_idx, sk.label ] - @new_settings << ['key-label-unicode', key_idx, sk.label ] - key_pos = key_pos+1 - - end - end - if key_pos == shift_key_position - @new_settings << ['function-key-def', shift_key_position, '18'] - @new_settings << ['key-label', shift_key_position, 'Shift'] - @new_settings << ['key-label-unicode', shift_key_position, 'Shift'] - key_pos = key_pos+1 - end - - (1001..1000+shift_key_position-1).each do |key_idx| - sk = soft_keys.shift - if sk.function == "log_out" - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, 'f_lo' ] - elsif sk.function == "log_in" - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, "f_li_#{sk.number}" ] - elsif sk.function == "dtmf" - @new_settings << ['function-key-def', key_idx, '54'] - @new_settings << ['stimulus-DTMF-sequence', key_idx, sk.number ] - elsif sk.function.nil? - @new_settings << ['function-key-def', key_idx, '0'] - else - @new_settings << ['function-key-def', key_idx, '1'] - @new_settings << ['select-dial', key_idx, sk.number ] - end - @new_settings << ['key-label', key_idx, sk.label ] - @new_settings << ['key-label-unicode', key_idx, sk.label ] - key_pos = key_pos+1 - - end - - #end - logger.debug(@new_settings) - end - - if @phone.nil? || sip_account.nil? - respond_to { |format| - format.xml { render :action => "clean-up" } - } - - elsif (reply_status == 'accepted' && contact_reason == 'reply-to' && reply_action == 'ReadAllItems') - respond_to { |format| - format.xml { render :action => "write" } - } - - elsif ["reply-to"].include? contact_reason - respond_to { |format| - format.xml { render :action => "clean-up" } - } - - else - respond_to { |format| - format.xml { render :action => "index" } - } - end - - end -end -- cgit v1.2.3 From c24bd3a8212e85894b2f7c26e190fe5e89fbaaf2 Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 31 Dec 2012 08:47:23 +0100 Subject: hide hotdeskable check box for tenant sip accounts --- app/views/sip_accounts/_form_core.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/sip_accounts/_form_core.html.haml b/app/views/sip_accounts/_form_core.html.haml index dbd27fe..bb70edb 100644 --- a/app/views/sip_accounts/_form_core.html.haml +++ b/app/views/sip_accounts/_form_core.html.haml @@ -6,7 +6,8 @@ = f.input :call_waiting, :label => t('sip_accounts.form.call_waiting.label'), :hint => conditional_hint('sip_accounts.form.call_waiting.hint') = f.input :clir, :label => t('sip_accounts.form.clir.label'), :hint => conditional_hint('sip_accounts.form.clir.hint') = f.input :clip, :label => t('sip_accounts.form.clip.label'), :hint => conditional_hint('sip_accounts.form.clip.hint') - = f.input :hotdeskable, :label => t('sip_accounts.form.hotdeskable.label'), :hint => conditional_hint('sip_accounts.form.hotdeskable.hint') + - if @sip_account.sip_accountable_type == 'User' + = f.input :hotdeskable, :label => t('sip_accounts.form.hotdeskable.label'), :hint => conditional_hint('sip_accounts.form.hotdeskable.hint') = f.input :clip_no_screening, :label => t('sip_accounts.form.clip_no_screening.label'), :hint => conditional_hint('sip_accounts.form.clip_no_screening.hint') - if CallForward.where(:phone_number_id => @sip_account.phone_number_ids).count == 0 || @sip_account.callforward_rules_act_per_sip_account == true = f.input :callforward_rules_act_per_sip_account, :label => t('sip_accounts.form.callforward_rules_act_per_sip_account.label'), :hint => conditional_hint('sip_accounts.form.callforward_rules_act_per_sip_account.hint') -- cgit v1.2.3 From a3bf87ed7d6d693c28d081c2e7e8d8e55373cae4 Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 31 Dec 2012 09:31:43 +0100 Subject: show hot deskable option for user sip accounts only --- app/controllers/sip_accounts_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/sip_accounts_controller.rb b/app/controllers/sip_accounts_controller.rb index 1f3166e..8292a74 100644 --- a/app/controllers/sip_accounts_controller.rb +++ b/app/controllers/sip_accounts_controller.rb @@ -20,7 +20,9 @@ class SipAccountsController < ApplicationController @sip_account.clip = DEFAULT_CLIP_SETTING @sip_account.voicemail_pin = random_pin @sip_account.callforward_rules_act_per_sip_account = CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT - @sip_account.hotdeskable = true + if @parent.class == User + @sip_account.hotdeskable = true + end # Make sure that we don't use an already taken auth_name # -- cgit v1.2.3 From e29f14a7742e7fd049a7a09a6d1fa046c2741d67 Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 31 Dec 2012 09:32:41 +0100 Subject: fixed fallback_sip_accounts query --- app/controllers/phones_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/phones_controller.rb b/app/controllers/phones_controller.rb index 2698465..14735e6 100644 --- a/app/controllers/phones_controller.rb +++ b/app/controllers/phones_controller.rb @@ -78,11 +78,11 @@ class PhonesController < ApplicationController end def set_fallback_sip_accounts - used_sip_account_ids = Phone.where(:fallback_sip_account_id => SipAccount.pluck(:id)).pluck(:fallback_sip_account_id) - @fallback_sip_accounts = SipAccount.where(:sip_accountable_type => 'Tenant').where(:hotdeskable => true) - SipAccount.where(:id => used_sip_account_ids) - if @phone && !@phone.fallback_sip_account_id.blank? && SipAccount.exists?(@phone.fallback_sip_account_id) - @fallback_sip_accounts << SipAccount.where(:id => @phone.fallback_sip_account_id).first + used_sip_account_ids = Phone.pluck(:fallback_sip_account_id) + PhoneSipAccount.pluck(:sip_account_id) + if @phone + used_sip_account_ids = used_sip_account_ids - [ @phone.fallback_sip_account_id ] end + @fallback_sip_accounts = SipAccount.where(:sip_accountable_type => 'Tenant') - SipAccount.where(:id => used_sip_account_ids) end end -- cgit v1.2.3 From a65c4ec370b60a4739e0b87ba398e5e25e3b1340 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 4 Jan 2013 09:12:58 +0100 Subject: return true if login was successful but phone resync failed --- app/models/phone.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/models/phone.rb b/app/models/phone.rb index a606834..a59b003 100644 --- a/app/models/phone.rb +++ b/app/models/phone.rb @@ -162,7 +162,6 @@ class Phone < ActiveRecord::Base if ! self.resync(true, sip_account_resync) errors.add(:resync, "Resync failed") - return false end return true -- cgit v1.2.3 From 5867df0eff12622c826cf0d699d3c2ec4aff5a7d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 4 Jan 2013 10:01:48 +0100 Subject: Set :autofocus => true for the first_name. --- app/views/phone_book_entries/_form_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/phone_book_entries/_form_core.html.haml b/app/views/phone_book_entries/_form_core.html.haml index c05139e..5159668 100644 --- a/app/views/phone_book_entries/_form_core.html.haml +++ b/app/views/phone_book_entries/_form_core.html.haml @@ -1,6 +1,6 @@ .inputs = f.input :is_male, :collection => [[true, t('phone_book_entries.form.gender.male')], [false, t('phone_book_entries.form.gender.female')]], :label_method => :last, :value_method => :first, :label => t('phone_book_entries.form.male.label'), :hint => conditional_hint('phone_book_entries.form.gender.hint'), :label => t('phone_book_entries.form.gender.label'), :as => :radio - = f.input :first_name, :label => t('phone_book_entries.form.first_name.label'), :hint => conditional_hint('phone_book_entries.form.first_name.hint') + = f.input :first_name, :label => t('phone_book_entries.form.first_name.label'), :hint => conditional_hint('phone_book_entries.form.first_name.hint'), :autofocus => true = f.input :middle_name, :label => t('phone_book_entries.form.middle_name.label'), :hint => conditional_hint('phone_book_entries.form.middle_name.hint') = f.input :last_name, :label => t('phone_book_entries.form.last_name.label'), :hint => conditional_hint('phone_book_entries.form.last_name.hint') = f.input :birth_name, :label => t('phone_book_entries.form.birth_name.label'), :hint => conditional_hint('phone_book_entries.form.birth_name.hint') -- cgit v1.2.3 From 7171f3ecfb8af4f9fcc30bcd168159d05ec4ae7f Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 4 Jan 2013 10:23:47 +0100 Subject: snom idle icon settings --- app/controllers/config_snom_controller.rb | 5 +++++ app/views/config_snom/show.xml.haml | 29 +++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'app') diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index 7542415..9a06a99 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -503,6 +503,11 @@ class ConfigSnomController < ApplicationController :idle_down => "keyevent F_NEXT_ID", :idle_left => "url #{xml_applications_url}/call_history.xml?type=received", :idle_right => "url #{xml_applications_url}/call_history.xml?type=missed", + :touch_idle_adr_book => "url #{xml_applications_url}/phone_book.xml", + :touch_idle_list_missed => "url #{xml_applications_url}/call_history.xml?type=missed", + :touch_idle_list_taken => "url #{xml_applications_url}/call_history.xml?type=received", + :touch_idle_redial => "url #{xml_applications_url}/call_history.xml?type=dialed", + :touch_idle_dialog => "url #{xml_applications_url}/call_history.xml", } # Remap conference key to first conference if found diff --git a/app/views/config_snom/show.xml.haml b/app/views/config_snom/show.xml.haml index d9953c5..a11715d 100644 --- a/app/views/config_snom/show.xml.haml +++ b/app/views/config_snom/show.xml.haml @@ -68,6 +68,11 @@ %dkey_conf{:perm => 'RW'}= @dkeys[:conf] %dkey_redial{:perm => 'RW'}= @dkeys[:redial] %dkey_directory{:perm => 'RW'}= @dkeys[:directory] + %dkey_touch_idle_adr_book{:perm => 'RW'}= @dkeys[:touch_idle_adr_book] + %dkey_touch_idle_list_missed{:perm => 'RW'}= @dkeys[:touch_idle_list_missed] + %dkey_touch_idle_list_taken{:perm => 'RW'}= @dkeys[:touch_idle_list_taken] + %dkey_touch_idle_redial{:perm => 'RW'}= @dkeys[:touch_idle_redial] + %dkey_touch_idle_dialog{:perm => 'RW'}= @dkeys[:touch_idle_dialog] %idle_ok_key_action{:perm => 'RW'}= @dkeys[:idle_ok] %idle_cancel_key_action{:perm => 'RW'}= @dkeys[:idle_cancel] @@ -76,6 +81,29 @@ %idle_left_key_action{:perm => 'RW'}= @dkeys[:idle_left] %idle_right_key_action{:perm => 'RW'}= @dkeys[:idle_right] + / Display + %backlight{:perm => 'RW'}= '15' + %backlight_idle{:perm => 'RW'}= '0' + %dim_timer{:perm => 'RW'}= '300' + + - if @phone.phone_model.name == 'Snom 870' + / Snom 870 idle icons + %idle_icon_01{:perm => 'RW'}= '9' + %idle_icon_02{:perm => 'RW'}= '20' + %idle_icon_03{:perm => 'RW'}= '4' + %idle_icon_04{:perm => 'RW'}= '-1' + %idle_icon_05{:perm => 'RW'}= '6' + %idle_icon_06{:perm => 'RW'}= '-1' + %idle_icon_07{:perm => 'RW'}= '-1' + %idle_icon_08{:perm => 'RW'}= '-1' + %idle_icon_09{:perm => 'RW'}= '-1' + %idle_icon_10{:perm => 'RW'}= '-1' + %idle_icon_11{:perm => 'RW'}= '15' + %idle_icon_12{:perm => 'RW'}= '-1' + %idle_icon_13{:perm => 'RW'}= '-1' + %idle_icon_14{:perm => 'RW'}= '13' + %idle_icon_15{:perm => 'RW'}= '12' + != "\ -%html.no-js{ :lang => "en" } - ~#OPTIMIZE Make html lang attribute reflect the actual language. +%html.no-js{ :lang => I18n.locale.to_s } %header %meta{ :charset => "utf-8" }/ @@ -19,7 +18,8 @@ %body #container - = render :partial => "shared/header" + - cache(['application_header', I18n.locale, current_user]) do + = render :partial => "shared/header" = render :partial => "shared/flash", :locals => { :flash => flash} #content{:role => 'main'} @@ -30,18 +30,19 @@ %h1= yield(:title) = yield - %footer#main - %ul - %li - %a{:href => "http://amooma.de/gemeinschaft/gs5"} Gemeinschaft #{GsParameter.get('GEMEINSCHAFT_VERSION')} - - if GuiFunction.display?('amooma_commercial_support_link_in_footer', current_user) + - cache(['application_footer', I18n.locale]) do + %footer#main + %ul %li - %a{:href => "http://amooma.de"} Kommerzieller Support und Consulting - - if GuiFunction.display?('gemeinschaft_mailinglist_link_in_footer', current_user) - %li - %a{:href => "https://groups.google.com/group/gs5-users/"} Kostenlose Mailingliste + %a{:href => "http://amooma.de/gemeinschaft/gs5"} Gemeinschaft #{GsParameter.get('GEMEINSCHAFT_VERSION')} + - if GuiFunction.display?('amooma_commercial_support_link_in_footer', current_user) + %li + %a{:href => "http://amooma.de"} Kommerzieller Support und Consulting + - if GuiFunction.display?('gemeinschaft_mailinglist_link_in_footer', current_user) + %li + %a{:href => "https://groups.google.com/group/gs5-users/"} Kostenlose Mailingliste - .amooma-logo - %span brought to you by - %a{ :target => '_blank', :href => "http://amooma.de/" } Amooma + .amooma-logo + %span brought to you by + %a{ :target => '_blank', :href => "http://amooma.de/" } Amooma -- cgit v1.2.3 From 113e3c6c6117fbeca7b9bf1f0e6dc26b0db9c407 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 16 Jan 2013 08:33:45 -0500 Subject: call_routes added --- app/controllers/call_routes_controller.rb | 41 +++++++++++++++++++++++++++++ app/helpers/call_routes_helper.rb | 2 ++ app/models/call_route.rb | 3 +++ app/views/call_routes/_form.html.haml | 7 +++++ app/views/call_routes/_form_core.html.haml | 6 +++++ app/views/call_routes/_index_core.html.haml | 17 ++++++++++++ app/views/call_routes/edit.html.haml | 3 +++ app/views/call_routes/index.html.haml | 6 +++++ app/views/call_routes/new.html.haml | 3 +++ app/views/call_routes/show.html.haml | 19 +++++++++++++ 10 files changed, 107 insertions(+) create mode 100644 app/controllers/call_routes_controller.rb create mode 100644 app/helpers/call_routes_helper.rb create mode 100644 app/models/call_route.rb create mode 100644 app/views/call_routes/_form.html.haml create mode 100644 app/views/call_routes/_form_core.html.haml create mode 100644 app/views/call_routes/_index_core.html.haml create mode 100644 app/views/call_routes/edit.html.haml create mode 100644 app/views/call_routes/index.html.haml create mode 100644 app/views/call_routes/new.html.haml create mode 100644 app/views/call_routes/show.html.haml (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb new file mode 100644 index 0000000..631339b --- /dev/null +++ b/app/controllers/call_routes_controller.rb @@ -0,0 +1,41 @@ +class CallRoutesController < ApplicationController + def index + @call_routes = CallRoute.all + end + + def show + @call_route = CallRoute.find(params[:id]) + end + + def new + @call_route = CallRoute.new + end + + def create + @call_route = CallRoute.new(params[:call_route]) + if @call_route.save + redirect_to @call_route, :notice => t('call_routes.controller.successfuly_created') + else + render :new + end + end + + def edit + @call_route = CallRoute.find(params[:id]) + end + + def update + @call_route = CallRoute.find(params[:id]) + if @call_route.update_attributes(params[:call_route]) + redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated') + else + render :edit + end + end + + def destroy + @call_route = CallRoute.find(params[:id]) + @call_route.destroy + redirect_to call_routes_url, :notice => t('call_routes.controller.successfuly_destroyed') + end +end diff --git a/app/helpers/call_routes_helper.rb b/app/helpers/call_routes_helper.rb new file mode 100644 index 0000000..dfe87dd --- /dev/null +++ b/app/helpers/call_routes_helper.rb @@ -0,0 +1,2 @@ +module CallRoutesHelper +end diff --git a/app/models/call_route.rb b/app/models/call_route.rb new file mode 100644 index 0000000..4cf2445 --- /dev/null +++ b/app/models/call_route.rb @@ -0,0 +1,3 @@ +class CallRoute < ActiveRecord::Base + attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position +end diff --git a/app/views/call_routes/_form.html.haml b/app/views/call_routes/_form.html.haml new file mode 100644 index 0000000..1415852 --- /dev/null +++ b/app/views/call_routes/_form.html.haml @@ -0,0 +1,7 @@ += simple_form_for(@call_route) do |f| + = f.error_notification + + = render "form_core", :f => f + + .actions + = f.button :submit, conditional_t('call_routes.form.submit') \ No newline at end of file diff --git a/app/views/call_routes/_form_core.html.haml b/app/views/call_routes/_form_core.html.haml new file mode 100644 index 0000000..4b97434 --- /dev/null +++ b/app/views/call_routes/_form_core.html.haml @@ -0,0 +1,6 @@ +.inputs + = f.input :table, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint') + = f.input :name, :label => t('call_routes.form.name.label'), :hint => conditional_hint('call_routes.form.name.hint') + = f.input :endpoint_type, :label => t('call_routes.form.endpoint_type.label'), :hint => conditional_hint('call_routes.form.endpoint_type.hint') + = f.input :endpoint_id, :label => t('call_routes.form.endpoint_id.label'), :hint => conditional_hint('call_routes.form.endpoint_id.hint') + = f.input :position, :label => t('call_routes.form.position.label'), :hint => conditional_hint('call_routes.form.position.hint') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml new file mode 100644 index 0000000..6ea3af7 --- /dev/null +++ b/app/views/call_routes/_index_core.html.haml @@ -0,0 +1,17 @@ +%table + %tr + %th= t('call_routes.index.table') + %th= t('call_routes.index.name') + %th= t('call_routes.index.endpoint_type') + %th= t('call_routes.index.endpoint_id') + %th= t('call_routes.index.position') + + - reset_cycle + - for call_route in call_routes + %tr{:class => cycle('odd', 'even')} + %td= call_route.table + %td= call_route.name + %td= call_route.endpoint_type + %td= call_route.endpoint_id + %td= call_route.position + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file diff --git a/app/views/call_routes/edit.html.haml b/app/views/call_routes/edit.html.haml new file mode 100644 index 0000000..0ad46c5 --- /dev/null +++ b/app/views/call_routes/edit.html.haml @@ -0,0 +1,3 @@ +- title t("call_routes.edit.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/call_routes/index.html.haml b/app/views/call_routes/index.html.haml new file mode 100644 index 0000000..687a9dc --- /dev/null +++ b/app/views/call_routes/index.html.haml @@ -0,0 +1,6 @@ +- title t("call_routes.index.page_title") + +- if @call_routes && @call_routes.count > 0 + = render "index_core", :call_routes => @call_routes + += render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} \ No newline at end of file diff --git a/app/views/call_routes/new.html.haml b/app/views/call_routes/new.html.haml new file mode 100644 index 0000000..0796d7f --- /dev/null +++ b/app/views/call_routes/new.html.haml @@ -0,0 +1,3 @@ +- title t("call_routes.new.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml new file mode 100644 index 0000000..31c3cb0 --- /dev/null +++ b/app/views/call_routes/show.html.haml @@ -0,0 +1,19 @@ +- title t("call_routes.show.page_title") + +%p + %strong= t('call_routes.show.table') + ":" + = @call_route.table +%p + %strong= t('call_routes.show.name') + ":" + = @call_route.name +%p + %strong= t('call_routes.show.endpoint_type') + ":" + = @call_route.endpoint_type +%p + %strong= t('call_routes.show.endpoint_id') + ":" + = @call_route.endpoint_id +%p + %strong= t('call_routes.show.position') + ":" + = @call_route.position + += render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } \ No newline at end of file -- cgit v1.2.3 From 8c83a89c6fbfdb31cae8ea6fcf2fd50c12c076a5 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 16 Jan 2013 08:37:56 -0500 Subject: route_elements added --- app/controllers/route_elements_controller.rb | 41 ++++++++++++++++++++++++++ app/helpers/route_elements_helper.rb | 2 ++ app/models/route_element.rb | 5 ++++ app/views/route_elements/_form.html.haml | 7 +++++ app/views/route_elements/_form_core.html.haml | 9 ++++++ app/views/route_elements/_index_core.html.haml | 23 +++++++++++++++ app/views/route_elements/edit.html.haml | 3 ++ app/views/route_elements/index.html.haml | 6 ++++ app/views/route_elements/new.html.haml | 3 ++ app/views/route_elements/show.html.haml | 28 ++++++++++++++++++ 10 files changed, 127 insertions(+) create mode 100644 app/controllers/route_elements_controller.rb create mode 100644 app/helpers/route_elements_helper.rb create mode 100644 app/models/route_element.rb create mode 100644 app/views/route_elements/_form.html.haml create mode 100644 app/views/route_elements/_form_core.html.haml create mode 100644 app/views/route_elements/_index_core.html.haml create mode 100644 app/views/route_elements/edit.html.haml create mode 100644 app/views/route_elements/index.html.haml create mode 100644 app/views/route_elements/new.html.haml create mode 100644 app/views/route_elements/show.html.haml (limited to 'app') diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb new file mode 100644 index 0000000..595a20d --- /dev/null +++ b/app/controllers/route_elements_controller.rb @@ -0,0 +1,41 @@ +class RouteElementsController < ApplicationController + def index + @route_elements = RouteElement.all + end + + def show + @route_element = RouteElement.find(params[:id]) + end + + def new + @route_element = RouteElement.new + end + + def create + @route_element = RouteElement.new(params[:route_element]) + if @route_element.save + redirect_to @route_element, :notice => t('route_elements.controller.successfuly_created') + else + render :new + end + end + + def edit + @route_element = RouteElement.find(params[:id]) + end + + def update + @route_element = RouteElement.find(params[:id]) + if @route_element.update_attributes(params[:route_element]) + redirect_to @route_element, :notice => t('route_elements.controller.successfuly_updated') + else + render :edit + end + end + + def destroy + @route_element = RouteElement.find(params[:id]) + @route_element.destroy + redirect_to route_elements_url, :notice => t('route_elements.controller.successfuly_destroyed') + end +end diff --git a/app/helpers/route_elements_helper.rb b/app/helpers/route_elements_helper.rb new file mode 100644 index 0000000..4262a50 --- /dev/null +++ b/app/helpers/route_elements_helper.rb @@ -0,0 +1,2 @@ +module RouteElementsHelper +end diff --git a/app/models/route_element.rb b/app/models/route_element.rb new file mode 100644 index 0000000..e845f24 --- /dev/null +++ b/app/models/route_element.rb @@ -0,0 +1,5 @@ +class RouteElement < ActiveRecord::Base + attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position + + belongs_to :call_route +end diff --git a/app/views/route_elements/_form.html.haml b/app/views/route_elements/_form.html.haml new file mode 100644 index 0000000..cfa4c6b --- /dev/null +++ b/app/views/route_elements/_form.html.haml @@ -0,0 +1,7 @@ += simple_form_for(@route_element) do |f| + = f.error_notification + + = render "form_core", :f => f + + .actions + = f.button :submit, conditional_t('route_elements.form.submit') \ No newline at end of file diff --git a/app/views/route_elements/_form_core.html.haml b/app/views/route_elements/_form_core.html.haml new file mode 100644 index 0000000..7697cb0 --- /dev/null +++ b/app/views/route_elements/_form_core.html.haml @@ -0,0 +1,9 @@ +.inputs + = f.input :call_route_id, :label => t('route_elements.form.call_route_id.label'), :hint => conditional_hint('route_elements.form.call_route_id.hint') + = f.input :var_in, :label => t('route_elements.form.var_in.label'), :hint => conditional_hint('route_elements.form.var_in.hint') + = f.input :var_out, :label => t('route_elements.form.var_out.label'), :hint => conditional_hint('route_elements.form.var_out.hint') + = f.input :pattern, :label => t('route_elements.form.pattern.label'), :hint => conditional_hint('route_elements.form.pattern.hint') + = f.input :replacement, :label => t('route_elements.form.replacement.label'), :hint => conditional_hint('route_elements.form.replacement.hint') + = f.input :action, :label => t('route_elements.form.action.label'), :hint => conditional_hint('route_elements.form.action.hint') + = f.input :mandatory, :label => t('route_elements.form.mandatory.label'), :hint => conditional_hint('route_elements.form.mandatory.hint') + = f.input :position, :label => t('route_elements.form.position.label'), :hint => conditional_hint('route_elements.form.position.hint') diff --git a/app/views/route_elements/_index_core.html.haml b/app/views/route_elements/_index_core.html.haml new file mode 100644 index 0000000..63665fd --- /dev/null +++ b/app/views/route_elements/_index_core.html.haml @@ -0,0 +1,23 @@ +%table + %tr + %th= t('route_elements.index.call_route_id') + %th= t('route_elements.index.var_in') + %th= t('route_elements.index.var_out') + %th= t('route_elements.index.pattern') + %th= t('route_elements.index.replacement') + %th= t('route_elements.index.action') + %th= t('route_elements.index.mandatory') + %th= t('route_elements.index.position') + + - reset_cycle + - for route_element in route_elements + %tr{:class => cycle('odd', 'even')} + %td= route_element.call_route_id + %td= route_element.var_in + %td= route_element.var_out + %td= route_element.pattern + %td= route_element.replacement + %td= route_element.action + %td= route_element.mandatory + %td= route_element.position + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => route_element} \ No newline at end of file diff --git a/app/views/route_elements/edit.html.haml b/app/views/route_elements/edit.html.haml new file mode 100644 index 0000000..770eb6c --- /dev/null +++ b/app/views/route_elements/edit.html.haml @@ -0,0 +1,3 @@ +- title t("route_elements.edit.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/route_elements/index.html.haml b/app/views/route_elements/index.html.haml new file mode 100644 index 0000000..b05236b --- /dev/null +++ b/app/views/route_elements/index.html.haml @@ -0,0 +1,6 @@ +- title t("route_elements.index.page_title") + +- if @route_elements && @route_elements.count > 0 + = render "index_core", :route_elements => @route_elements + += render :partial => 'shared/create_link', :locals => {:child_class => RouteElement} \ No newline at end of file diff --git a/app/views/route_elements/new.html.haml b/app/views/route_elements/new.html.haml new file mode 100644 index 0000000..903e808 --- /dev/null +++ b/app/views/route_elements/new.html.haml @@ -0,0 +1,3 @@ +- title t("route_elements.new.page_title") + += render "form" \ No newline at end of file diff --git a/app/views/route_elements/show.html.haml b/app/views/route_elements/show.html.haml new file mode 100644 index 0000000..a439353 --- /dev/null +++ b/app/views/route_elements/show.html.haml @@ -0,0 +1,28 @@ +- title t("route_elements.show.page_title") + +%p + %strong= t('route_elements.show.call_route_id') + ":" + = @route_element.call_route_id +%p + %strong= t('route_elements.show.var_in') + ":" + = @route_element.var_in +%p + %strong= t('route_elements.show.var_out') + ":" + = @route_element.var_out +%p + %strong= t('route_elements.show.pattern') + ":" + = @route_element.pattern +%p + %strong= t('route_elements.show.replacement') + ":" + = @route_element.replacement +%p + %strong= t('route_elements.show.action') + ":" + = @route_element.action +%p + %strong= t('route_elements.show.mandatory') + ":" + = @route_element.mandatory +%p + %strong= t('route_elements.show.position') + ":" + = @route_element.position + += render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @route_element } \ No newline at end of file -- cgit v1.2.3 From 0bf4d1350f5d2a07db874977674e5ae0ff0d4256 Mon Sep 17 00:00:00 2001 From: Peter Kozak Date: Wed, 16 Jan 2013 08:38:54 -0500 Subject: route_elements belong to route --- app/models/call_route.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 4cf2445..eba247c 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -1,3 +1,5 @@ class CallRoute < ActiveRecord::Base attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position + + has_many :route_elements, :dependent => :destroy end -- cgit v1.2.3 From 0ee17f52f8ad337c1240b4c55dbd8f6c6c74dc90 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 16:32:59 +0100 Subject: Fixed routes and breadcrumbs. #106 --- app/controllers/call_routes_controller.rb | 19 +++++++++----- app/controllers/route_elements_controller.rb | 36 +++++++++++++++++++------- app/models/call_route.rb | 7 +++++ app/models/route_element.rb | 5 ++++ app/views/route_elements/_form.html.haml | 2 +- app/views/route_elements/_form_core.html.haml | 1 - app/views/route_elements/_index_core.html.haml | 4 +-- app/views/route_elements/index.html.haml | 2 +- app/views/route_elements/show.html.haml | 5 +--- 9 files changed, 55 insertions(+), 26 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 631339b..41abe6d 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,14 +1,15 @@ class CallRoutesController < ApplicationController + load_and_authorize_resource :call_route + + before_filter :spread_breadcrumbs + def index - @call_routes = CallRoute.all end def show - @call_route = CallRoute.find(params[:id]) end def new - @call_route = CallRoute.new end def create @@ -21,11 +22,9 @@ class CallRoutesController < ApplicationController end def edit - @call_route = CallRoute.find(params[:id]) end def update - @call_route = CallRoute.find(params[:id]) if @call_route.update_attributes(params[:call_route]) redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated') else @@ -34,8 +33,16 @@ class CallRoutesController < ApplicationController end def destroy - @call_route = CallRoute.find(params[:id]) @call_route.destroy redirect_to call_routes_url, :notice => t('call_routes.controller.successfuly_destroyed') end + + private + def spread_breadcrumbs + add_breadcrumb t("call_routes.index.page_title"), call_routes_path + if @call_route && !@call_route.new_record? + add_breadcrumb @call_route, call_route_path(@call_route) + end + end + end diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb index 595a20d..699fcc6 100644 --- a/app/controllers/route_elements_controller.rb +++ b/app/controllers/route_elements_controller.rb @@ -1,41 +1,57 @@ class RouteElementsController < ApplicationController + load_and_authorize_resource :call_route + load_and_authorize_resource :route_element, :through => [:call_route] + + before_filter :spread_breadcrumbs + def index - @route_elements = RouteElement.all + @route_elements = @call_route.route_elements end def show - @route_element = RouteElement.find(params[:id]) + @route_element = @call_route.route_elements.find(params[:id]) end def new - @route_element = RouteElement.new + @route_element = @call_route.route_elements.build end def create - @route_element = RouteElement.new(params[:route_element]) + @route_element = @call_route.route_elements.build(params[:route_element]) if @route_element.save - redirect_to @route_element, :notice => t('route_elements.controller.successfuly_created') + redirect_to [@call_route, @route_element], :notice => t('route_elements.controller.successfuly_created') else render :new end end def edit - @route_element = RouteElement.find(params[:id]) + @route_element = @call_route.route_elements.find(params[:id]) end def update - @route_element = RouteElement.find(params[:id]) + @route_element = @call_route.route_elements.find(params[:id]) if @route_element.update_attributes(params[:route_element]) - redirect_to @route_element, :notice => t('route_elements.controller.successfuly_updated') + redirect_to [@call_route, @route_element], :notice => t('route_elements.controller.successfuly_updated') else render :edit end end def destroy - @route_element = RouteElement.find(params[:id]) + @route_element = @call_route.route_elements.find(params[:id]) @route_element.destroy - redirect_to route_elements_url, :notice => t('route_elements.controller.successfuly_destroyed') + redirect_to call_route_route_elements_path(@call_route), :notice => t('route_elements.controller.successfuly_destroyed') end + + private + def spread_breadcrumbs + add_breadcrumb t("call_routes.index.page_title"), call_routes_path + add_breadcrumb @call_route, call_route_path(@call_route) + add_breadcrumb t("route_elements.index.page_title"), call_route_route_elements_path(@call_route) + if @route_element && !@route_element.new_record? + add_breadcrumb @route_element, call_route_route_element_path(@call_route, @route_element) + end + end + end diff --git a/app/models/call_route.rb b/app/models/call_route.rb index eba247c..de0f68a 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -2,4 +2,11 @@ class CallRoute < ActiveRecord::Base attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position has_many :route_elements, :dependent => :destroy + + validates :name, + :presence => true + + def to_s + name.to_s + end end diff --git a/app/models/route_element.rb b/app/models/route_element.rb index e845f24..11bb54a 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -2,4 +2,9 @@ class RouteElement < ActiveRecord::Base attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position belongs_to :call_route + + def to_s + "#{var_in} #{var_out}" + end + end diff --git a/app/views/route_elements/_form.html.haml b/app/views/route_elements/_form.html.haml index cfa4c6b..8feacaa 100644 --- a/app/views/route_elements/_form.html.haml +++ b/app/views/route_elements/_form.html.haml @@ -1,4 +1,4 @@ -= simple_form_for(@route_element) do |f| += simple_form_for([@call_route, @route_element]) do |f| = f.error_notification = render "form_core", :f => f diff --git a/app/views/route_elements/_form_core.html.haml b/app/views/route_elements/_form_core.html.haml index 7697cb0..133d1df 100644 --- a/app/views/route_elements/_form_core.html.haml +++ b/app/views/route_elements/_form_core.html.haml @@ -1,5 +1,4 @@ .inputs - = f.input :call_route_id, :label => t('route_elements.form.call_route_id.label'), :hint => conditional_hint('route_elements.form.call_route_id.hint') = f.input :var_in, :label => t('route_elements.form.var_in.label'), :hint => conditional_hint('route_elements.form.var_in.hint') = f.input :var_out, :label => t('route_elements.form.var_out.label'), :hint => conditional_hint('route_elements.form.var_out.hint') = f.input :pattern, :label => t('route_elements.form.pattern.label'), :hint => conditional_hint('route_elements.form.pattern.hint') diff --git a/app/views/route_elements/_index_core.html.haml b/app/views/route_elements/_index_core.html.haml index 63665fd..c1df665 100644 --- a/app/views/route_elements/_index_core.html.haml +++ b/app/views/route_elements/_index_core.html.haml @@ -1,6 +1,5 @@ %table %tr - %th= t('route_elements.index.call_route_id') %th= t('route_elements.index.var_in') %th= t('route_elements.index.var_out') %th= t('route_elements.index.pattern') @@ -12,7 +11,6 @@ - reset_cycle - for route_element in route_elements %tr{:class => cycle('odd', 'even')} - %td= route_element.call_route_id %td= route_element.var_in %td= route_element.var_out %td= route_element.pattern @@ -20,4 +18,4 @@ %td= route_element.action %td= route_element.mandatory %td= route_element.position - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => route_element} \ No newline at end of file + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @call_route, :child => route_element} \ No newline at end of file diff --git a/app/views/route_elements/index.html.haml b/app/views/route_elements/index.html.haml index b05236b..8a6f7bc 100644 --- a/app/views/route_elements/index.html.haml +++ b/app/views/route_elements/index.html.haml @@ -3,4 +3,4 @@ - if @route_elements && @route_elements.count > 0 = render "index_core", :route_elements => @route_elements -= render :partial => 'shared/create_link', :locals => {:child_class => RouteElement} \ No newline at end of file += render :partial => 'shared/create_link', :locals => {:parent => @call_route, :child_class => RouteElement} \ No newline at end of file diff --git a/app/views/route_elements/show.html.haml b/app/views/route_elements/show.html.haml index a439353..8e41f80 100644 --- a/app/views/route_elements/show.html.haml +++ b/app/views/route_elements/show.html.haml @@ -1,8 +1,5 @@ - title t("route_elements.show.page_title") -%p - %strong= t('route_elements.show.call_route_id') + ":" - = @route_element.call_route_id %p %strong= t('route_elements.show.var_in') + ":" = @route_element.var_in @@ -25,4 +22,4 @@ %strong= t('route_elements.show.position') + ":" = @route_element.position -= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @route_element } \ No newline at end of file += render :partial => 'shared/show_edit_destroy_part', :locals => {:parent => @call_route, :child => @route_element } \ No newline at end of file -- cgit v1.2.3 From 0d5fd7ba5092b4d00826f3572448bb54ac2ec983 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 17:14:12 +0100 Subject: Limit call_histories to 1000 and add caching. --- app/controllers/call_histories_controller.rb | 2 + app/views/call_histories/_index_core.html.haml | 119 +++++++++++++------------ 2 files changed, 63 insertions(+), 58 deletions(-) (limited to 'app') diff --git a/app/controllers/call_histories_controller.rb b/app/controllers/call_histories_controller.rb index f711f34..5335ed3 100644 --- a/app/controllers/call_histories_controller.rb +++ b/app/controllers/call_histories_controller.rb @@ -34,6 +34,8 @@ class CallHistoriesController < ApplicationController if ! @type.blank? @call_histories = @call_histories.where(:entry_type => @type) end + + @call_histories = @call_histories.order(:created_at).reverse_order.limit(1000) end diff --git a/app/views/call_histories/_index_core.html.haml b/app/views/call_histories/_index_core.html.haml index 2d7658a..4ed4fc4 100644 --- a/app/views/call_histories/_index_core.html.haml +++ b/app/views/call_histories/_index_core.html.haml @@ -1,64 +1,67 @@ = form_tag(destroy_multiple_sip_account_call_histories_path(@sip_account), :method => :delete, :id => 'call_history_form') do %header.entries-nav= render :partial => "call_histories/navigation" .content - %table - - reset_cycle - - for call_history in call_histories - - phone_number = call_history.display_number - - voicemail_message = call_history.voicemail_message - - if phone_number - - phone_book_entry = call_history.phone_book_entry_by_number(phone_number) - %tr.call-history-entry{:class => cycle('odd', 'even')} - %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :id => "select_item_#{call_history.id}", :class => 'select_item') - %td.thumbnail - - image = call_history.display_image(:small, phone_book_entry) - - if image - = image_tag(image, :itemprop => 'image') - %td.time - - if voicemail_message - .voicemail-message - %a{:href => sip_account_voicemail_messages_path(@sip_account, :anchor => "message_#{voicemail_message.id}")} - = image_tag('icons/gs_envelope_16x.png', :class => 'display') - = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - elsif call_history.entry_type == 'forwarded' - .call-forwarded= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - if call_history.callee_account_type.to_s.downcase == 'voicemail' - = t("call_histories.index.voicemail") - - else - = call_history.destination_number - - elsif call_history.entry_type == 'dialed' - .call-placed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - elsif call_history.entry_type == 'received' - .call-received= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - elsif call_history.entry_type == 'missed' - .call-missed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - else - .call-unknown - = t("call_histories.index.#{call_history.entry_type}") - = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) - - if call_history.forwarding_service && call_history.entry_type != 'forwarded' - = t("call_histories.index.forwarded_by") - = call_history.display_auth_account_name - %td.user - - display_name = call_history.display_name - - if display_name.blank? - - display_name = phone_book_entry.to_s - - if phone_book_entry - %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name - - else - .name= display_name - .phone= phone_number - %td.status - - if call_history.display_duration - .duration= call_history.display_duration - - else - .disposition= t("call_histories.call_results.#{call_history.result}") - %td.actions - - if @sip_account.registration && can?(:call, call_history) - = link_to t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put - %td.actions - - if can? :destroy, call_history - = link_to t('call_histories.index.actions.destroy'), sip_account_call_history_path(@sip_account, call_history), :method => :delete + - cache(['call_history_table', I18n.locale, @sip_account, call_histories.first, call_histories.last, call_histories.count]) do + %table + - reset_cycle + - for call_history in call_histories + - tr_background_colour = cycle('odd', 'even') + - cache(['call_history_table_row', I18n.locale, call_history, tr_background_colour]) do + - phone_number = call_history.display_number + - voicemail_message = call_history.voicemail_message + - if phone_number + - phone_book_entry = call_history.phone_book_entry_by_number(phone_number) + %tr.call-history-entry{:class => tr_background_colour} + %td.select_box= check_box_tag("selected_ids[]", call_history.id, false, :id => "select_item_#{call_history.id}", :class => 'select_item') + %td.thumbnail + - image = call_history.display_image(:small, phone_book_entry) + - if image + = image_tag(image, :itemprop => 'image') + %td.time + - if voicemail_message + .voicemail-message + %a{:href => sip_account_voicemail_messages_path(@sip_account, :anchor => "message_#{voicemail_message.id}")} + = image_tag('icons/gs_envelope_16x.png', :class => 'display') + = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - elsif call_history.entry_type == 'forwarded' + .call-forwarded= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - if call_history.callee_account_type.to_s.downcase == 'voicemail' + = t("call_histories.index.voicemail") + - else + = call_history.destination_number + - elsif call_history.entry_type == 'dialed' + .call-placed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - elsif call_history.entry_type == 'received' + .call-received= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - elsif call_history.entry_type == 'missed' + .call-missed= call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - else + .call-unknown + = t("call_histories.index.#{call_history.entry_type}") + = call_history.display_call_date(t("call_histories.index.date_format"), t("call_histories.index.date_today_format")) + - if call_history.forwarding_service && call_history.entry_type != 'forwarded' + = t("call_histories.index.forwarded_by") + = call_history.display_auth_account_name + %td.user + - display_name = call_history.display_name + - if display_name.blank? + - display_name = phone_book_entry.to_s + - if phone_book_entry + %a.name{:href => phone_book_phone_book_entry_path(phone_book_entry.phone_book, phone_book_entry), :itemprop => "name"}= display_name + - else + .name= display_name + .phone= phone_number + %td.status + - if call_history.display_duration + .duration= call_history.display_duration + - else + .disposition= t("call_histories.call_results.#{call_history.result}") + %td.actions + - if @sip_account.registration && can?(:call, call_history) + = link_to t('call_histories.index.actions.call'), call_sip_account_call_history_path(@sip_account, call_history), :method => :put + %td.actions + - if can? :destroy, call_history + = link_to t('call_histories.index.actions.destroy'), sip_account_call_history_path(@sip_account, call_history), :method => :delete %footer.entries-nav= render :partial => "call_histories/navigation" = image_submit_tag('icons/cross-16x.png', :confirm => t("call_histories.index.actions.confirm_selected")) -- cgit v1.2.3 From 7cdcbdc4b851b348bb21e0f2ff437138e8b9884b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 21:00:41 +0100 Subject: Added page caching for the gemeinschaft_setup#new page. --- app/controllers/gemeinschaft_setups_controller.rb | 18 +++++------------- app/models/gemeinschaft_setup.rb | 9 +++++++++ app/views/users/_form_core.html.haml | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) (limited to 'app') diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb index dbe8ff5..27c0a83 100644 --- a/app/controllers/gemeinschaft_setups_controller.rb +++ b/app/controllers/gemeinschaft_setups_controller.rb @@ -1,8 +1,12 @@ class GemeinschaftSetupsController < ApplicationController + # We use the heater rake task to generate this file. + # So it loads super fast even on slow machines. + # + caches_page :new, :gzip => :best_compression + load_and_authorize_resource :gemeinschaft_setup skip_before_filter :go_to_setup_if_new_installation - # before_filter :redirect_if_not_a_fresh_installation def new @user = @gemeinschaft_setup.build_user( @@ -62,16 +66,4 @@ class GemeinschaftSetupsController < ApplicationController end end - private - - def redirect_if_not_a_fresh_installation - if GemeinschaftSetup.all.count > 0 - if current_user - redirect_to root_url , :alert => t('gemeinschaft_setups.initial_setup.access_denied_only_available_on_a_new_system') - else - redirect_to log_in_path , :alert => t('gemeinschaft_setups.initial_setup.access_denied_only_available_on_a_new_system') - end - end - end - end diff --git a/app/models/gemeinschaft_setup.rb b/app/models/gemeinschaft_setup.rb index b445b21..0b3eeae 100644 --- a/app/models/gemeinschaft_setup.rb +++ b/app/models/gemeinschaft_setup.rb @@ -5,4 +5,13 @@ class GemeinschaftSetup < ActiveRecord::Base accepts_nested_attributes_for :sip_domain belongs_to :country belongs_to :language + + # Remove the cache which was created by the heater rake task. + # + after_create :expire_cache + + private + def expire_cache + ActionController::Base.expire_page(Rails.application.routes.url_helpers.new_gemeinschaft_setup_path) + end end diff --git a/app/views/users/_form_core.html.haml b/app/views/users/_form_core.html.haml index 8e18d12..24b15f5 100644 --- a/app/views/users/_form_core.html.haml +++ b/app/views/users/_form_core.html.haml @@ -1,6 +1,6 @@ .inputs - if GuiFunction.display?('name_data_fields_in_user_edit_form', current_user) - = f.input :male, :collection => [[true, t('users.form.gender.male')], [false, t('users.form.gender.female')]], :label_method => :last, :value_method => :first, :label => t('users.form.male.label'), :hint => conditional_hint('users.form.gender.hint'), :label => t('users.form.gender.label'), :as => :radio + = f.input :male, :collection => [[true, t('users.form.gender.male')], [false, t('users.form.gender.female')]], :label_method => :last, :value_method => :first, :label => t('users.form.male.label'), :hint => conditional_hint('users.form.gender.hint'), :label => t('users.form.gender.label'), :as => :radio_buttons = f.input :first_name, :label => t('users.form.first_name.label'), :hint => conditional_hint('users.form.first_name.hint'), :autofocus => true = f.input :middle_name, :label => t('users.form.middle_name.label'), :hint => conditional_hint('users.form.middle_name.hint') = f.input :last_name, :label => t('users.form.last_name.label'), :hint => conditional_hint('users.form.last_name.hint') -- cgit v1.2.3 From 046ce09895a08778c971052f6d22ecd6422aee6d Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 16 Jan 2013 21:24:24 +0100 Subject: list route elements in route view --- app/views/call_routes/show.html.haml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml index 31c3cb0..c5c7397 100644 --- a/app/views/call_routes/show.html.haml +++ b/app/views/call_routes/show.html.haml @@ -16,4 +16,10 @@ %strong= t('call_routes.show.position') + ":" = @call_route.position -= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } \ No newline at end of file += render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } + +%h3= t('route_elements.index.page_title') +- if @call_route.route_elements && @call_route.route_elements.count > 0 + = render "route_elements/index_core", :route_elements => @call_route.route_elements + += render :partial => 'shared/create_link', :locals => { :parent => @call_route, :child_class => RouteElement } -- cgit v1.2.3 From 9ffaaeeb42b364f2c7d9b7d17a272c530f546c83 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 21:46:37 +0100 Subject: Refactoring and adding user_groups to tenant#show #105 --- app/views/tenants/_admin_area.de.html.haml | 4 +++ app/views/tenants/_admin_area.html.haml | 4 +++ app/views/user_groups/_index_core.html.haml | 46 ++++++++++++++++------------- app/views/users/_listing.html.haml | 6 ++-- 4 files changed, 36 insertions(+), 24 deletions(-) (limited to 'app') diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index beab94e..89e14cb 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -30,6 +30,10 @@ %h2 Admin Bereich = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} +- if @tenant.user_groups.any? + %h2 Gruppen + = render "user_groups/index_core", :user_groups => @tenant.user_groups + %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index 65810e7..7136f1e 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -29,6 +29,10 @@ %h2 Admin Area = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} +- if @tenant.user_groups.any? + %h2 Groups + = render "user_groups/index_core", :user_groups => @tenant.user_groups + %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} diff --git a/app/views/user_groups/_index_core.html.haml b/app/views/user_groups/_index_core.html.haml index d2b6e88..481a507 100644 --- a/app/views/user_groups/_index_core.html.haml +++ b/app/views/user_groups/_index_core.html.haml @@ -1,24 +1,28 @@ -%table - %tr - %th= t('user_groups.index.name') - %th= t('user_groups.index.description') - - if @user - %th= t('user_groups.index.tenant_id') - - else - %th= t('user_groups.index.members') - - - reset_cycle - - for user_group in user_groups - %tr{:class => cycle('odd', 'even')} - %td= user_group.name - %td= user_group.description +- cache(['user_groups_table', I18n.locale, current_user, @user, user_groups, User.order(:updated_at).last, User.count, UserGroupMembership.count, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do + %table + %tr + %th= t('user_groups.index.name') + - if user_groups.pluck(:description).uniq != [nil] + %th= t('user_groups.index.description') - if @user - %td= user_group.tenant + %th= t('user_groups.index.tenant_id') - else - %td - =render 'users/listing', :users => user_group.users - - if user_group.users.count > 1 - %br - = render :partial => 'shared/create_link', :locals => {:parent => user_group, :child_class => UserGroupMembership} + %th= t('user_groups.index.members') + + - reset_cycle + - for user_group in user_groups + %tr{:class => cycle('odd', 'even')} + %td= user_group.name + - if user_groups.pluck(:description).uniq != [nil] + %td= user_group.description + - if @user + %td= user_group.tenant + - else + %td + =render 'users/listing', :users => user_group.users + - if user_group.users.any? + %br + - if (user_group.tenant.user_ids - user_group.user_ids).any? + = render :partial => 'shared/create_link', :locals => {:parent => user_group, :child_class => UserGroupMembership} - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user_group.tenant, :child => user_group} + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => user_group.tenant, :child => user_group} diff --git a/app/views/users/_listing.html.haml b/app/views/users/_listing.html.haml index 0a97ad1..9b7b653 100644 --- a/app/views/users/_listing.html.haml +++ b/app/views/users/_listing.html.haml @@ -1,8 +1,8 @@ - amount_of_users = users.count - if amount_of_users > 0 - - if amount_of_users < 30 + - if amount_of_users < GsParameter.get('NUMBER_OF_SHOWN_ITEMS') = users.map{|user| user}.join(', ') - else - = users.limit(15).map{|user| user}.join(', ') + ', ' + = users.limit((GsParameter.get('NUMBER_OF_SHOWN_ITEMS') / 2).floor).map{|user| user}.join(', ') + ', ' = '[...]' - = users.offset(amount_of_users - 15).map{|user| user}.join(', ') \ No newline at end of file + = users.offset(amount_of_users - (GsParameter.get('NUMBER_OF_SHOWN_ITEMS') / 2).floor).map{|user| user}.join(', ') \ No newline at end of file -- cgit v1.2.3 From 1bd91b138c773aedbd5f18b9df79e28fac240dbc Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 22:04:44 +0100 Subject: Added a users table to tenant#view. Related to #105. Still a lot of room for improvement. --- app/views/tenants/_admin_area.de.html.haml | 17 +++++++++++++---- app/views/tenants/_admin_area.html.haml | 19 ++++++++++++++----- 2 files changed, 27 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index 89e14cb..0ef9da3 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -30,15 +30,24 @@ %h2 Admin Bereich = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} +%h2= t("users.index.page_title") +- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "users/index_core", :users => @tenant.users + = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User} +- else + %p + = link_to "Liste aller User.", tenant_users_path(@tenant) + - if @tenant.user_groups.any? - %h2 Gruppen + %h2= t("user_groups.index.page_title") = render "user_groups/index_core", :user_groups => @tenant.user_groups + = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup} %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} -%h2 Gemeinschaft Konfiguration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} - %h2=t("phone_books.index.page_title") = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} + +%h2 Gemeinschaft Konfiguration += render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index 7136f1e..7b47587 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -29,15 +29,24 @@ %h2 Admin Area = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} +%h2= t("users.index.page_title") +- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "users/index_core", :users => @tenant.users + = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User} +- else + %p + = link_to "Liste aller User.", tenant_users_path(@tenant) + - if @tenant.user_groups.any? - %h2 Groups + %h2= t("user_groups.index.page_title") = render "user_groups/index_core", :user_groups => @tenant.user_groups + = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup} %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} -%h2 Gemeinschaft Configuration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} - %h2=t("phone_books.index.page_title") -= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} + +%h2 Gemeinschaft Configuration += render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file -- cgit v1.2.3 From 35b857cd917b2005aef993c40021253abe96e2d2 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Wed, 16 Jan 2013 22:08:19 +0100 Subject: It doesn't make sense to create a tenant.user_group here. #105 --- app/views/users/_user_groups.html.haml | 1 - 1 file changed, 1 deletion(-) (limited to 'app') diff --git a/app/views/users/_user_groups.html.haml b/app/views/users/_user_groups.html.haml index 7e206b6..81191ae 100644 --- a/app/views/users/_user_groups.html.haml +++ b/app/views/users/_user_groups.html.haml @@ -5,4 +5,3 @@ %h2=t("user_groups.index.page_title") - if user.user_groups.count > 0 = render "user_groups/index_core", :user_groups => user.user_groups.where(:tenant_id => tenant.id).order(:name) - = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => UserGroup} \ No newline at end of file -- cgit v1.2.3 From a8a0c40dfae8844162bd472faa9badc38d30d2d5 Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 16 Jan 2013 23:08:08 +0100 Subject: acts_as_list --- app/models/route_element.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 11bb54a..6f6fd3f 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -3,6 +3,8 @@ class RouteElement < ActiveRecord::Base belongs_to :call_route + acts_as_list :scope => :call_route + def to_s "#{var_in} #{var_out}" end -- cgit v1.2.3 From f7f1785023f6fa52775c7ab2796fc247bf1ab15f Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 16 Jan 2013 23:08:13 +0100 Subject: acts_as_list --- app/models/call_route.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index de0f68a..e423030 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -6,6 +6,8 @@ class CallRoute < ActiveRecord::Base validates :name, :presence => true + acts_as_list :scope => '`table` = \'#{table}\'' + def to_s name.to_s end -- cgit v1.2.3 From 4ba228de6ecbfa0eeca20f8f7b70aee78fde9385 Mon Sep 17 00:00:00 2001 From: spag Date: Wed, 16 Jan 2013 23:08:53 +0100 Subject: position removed --- app/views/call_routes/show.html.haml | 3 --- 1 file changed, 3 deletions(-) (limited to 'app') diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml index c5c7397..8be64e6 100644 --- a/app/views/call_routes/show.html.haml +++ b/app/views/call_routes/show.html.haml @@ -12,9 +12,6 @@ %p %strong= t('call_routes.show.endpoint_id') + ":" = @call_route.endpoint_id -%p - %strong= t('call_routes.show.position') + ":" - = @call_route.position = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } -- cgit v1.2.3 From 1d18e9d7fc16501d7622889df9d6ef05c75adb2f Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 06:59:08 +0100 Subject: validations --- app/models/call_route.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index e423030..f6a3dd3 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -1,4 +1,6 @@ class CallRoute < ActiveRecord::Base + ROUTING_TABLES = ['prerouting', 'outbound', 'inbound'] + attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position has_many :route_elements, :dependent => :destroy @@ -6,6 +8,10 @@ class CallRoute < ActiveRecord::Base validates :name, :presence => true + validates :table, + :presence => true, + :inclusion => { :in => ROUTING_TABLES } + acts_as_list :scope => '`table` = \'#{table}\'' def to_s -- cgit v1.2.3 From 85d8dc12c3963f78ea1db4089c6ff2fa6ec205e9 Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 07:44:01 +0100 Subject: validations --- app/models/route_element.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 6f6fd3f..d3302ea 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -1,10 +1,23 @@ class RouteElement < ActiveRecord::Base + ELEMENT_ACTIONS = ['match', 'not_match', 'set_route_var', 'set_header'] + attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position belongs_to :call_route acts_as_list :scope => :call_route + validates :var_in, + :presence => true + + validates :pattern, + :presence => true + + validates :action, + :presence => true, + :inclusion => { :in => ELEMENT_ACTIONS } + + def to_s "#{var_in} #{var_out}" end -- cgit v1.2.3 From 416a9c563ed52b2b4f5350b8a069313f5843489c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 17 Jan 2013 09:51:34 +0100 Subject: Cache bug fixed. --- app/views/users/show.html.haml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index f74d0a5..9a0ae02 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -47,16 +47,14 @@ - cache(['user_show_user_groups_overview', I18n.locale, @user, @user.user_groups]) do = render :partial => 'user_groups', :locals => {:user => @user, :tenant => @tenant} - - cache(['user_show_overview_for_sip_account_phones_fax_accounts_and_conferences', I18n.locale, @user, @user.sip_accounts, @user.phones, @user.fax_accounts, @user.conferences]) do + - cache(['user_show_sip_accounts_overview', I18n.locale, @user, @user.sip_accounts]) do + = render :partial => 'sip_accounts', :locals => {:user => @user} - - cache(['user_show_sip_accounts_overview', I18n.locale, @user, @user.sip_accounts]) do - = render :partial => 'sip_accounts', :locals => {:user => @user} + - cache(['user_show_phones_overview', I18n.locale, @user, @user.phones]) do + = render :partial => 'phones', :locals => {:user => @user} - - cache(['user_show_phones_overview', I18n.locale, @user, @user.phones]) do - = render :partial => 'phones', :locals => {:user => @user} + - cache(['user_show_fax_accounts_overview', I18n.locale, @user, @user.fax_accounts]) do + = render :partial => 'fax_accounts', :locals => {:user => @user} - - cache(['user_show_fax_accounts_overview', I18n.locale, @user, @user.fax_accounts]) do - = render :partial => 'fax_accounts', :locals => {:user => @user} - - - cache(['user_show_conferences_overview', I18n.locale, @user, @user.conferences]) do - = render :partial => 'conferences', :locals => {:user => @user} + - cache(['user_show_conferences_overview', I18n.locale, @user, @user.conferences]) do + = render :partial => 'conferences', :locals => {:user => @user} -- cgit v1.2.3 From ae8ce84e44d776b3c2318795ceff611f0639b7ec Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 12:31:10 +0100 Subject: call route views --- app/views/call_routes/_form_core.html.haml | 3 +-- app/views/call_routes/_index_core.html.haml | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'app') diff --git a/app/views/call_routes/_form_core.html.haml b/app/views/call_routes/_form_core.html.haml index 4b97434..4712e2f 100644 --- a/app/views/call_routes/_form_core.html.haml +++ b/app/views/call_routes/_form_core.html.haml @@ -1,6 +1,5 @@ .inputs - = f.input :table, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint') + = f.input :table, :collection => CallRoute::ROUTING_TABLES, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint'), :include_blank => false = f.input :name, :label => t('call_routes.form.name.label'), :hint => conditional_hint('call_routes.form.name.hint') = f.input :endpoint_type, :label => t('call_routes.form.endpoint_type.label'), :hint => conditional_hint('call_routes.form.endpoint_type.hint') = f.input :endpoint_id, :label => t('call_routes.form.endpoint_id.label'), :hint => conditional_hint('call_routes.form.endpoint_id.hint') - = f.input :position, :label => t('call_routes.form.position.label'), :hint => conditional_hint('call_routes.form.position.hint') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 6ea3af7..9e7b94e 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -4,7 +4,6 @@ %th= t('call_routes.index.name') %th= t('call_routes.index.endpoint_type') %th= t('call_routes.index.endpoint_id') - %th= t('call_routes.index.position') - reset_cycle - for call_route in call_routes @@ -13,5 +12,4 @@ %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id - %td= call_route.position =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file -- cgit v1.2.3 From 808a9d19c7376907370e58662856cd028e9b83b1 Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 12:31:28 +0100 Subject: route elements views --- app/views/route_elements/_form_core.html.haml | 3 +-- app/views/route_elements/_index_core.html.haml | 2 -- app/views/route_elements/show.html.haml | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) (limited to 'app') diff --git a/app/views/route_elements/_form_core.html.haml b/app/views/route_elements/_form_core.html.haml index 133d1df..a9a38a7 100644 --- a/app/views/route_elements/_form_core.html.haml +++ b/app/views/route_elements/_form_core.html.haml @@ -3,6 +3,5 @@ = f.input :var_out, :label => t('route_elements.form.var_out.label'), :hint => conditional_hint('route_elements.form.var_out.hint') = f.input :pattern, :label => t('route_elements.form.pattern.label'), :hint => conditional_hint('route_elements.form.pattern.hint') = f.input :replacement, :label => t('route_elements.form.replacement.label'), :hint => conditional_hint('route_elements.form.replacement.hint') - = f.input :action, :label => t('route_elements.form.action.label'), :hint => conditional_hint('route_elements.form.action.hint') + = f.input :action, :collection => RouteElement::ELEMENT_ACTIONS, :label => t('route_elements.form.action.label'), :hint => conditional_hint('route_elements.form.action.hint'), :include_blank => false = f.input :mandatory, :label => t('route_elements.form.mandatory.label'), :hint => conditional_hint('route_elements.form.mandatory.hint') - = f.input :position, :label => t('route_elements.form.position.label'), :hint => conditional_hint('route_elements.form.position.hint') diff --git a/app/views/route_elements/_index_core.html.haml b/app/views/route_elements/_index_core.html.haml index c1df665..3435686 100644 --- a/app/views/route_elements/_index_core.html.haml +++ b/app/views/route_elements/_index_core.html.haml @@ -6,7 +6,6 @@ %th= t('route_elements.index.replacement') %th= t('route_elements.index.action') %th= t('route_elements.index.mandatory') - %th= t('route_elements.index.position') - reset_cycle - for route_element in route_elements @@ -17,5 +16,4 @@ %td= route_element.replacement %td= route_element.action %td= route_element.mandatory - %td= route_element.position =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @call_route, :child => route_element} \ No newline at end of file diff --git a/app/views/route_elements/show.html.haml b/app/views/route_elements/show.html.haml index 8e41f80..c637a4d 100644 --- a/app/views/route_elements/show.html.haml +++ b/app/views/route_elements/show.html.haml @@ -18,8 +18,5 @@ %p %strong= t('route_elements.show.mandatory') + ":" = @route_element.mandatory -%p - %strong= t('route_elements.show.position') + ":" - = @route_element.position = render :partial => 'shared/show_edit_destroy_part', :locals => {:parent => @call_route, :child => @route_element } \ No newline at end of file -- cgit v1.2.3 From b086515a8a82f572e204bac9cb8c139ca8a0960d Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 15:11:48 +0100 Subject: element actions --- app/models/route_element.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index d3302ea..32f730d 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -1,5 +1,5 @@ class RouteElement < ActiveRecord::Base - ELEMENT_ACTIONS = ['match', 'not_match', 'set_route_var', 'set_header'] + ELEMENT_ACTIONS = ['none', 'match', 'not_match', 'set'] attr_accessible :call_route_id, :var_in, :var_out, :pattern, :replacement, :action, :mandatory, :position -- cgit v1.2.3 From 24e47521f1a57c73dc349de35909af7e1f8a4a1f Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 17:50:47 +0100 Subject: group by table --- app/controllers/call_routes_controller.rb | 2 ++ app/views/call_routes/_index_core.html.haml | 2 -- app/views/call_routes/index.html.haml | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 41abe6d..b0c173d 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -4,6 +4,8 @@ class CallRoutesController < ApplicationController before_filter :spread_breadcrumbs def index + @call_routes = CallRoute.order(['`table`', :position]) + @tables = @call_routes.pluck('`table`').uniq.sort end def show diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 9e7b94e..aa22437 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -1,6 +1,5 @@ %table %tr - %th= t('call_routes.index.table') %th= t('call_routes.index.name') %th= t('call_routes.index.endpoint_type') %th= t('call_routes.index.endpoint_id') @@ -8,7 +7,6 @@ - reset_cycle - for call_route in call_routes %tr{:class => cycle('odd', 'even')} - %td= call_route.table %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id diff --git a/app/views/call_routes/index.html.haml b/app/views/call_routes/index.html.haml index 687a9dc..c83606b 100644 --- a/app/views/call_routes/index.html.haml +++ b/app/views/call_routes/index.html.haml @@ -1,6 +1,11 @@ - title t("call_routes.index.page_title") - if @call_routes && @call_routes.count > 0 - = render "index_core", :call_routes => @call_routes - -= render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} \ No newline at end of file + %table + - @tables.each do |table| + %tr + %td{:colspan => 3} + %h3= table + = render "index_core", :call_routes => @call_routes.where(:table => table) + += render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} -- cgit v1.2.3 From 17206a20e5bcb44fa4d90f0e176f7aa0fe43bca3 Mon Sep 17 00:00:00 2001 From: spag Date: Thu, 17 Jan 2013 21:51:58 +0100 Subject: rename_column table to routing_table --- app/controllers/call_routes_controller.rb | 4 ++-- app/models/call_route.rb | 4 ++-- app/views/call_routes/_form_core.html.haml | 2 +- app/views/call_routes/index.html.haml | 6 +++--- app/views/call_routes/show.html.haml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index b0c173d..130a160 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -4,8 +4,8 @@ class CallRoutesController < ApplicationController before_filter :spread_breadcrumbs def index - @call_routes = CallRoute.order(['`table`', :position]) - @tables = @call_routes.pluck('`table`').uniq.sort + @call_routes = CallRoute.order([:routing_table, :position]) + @routing_tables = @call_routes.pluck(:routing_table).uniq.sort end def show diff --git a/app/models/call_route.rb b/app/models/call_route.rb index f6a3dd3..0df961d 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -1,7 +1,7 @@ class CallRoute < ActiveRecord::Base ROUTING_TABLES = ['prerouting', 'outbound', 'inbound'] - attr_accessible :table, :name, :endpoint_type, :endpoint_id, :position + attr_accessible :routing_table, :name, :endpoint_type, :endpoint_id, :position has_many :route_elements, :dependent => :destroy @@ -12,7 +12,7 @@ class CallRoute < ActiveRecord::Base :presence => true, :inclusion => { :in => ROUTING_TABLES } - acts_as_list :scope => '`table` = \'#{table}\'' + acts_as_list :scope => '`routing_table` = \'#{routing_table}\'' def to_s name.to_s diff --git a/app/views/call_routes/_form_core.html.haml b/app/views/call_routes/_form_core.html.haml index 4712e2f..2eee795 100644 --- a/app/views/call_routes/_form_core.html.haml +++ b/app/views/call_routes/_form_core.html.haml @@ -1,5 +1,5 @@ .inputs - = f.input :table, :collection => CallRoute::ROUTING_TABLES, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint'), :include_blank => false + = f.input :routing_table, :collection => CallRoute::ROUTING_TABLES, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint'), :include_blank => false = f.input :name, :label => t('call_routes.form.name.label'), :hint => conditional_hint('call_routes.form.name.hint') = f.input :endpoint_type, :label => t('call_routes.form.endpoint_type.label'), :hint => conditional_hint('call_routes.form.endpoint_type.hint') = f.input :endpoint_id, :label => t('call_routes.form.endpoint_id.label'), :hint => conditional_hint('call_routes.form.endpoint_id.hint') diff --git a/app/views/call_routes/index.html.haml b/app/views/call_routes/index.html.haml index c83606b..151fc0e 100644 --- a/app/views/call_routes/index.html.haml +++ b/app/views/call_routes/index.html.haml @@ -2,10 +2,10 @@ - if @call_routes && @call_routes.count > 0 %table - - @tables.each do |table| + - @routing_tables.each do |routing_table| %tr %td{:colspan => 3} - %h3= table - = render "index_core", :call_routes => @call_routes.where(:table => table) + %h3= routing_table + = render "index_core", :call_routes => @call_routes.where(:routing_table => routing_table) = render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml index 8be64e6..bada227 100644 --- a/app/views/call_routes/show.html.haml +++ b/app/views/call_routes/show.html.haml @@ -2,7 +2,7 @@ %p %strong= t('call_routes.show.table') + ":" - = @call_route.table + = @call_route.routing_table %p %strong= t('call_routes.show.name') + ":" = @call_route.name -- cgit v1.2.3 From 73c9984510d572030329d967e44c6adb00d98613 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 08:11:56 +0100 Subject: Clean up mess which was created by renaming :table to :routing_table. --- app/controllers/call_routes_controller.rb | 9 +++++++-- app/controllers/gs_parameters_controller.rb | 8 ++++---- app/models/call_route.rb | 7 ++++--- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 130a160..89f66ba 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -15,7 +15,7 @@ class CallRoutesController < ApplicationController end def create - @call_route = CallRoute.new(params[:call_route]) + @call_route = CallRoute.new(call_route_parameter_params[:call_route]) if @call_route.save redirect_to @call_route, :notice => t('call_routes.controller.successfuly_created') else @@ -27,7 +27,7 @@ class CallRoutesController < ApplicationController end def update - if @call_route.update_attributes(params[:call_route]) + if @call_route.update_attributes(call_route_parameter_params[:call_route]) redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated') else render :edit @@ -40,6 +40,10 @@ class CallRoutesController < ApplicationController end private + def call_route_parameter_params + params.require(:call_route).permit(:id, :routing_table, :name, :endpoint_type, :endpoint_id, :position) + end + def spread_breadcrumbs add_breadcrumb t("call_routes.index.page_title"), call_routes_path if @call_route && !@call_route.new_record? @@ -47,4 +51,5 @@ class CallRoutesController < ApplicationController end end + end diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb index 7ca4e8e..3c212c1 100644 --- a/app/controllers/gs_parameters_controller.rb +++ b/app/controllers/gs_parameters_controller.rb @@ -10,7 +10,7 @@ class GsParametersController < ApplicationController end def show - @gs_parameter = GsParameter.find(params[:id]) + @gs_parameter = GsParameter.find(gs_parameter_params[:id]) end def new @@ -18,11 +18,11 @@ class GsParametersController < ApplicationController end def edit - @gs_parameter = GsParameter.find(params[:id]) + @gs_parameter = GsParameter.find(gs_parameter_params[:id]) end def update - @gs_parameter = GsParameter.find(params[:id]) + @gs_parameter = GsParameter.find(gs_parameter_params[:id]) if @gs_parameter.update_attributes(gs_parameter_params) redirect_to @gs_parameter, :notice => t('gs_parameters.controller.successfuly_updated') else @@ -32,7 +32,7 @@ class GsParametersController < ApplicationController private def gs_parameter_params - params.require(:gs_parameter).permit(:value, :class_type, :description) + params.require(:gs_parameter).permit(:id, :value, :class_type, :description) end def spread_breadcrumbs diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 0df961d..5d90901 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -1,14 +1,15 @@ class CallRoute < ActiveRecord::Base - ROUTING_TABLES = ['prerouting', 'outbound', 'inbound'] + # https://github.com/rails/strong_parameters + include ActiveModel::ForbiddenAttributesProtection - attr_accessible :routing_table, :name, :endpoint_type, :endpoint_id, :position + ROUTING_TABLES = ['prerouting', 'outbound', 'inbound'] has_many :route_elements, :dependent => :destroy validates :name, :presence => true - validates :table, + validates :routing_table, :presence => true, :inclusion => { :in => ROUTING_TABLES } -- cgit v1.2.3 From 808c04b5b1776927dc7b854bb2a69d34b287c24c Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 09:45:54 +0100 Subject: validations removed --- app/models/route_element.rb | 6 ------ 1 file changed, 6 deletions(-) (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 32f730d..87b26ef 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -7,12 +7,6 @@ class RouteElement < ActiveRecord::Base acts_as_list :scope => :call_route - validates :var_in, - :presence => true - - validates :pattern, - :presence => true - validates :action, :presence => true, :inclusion => { :in => ELEMENT_ACTIONS } -- cgit v1.2.3 From 5efd9bdd2f78a15569fb7d1569dceff3bb4f8800 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 10:19:09 +0100 Subject: Fixed a strange strong_parameter cancan bug. --- app/controllers/call_routes_controller.rb | 13 +++++++------ app/views/call_routes/_form_core.html.haml | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 89f66ba..8b8698f 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,6 +1,4 @@ class CallRoutesController < ApplicationController - load_and_authorize_resource :call_route - before_filter :spread_breadcrumbs def index @@ -9,13 +7,15 @@ class CallRoutesController < ApplicationController end def show + @call_route = CallRoute.find(params[:id]) end def new + @call_route = CallRoute.new end def create - @call_route = CallRoute.new(call_route_parameter_params[:call_route]) + @call_route = CallRoute.new(call_route_parameter_params) if @call_route.save redirect_to @call_route, :notice => t('call_routes.controller.successfuly_created') else @@ -27,7 +27,8 @@ class CallRoutesController < ApplicationController end def update - if @call_route.update_attributes(call_route_parameter_params[:call_route]) + @call_route = CallRoute.find(params[:id]) + if @call_route.update_attributes(call_route_parameter_params) redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated') else render :edit @@ -35,13 +36,14 @@ class CallRoutesController < ApplicationController end def destroy + @call_route = CallRoute.find(params[:id]) @call_route.destroy redirect_to call_routes_url, :notice => t('call_routes.controller.successfuly_destroyed') end private def call_route_parameter_params - params.require(:call_route).permit(:id, :routing_table, :name, :endpoint_type, :endpoint_id, :position) + params.require(:call_route).permit(:routing_table, :name, :endpoint_type, :endpoint_id) end def spread_breadcrumbs @@ -51,5 +53,4 @@ class CallRoutesController < ApplicationController end end - end diff --git a/app/views/call_routes/_form_core.html.haml b/app/views/call_routes/_form_core.html.haml index 2eee795..b64d660 100644 --- a/app/views/call_routes/_form_core.html.haml +++ b/app/views/call_routes/_form_core.html.haml @@ -1,5 +1,5 @@ .inputs - = f.input :routing_table, :collection => CallRoute::ROUTING_TABLES, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint'), :include_blank => false + = f.input :routing_table, :collection => CallRoute::ROUTING_TABLES, :label => t('call_routes.form.table.label'), :hint => conditional_hint('call_routes.form.table.hint'), :include_blank => false, :autofocus => true = f.input :name, :label => t('call_routes.form.name.label'), :hint => conditional_hint('call_routes.form.name.hint') = f.input :endpoint_type, :label => t('call_routes.form.endpoint_type.label'), :hint => conditional_hint('call_routes.form.endpoint_type.hint') = f.input :endpoint_id, :label => t('call_routes.form.endpoint_id.label'), :hint => conditional_hint('call_routes.form.endpoint_id.hint') -- cgit v1.2.3 From 8feb9102570d23f53c3443ccd3a409d87c97828d Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 10:57:12 +0100 Subject: Refactoring and fixing #112 --- app/models/ability.rb | 4 ++ app/views/tenants/_admin_area.de.html.haml | 46 ++++++++-------------- app/views/tenants/_admin_area.html.haml | 45 ++++++++------------- .../tenants/_sip_accounts_and_phones.html.haml | 2 +- app/views/tenants/show.html.haml | 14 +++---- 5 files changed, 42 insertions(+), 69 deletions(-) (limited to 'app') diff --git a/app/models/ability.rb b/app/models/ability.rb index cd91a8a..b846af0 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -27,6 +27,10 @@ class Ability # cannot [:create, :destroy, :edit, :update], Tenant, :id => 1 + # Can't destroy any tenant + # + cannot :destroy, Tenant + cannot :manage, PhoneBook # Phonebooks and PhoneBookEntries diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index 0ef9da3..268c8e7 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -1,32 +1,3 @@ -- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do - %p - Sie sind Mitglied der - = link_to 'Admin Gruppe', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins')) - und haben deshalb besondere Rechte. Aber wie Peter Parker schon sagte: "With great power comes great responsibility." - - %p - = @tenant - hat - = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant) - - if @tenant.user_groups.count < 5 - = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})" - die in Summe - = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant) - verwalten. - Das System kann - = PhoneModel.count - verschiedene Telefonmodelle von den folgenden Herstellern verwalten: - - Manufacturer.all.each do |manufacturer| - - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last - = succeed ', ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last - = succeed ' und ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - else - = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) - %h2 Admin Bereich = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} @@ -50,4 +21,19 @@ = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} %h2 Gemeinschaft Konfiguration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} + +%p + Das System kann + = PhoneModel.count + verschiedene Telefonmodelle von den folgenden Herstellern verwalten: + - Manufacturer.all.each do |manufacturer| + - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last + = succeed ', ' do + =link_to manufacturer, manufacturer_path(manufacturer) + - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last + = succeed ' und ' do + =link_to manufacturer, manufacturer_path(manufacturer) + - else + = succeed '.' do + =link_to manufacturer, manufacturer_path(manufacturer) \ No newline at end of file diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index 7b47587..e708215 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -1,31 +1,3 @@ -- cache(['tenant_show_admin_area', I18n.locale, @tenant, UserGroup.count, UserGroup.order(:updated_at).last, User.count, User.order(:updated_at).last, Manufacturer.all]) do - %p - You belong to the - = link_to 'admin group', tenant_user_group_path(@tenant, @tenant.user_groups.find_by_name('Admins')) - and therefore have super powers. But always remember Peter Parker's: "With great power comes great responsibility." - - %p - = succeed '.' do - This tenant has - = link_to pluralize(@tenant.user_groups.count, 'user group'), tenant_user_groups_path(@tenant) - - if @tenant.user_groups.count < 5 - = "(#{@tenant.user_groups.order(:name).map{|group| group.to_s }.join(', ')})" - which handle a total of - = link_to pluralize(@tenant.users.count, 'user'), tenant_users_path(@tenant) - This system can setup - = PhoneModel.count - different phone models from the manufacturers - - Manufacturer.all.each do |manufacturer| - - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last - = succeed ', ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last - = succeed ' and ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - else - = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) - %h2 Admin Area = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} @@ -49,4 +21,19 @@ = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} %h2 Gemeinschaft Configuration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} + +%p + This system can setup + = PhoneModel.count + different phone models from the manufacturers + - Manufacturer.all.each do |manufacturer| + - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last + = succeed ', ' do + =link_to manufacturer, manufacturer_path(manufacturer) + - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last + = succeed ' and ' do + =link_to manufacturer, manufacturer_path(manufacturer) + - else + = succeed '.' do + =link_to manufacturer, manufacturer_path(manufacturer) \ No newline at end of file diff --git a/app/views/tenants/_sip_accounts_and_phones.html.haml b/app/views/tenants/_sip_accounts_and_phones.html.haml index e322b67..4b84b1c 100644 --- a/app/views/tenants/_sip_accounts_and_phones.html.haml +++ b/app/views/tenants/_sip_accounts_and_phones.html.haml @@ -21,7 +21,7 @@ = '[' + truncate(sip_account.phone_numbers.map{|phone_number| phone_number.to_s}.join(', '), :length => 25) + ']' = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => SipAccount} - - cache(['tenant_show_admin_area_sip_accounts_table_cell', I18n.locale, @tenant, @tenant.phones.count, @tenant.phones.reorder(:updated_at).last]) do + - cache(['tenant_show_admin_area_phones_table_cell', I18n.locale, @tenant, @tenant.phones.count, @tenant.phones.reorder(:updated_at).last]) do %td - if tenant.phones.any? - if tenant.phones.count > GsParameter.get('NUMBER_OF_SHOWN_ITEMS') diff --git a/app/views/tenants/show.html.haml b/app/views/tenants/show.html.haml index 10845cf..f5cff5f 100644 --- a/app/views/tenants/show.html.haml +++ b/app/views/tenants/show.html.haml @@ -1,15 +1,11 @@ -- title t("tenants.show.page_title") +- title @tenant.name -- cache(['tenant_show_name_and_description', I18n.locale, @tenant, current_user]) do +- if !@tenant.description.blank? %p - %strong= t('tenants.show.name') + ":" - = @tenant.name - - if !@tenant.description.blank? - %p - %strong= t('tenants.show.description') + ":" - = @tenant.description + %strong= t('tenants.show.description') + ":" + = @tenant.description - = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant } += render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant } - if @tenant.user_groups.where(:name => 'Admins').count > 0 && @tenant.user_groups.where(:name => 'Admins').first.users.include?(current_user) = render 'admin_area' \ No newline at end of file -- cgit v1.2.3 From dc3f3ef9eb0d0669d48be0795ecd601350ac978f Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 11:00:34 +0100 Subject: Closes #113 --- app/controllers/gs_parameters_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app') diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb index 3c212c1..7ca4e8e 100644 --- a/app/controllers/gs_parameters_controller.rb +++ b/app/controllers/gs_parameters_controller.rb @@ -10,7 +10,7 @@ class GsParametersController < ApplicationController end def show - @gs_parameter = GsParameter.find(gs_parameter_params[:id]) + @gs_parameter = GsParameter.find(params[:id]) end def new @@ -18,11 +18,11 @@ class GsParametersController < ApplicationController end def edit - @gs_parameter = GsParameter.find(gs_parameter_params[:id]) + @gs_parameter = GsParameter.find(params[:id]) end def update - @gs_parameter = GsParameter.find(gs_parameter_params[:id]) + @gs_parameter = GsParameter.find(params[:id]) if @gs_parameter.update_attributes(gs_parameter_params) redirect_to @gs_parameter, :notice => t('gs_parameters.controller.successfuly_updated') else @@ -32,7 +32,7 @@ class GsParametersController < ApplicationController private def gs_parameter_params - params.require(:gs_parameter).permit(:id, :value, :class_type, :description) + params.require(:gs_parameter).permit(:value, :class_type, :description) end def spread_breadcrumbs -- cgit v1.2.3 From ba4d32db18a7e6dd701dcfb210ec6af062ee2446 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 11:07:08 +0100 Subject: Added caching for users table. --- app/views/users/_index_core.html.haml | 36 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'app') diff --git a/app/views/users/_index_core.html.haml b/app/views/users/_index_core.html.haml index 51c15de..5d0fd16 100644 --- a/app/views/users/_index_core.html.haml +++ b/app/views/users/_index_core.html.haml @@ -1,18 +1,20 @@ -%table - %tr - %th - %th= t('users.index.user_name') - %th= t('users.index.email') - %th= t('users.index.first_name') - %th= t('users.index.last_name') +- cache(['user_table_row_inner_td', I18n.locale, current_user, users.order(:updated_at).last, users.count]) do + %table + %tr + %th + %th= t('users.index.user_name') + %th= t('users.index.email') + %th= t('users.index.first_name') + %th= t('users.index.last_name') - - reset_cycle - - for user in users - %tr{:class => cycle('odd', 'even')} - %td - = image_tag user.image_url(:mini).to_s if user.image_url(:mini) - %td= user.user_name - %td= user.email - %td= user.first_name - %td= user.last_name - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @tenant, :child => user} \ No newline at end of file + - reset_cycle + - for user in users + %tr{:class => cycle('odd', 'even')} + - cache(['user_table_row_inner_td', I18n.locale, current_user, user]) do + %td + = image_tag user.image_url(:mini).to_s if user.image_url(:mini) + %td= user.user_name + %td= user.email + %td= user.first_name + %td= user.last_name + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:parent => @tenant, :child => user} \ No newline at end of file -- cgit v1.2.3 From d4e7d4a5d5bdb63fbda279dbc8dd2ec495b90907 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 11:08:34 +0100 Subject: Added GsParameter.get('NUMBER_OF_SHOWN_ITEMS') to the cache key. --- app/views/users/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/users/_index_core.html.haml b/app/views/users/_index_core.html.haml index 5d0fd16..9376826 100644 --- a/app/views/users/_index_core.html.haml +++ b/app/views/users/_index_core.html.haml @@ -1,4 +1,4 @@ -- cache(['user_table_row_inner_td', I18n.locale, current_user, users.order(:updated_at).last, users.count]) do +- cache(['user_table_row_inner_td', I18n.locale, current_user, users.order(:updated_at).last, users.count, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do %table %tr %th -- cgit v1.2.3 From e7f51187fe563c559c5580e5091f01356a36b6c3 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 15:09:32 +0100 Subject: load_and_authorize_resource :gs_parameter #114 --- app/controllers/gs_parameters_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/gs_parameters_controller.rb b/app/controllers/gs_parameters_controller.rb index 7ca4e8e..bd8b44b 100644 --- a/app/controllers/gs_parameters_controller.rb +++ b/app/controllers/gs_parameters_controller.rb @@ -1,5 +1,5 @@ class GsParametersController < ApplicationController - load_resource :gs_parameter + load_and_authorize_resource :gs_parameter before_filter :spread_breadcrumbs -- cgit v1.2.3 From 8c2ffa8f9308235e151ae8f16393ee10b08b07c1 Mon Sep 17 00:00:00 2001 From: spag Date: Fri, 18 Jan 2013 15:14:17 +0100 Subject: moh defaults to moh --- app/models/automatic_call_distributor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/automatic_call_distributor.rb b/app/models/automatic_call_distributor.rb index a34392e..5807757 100644 --- a/app/models/automatic_call_distributor.rb +++ b/app/models/automatic_call_distributor.rb @@ -26,6 +26,6 @@ class AutomaticCallDistributor < ActiveRecord::Base self.announce_call_agents ||= 'ivr/ivr-stay_on_line_call_answered_momentarily.wav' self.greeting ||= 'ivr/ivr-thank_you_for_calling.wav' self.goodbye ||= 'ivr/ivr-thank_you_for_calling.wav' - self.music ||= 'local_stream://mohl' + self.music ||= 'local_stream://moh' end end -- cgit v1.2.3 From 277744c7412c44b54ff46c1d6548c2c4242327e3 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 15:20:20 +0100 Subject: added load_and_authorize_resource :call_route --- app/controllers/call_routes_controller.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 8b8698f..cdb425b 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,4 +1,5 @@ class CallRoutesController < ApplicationController + load_and_authorize_resource :call_route before_filter :spread_breadcrumbs def index -- cgit v1.2.3 From a4c2b5b00c074d8861ef313f672032611d662fff Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 19 Jan 2013 08:53:02 +0100 Subject: Refactoring. --- app/views/tenants/_admin_area.de.html.haml | 15 ++------------- app/views/tenants/_admin_area.html.haml | 15 ++------------- app/views/tenants/_table_of_phone_books.html.haml | 1 + app/views/tenants/_user_groups_table.de.html.haml | 4 ++++ app/views/tenants/_users_table.de.html.haml | 7 +++++++ 5 files changed, 16 insertions(+), 26 deletions(-) create mode 100644 app/views/tenants/_user_groups_table.de.html.haml create mode 100644 app/views/tenants/_users_table.de.html.haml (limited to 'app') diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index 268c8e7..fed7d4f 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -1,23 +1,12 @@ -%h2 Admin Bereich = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} -%h2= t("users.index.page_title") -- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') - = render "users/index_core", :users => @tenant.users - = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User} -- else - %p - = link_to "Liste aller User.", tenant_users_path(@tenant) += render :partial => 'users_table', :locals => {:tenant => @tenant} -- if @tenant.user_groups.any? - %h2= t("user_groups.index.page_title") - = render "user_groups/index_core", :user_groups => @tenant.user_groups - = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup} += render :partial => 'user_groups_table', :locals => {:tenant => @tenant} %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} -%h2=t("phone_books.index.page_title") = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} %h2 Gemeinschaft Konfiguration diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index e708215..50ed372 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -1,23 +1,12 @@ -%h2 Admin Area = render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} -%h2= t("users.index.page_title") -- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') - = render "users/index_core", :users => @tenant.users - = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => User} -- else - %p - = link_to "Liste aller User.", tenant_users_path(@tenant) += render :partial => 'users_table', :locals => {:tenant => @tenant} -- if @tenant.user_groups.any? - %h2= t("user_groups.index.page_title") - = render "user_groups/index_core", :user_groups => @tenant.user_groups - = render :partial => 'shared/create_link', :locals => {:parent => @tenant, :child_class => UserGroup} += render :partial => 'user_groups_table', :locals => {:tenant => @tenant} %h2 Features = render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} -%h2=t("phone_books.index.page_title") = render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} %h2 Gemeinschaft Configuration diff --git a/app/views/tenants/_table_of_phone_books.html.haml b/app/views/tenants/_table_of_phone_books.html.haml index 6baca58..9d9b97c 100644 --- a/app/views/tenants/_table_of_phone_books.html.haml +++ b/app/views/tenants/_table_of_phone_books.html.haml @@ -1,4 +1,5 @@ - cache(['user_show_phone_books', I18n.locale, tenant, tenant.phone_books]) do + %h2=t("phone_books.index.page_title") -# Phone books -# - if GuiFunction.display?('show_phone_books_in_user_show_view', current_user) diff --git a/app/views/tenants/_user_groups_table.de.html.haml b/app/views/tenants/_user_groups_table.de.html.haml new file mode 100644 index 0000000..61b3e3d --- /dev/null +++ b/app/views/tenants/_user_groups_table.de.html.haml @@ -0,0 +1,4 @@ +- if @tenant.user_groups.any? + %h2= t("user_groups.index.page_title") + = render "user_groups/index_core", :user_groups => tenant.user_groups + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => UserGroup} diff --git a/app/views/tenants/_users_table.de.html.haml b/app/views/tenants/_users_table.de.html.haml new file mode 100644 index 0000000..850ea5e --- /dev/null +++ b/app/views/tenants/_users_table.de.html.haml @@ -0,0 +1,7 @@ +%h2= t("users.index.page_title") +- if @tenant.users.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "users/index_core", :users => tenant.users + = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => User} +- else + %p + = link_to "Liste aller User.", tenant_users_path(tenant) \ No newline at end of file -- cgit v1.2.3 From b4abd87252db53e3d79a9601cf9c581f61827f10 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 19 Jan 2013 09:05:50 +0100 Subject: Added call_routes to tenant#show --- app/models/route_element.rb | 2 +- app/views/tenants/_admin_area.de.html.haml | 4 +++- app/views/tenants/_call_routes.html.haml | 8 ++++++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 app/views/tenants/_call_routes.html.haml (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 87b26ef..324a26d 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -13,7 +13,7 @@ class RouteElement < ActiveRecord::Base def to_s - "#{var_in} #{var_out}" + "#{pattern} => #{var_in} #{var_out}" end end diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index fed7d4f..ba64e9a 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -25,4 +25,6 @@ =link_to manufacturer, manufacturer_path(manufacturer) - else = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) \ No newline at end of file + =link_to manufacturer, manufacturer_path(manufacturer) + += render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_call_routes.html.haml b/app/views/tenants/_call_routes.html.haml new file mode 100644 index 0000000..ade24c9 --- /dev/null +++ b/app/views/tenants/_call_routes.html.haml @@ -0,0 +1,8 @@ +%h2= t("call_routes.index.page_title") + +- if CallRoute.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "call_routes/index_core", :call_routes => CallRoute.call + = render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} +- else + %p + = link_to t("call_routes.index.page_title"), call_routes_path \ No newline at end of file -- cgit v1.2.3 From bb7992ac94e763c80fc7f4b5d850a19d88f5bf3b Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 19 Jan 2013 09:07:43 +0100 Subject: allow arrows if no parent defined --- app/views/shared/_index_view_edit_destroy_part.html.haml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/shared/_index_view_edit_destroy_part.html.haml b/app/views/shared/_index_view_edit_destroy_part.html.haml index 06ec904..ff5a988 100644 --- a/app/views/shared/_index_view_edit_destroy_part.html.haml +++ b/app/views/shared/_index_view_edit_destroy_part.html.haml @@ -26,4 +26,10 @@ = link_to t("#{child.class.name.underscore.pluralize}.index.actions.edit"), method( :"edit_#{child.class.name.underscore}_path" ).(child) %td{ :style => style } - if can? :destroy, child - = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete \ No newline at end of file + = link_to t("#{child.class.name.underscore.pluralize}.index.actions.destroy"), method( :"#{child.class.name.underscore}_path" ).(child), :method => :delete + - if child.respond_to?(:move_up?) or child and child.respond_to?(:move_down?) + %td{ :style => style } + - if can? :move_down, child and child.respond_to?(:move_down?) and child.move_down? + = link_to '⇩'.html_safe, method( :"move_lower_#{child.class.name.underscore}_path" ).(child), :method => :put + - if can? :move_up, child and child.respond_to?(:move_up?) and child.move_up? + = link_to '⇧'.html_safe, method( :"move_higher_#{child.class.name.underscore}_path" ).(child), :method => :put -- cgit v1.2.3 From c1cdcc3927a8632157017cf15801d2a508eed2ad Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 19 Jan 2013 09:08:36 +0100 Subject: move methods added --- app/models/call_route.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 5d90901..1fe61e9 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -18,4 +18,12 @@ class CallRoute < ActiveRecord::Base def to_s name.to_s end + + def move_up? + return self.position.to_i > CallRoute.where(:routing_table => self.routing_table ).order(:position).first.position.to_i + end + + def move_down? + return self.position.to_i < CallRoute.where(:routing_table => self.routing_table ).order(:position).last.position.to_i + end end -- cgit v1.2.3 From 6defcadbb9500efbfcf487c384ad41f958f5e46f Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 19 Jan 2013 09:09:04 +0100 Subject: move actions added --- app/controllers/call_routes_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index cdb425b..5ef7c4b 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -42,6 +42,16 @@ class CallRoutesController < ApplicationController redirect_to call_routes_url, :notice => t('call_routes.controller.successfuly_destroyed') end + def move_higher + @call_route.move_higher + redirect_to :back + end + + def move_lower + @call_route.move_lower + redirect_to :back + end + private def call_route_parameter_params params.require(:call_route).permit(:routing_table, :name, :endpoint_type, :endpoint_id) -- cgit v1.2.3 From 4c141a6d1c20745addd135d1cdd6844b90a20c33 Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 19 Jan 2013 09:09:25 +0100 Subject: move actions added --- app/controllers/route_elements_controller.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app') diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb index 699fcc6..c4e4c1a 100644 --- a/app/controllers/route_elements_controller.rb +++ b/app/controllers/route_elements_controller.rb @@ -44,6 +44,16 @@ class RouteElementsController < ApplicationController redirect_to call_route_route_elements_path(@call_route), :notice => t('route_elements.controller.successfuly_destroyed') end + def move_higher + @route_element.move_higher + redirect_to :back + end + + def move_lower + @route_element.move_lower + redirect_to :back + end + private def spread_breadcrumbs add_breadcrumb t("call_routes.index.page_title"), call_routes_path -- cgit v1.2.3 From bcbfb154a321953fd32696065e6af1bec85f9345 Mon Sep 17 00:00:00 2001 From: spag Date: Sat, 19 Jan 2013 09:17:41 +0100 Subject: move methods added --- app/models/route_element.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app') diff --git a/app/models/route_element.rb b/app/models/route_element.rb index 324a26d..94f0f84 100644 --- a/app/models/route_element.rb +++ b/app/models/route_element.rb @@ -16,4 +16,11 @@ class RouteElement < ActiveRecord::Base "#{pattern} => #{var_in} #{var_out}" end + def move_up? + #return self.position.to_i > RouteElement.where(:call_route_id => self.call_route_id ).order(:position).first.position.to_i + end + + def move_down? + #return self.position.to_i < RouteElement.where(:call_route_id => self.call_route_id ).order(:position).last.position.to_i + end end -- cgit v1.2.3 From 525e7ad4cac6fff7bd0370828b06159d610573ef Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:45:36 +0100 Subject: Added caching. --- app/views/call_routes/_index_core.html.haml | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index aa22437..124f4d0 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -1,13 +1,15 @@ -%table - %tr - %th= t('call_routes.index.name') - %th= t('call_routes.index.endpoint_type') - %th= t('call_routes.index.endpoint_id') +- cache(['call_routes_table', call_routes.count, call_routes.reorder(:updated_at).last]) do + %table + %tr + %th= t('call_routes.index.name') + %th= t('call_routes.index.endpoint_type') + %th= t('call_routes.index.endpoint_id') - - reset_cycle - - for call_route in call_routes - %tr{:class => cycle('odd', 'even')} - %td= call_route.name - %td= call_route.endpoint_type - %td= call_route.endpoint_id - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file + - reset_cycle + - for call_route in call_routes + %tr{:class => cycle('odd', 'even')} + - cache(['call_route_single_table_row', call_route]) do + %td= call_route.name + %td= call_route.endpoint_type + %td= call_route.endpoint_id + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => call_route} \ No newline at end of file -- cgit v1.2.3 From 93a839b41f7172eecd1aeb497ccec6c73d2c4c1e Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:46:13 +0100 Subject: Better cache key. --- app/views/call_routes/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 124f4d0..32877b2 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -8,7 +8,7 @@ - reset_cycle - for call_route in call_routes %tr{:class => cycle('odd', 'even')} - - cache(['call_route_single_table_row', call_route]) do + - cache(['call_route_single_table_row_within_tr', call_route]) do %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id -- cgit v1.2.3 From 5b5cbfddd9fa3a26de90ca8aa42668eb95648605 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:48:19 +0100 Subject: Small logic fix. --- app/views/call_routes/_index_core.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/views/call_routes/_index_core.html.haml b/app/views/call_routes/_index_core.html.haml index 32877b2..12e89ee 100644 --- a/app/views/call_routes/_index_core.html.haml +++ b/app/views/call_routes/_index_core.html.haml @@ -8,7 +8,7 @@ - reset_cycle - for call_route in call_routes %tr{:class => cycle('odd', 'even')} - - cache(['call_route_single_table_row_within_tr', call_route]) do + - cache(['call_route_single_table_row_within_tr', call_route, call_routes.count]) do %td= call_route.name %td= call_route.endpoint_type %td= call_route.endpoint_id -- cgit v1.2.3 From 4ea0e252683d89794deff7b1b3689d2cdf61e0d0 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 19:54:11 +0100 Subject: Added a gateways table to tenant#view. --- app/views/gateways/show.html.haml | 2 +- app/views/tenants/_admin_area.de.html.haml | 4 +++- app/views/tenants/_admin_area.html.haml | 4 +++- app/views/tenants/_call_routes.html.haml | 2 +- app/views/tenants/_gateways.html.haml | 8 ++++++++ 5 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 app/views/tenants/_gateways.html.haml (limited to 'app') diff --git a/app/views/gateways/show.html.haml b/app/views/gateways/show.html.haml index a9b0d18..9d0ee53 100644 --- a/app/views/gateways/show.html.haml +++ b/app/views/gateways/show.html.haml @@ -28,8 +28,8 @@ %br = render :partial => 'shared/create_link', :locals => { :parent => @gateway, :child_class => GatewaySetting } +%h3= t('gateway_parameters.index.page_title') - if @gateway.gateway_parameters.any? - %h3= t('gateway_parameters.index.page_title') = render "gateway_parameters/index_core", :gateway_parameters => @gateway.gateway_parameters %br = render :partial => 'shared/create_link', :locals => { :parent => @gateway, :child_class => GatewayParameter } diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml index ba64e9a..6a4bef9 100644 --- a/app/views/tenants/_admin_area.de.html.haml +++ b/app/views/tenants/_admin_area.de.html.haml @@ -27,4 +27,6 @@ = succeed '.' do =link_to manufacturer, manufacturer_path(manufacturer) -= render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'call_routes', :locals => {:tenant => @tenant} + += render :partial => 'gateways', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index 50ed372..b974c02 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -25,4 +25,6 @@ =link_to manufacturer, manufacturer_path(manufacturer) - else = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) \ No newline at end of file + =link_to manufacturer, manufacturer_path(manufacturer) + += render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_call_routes.html.haml b/app/views/tenants/_call_routes.html.haml index ade24c9..41066ae 100644 --- a/app/views/tenants/_call_routes.html.haml +++ b/app/views/tenants/_call_routes.html.haml @@ -1,7 +1,7 @@ %h2= t("call_routes.index.page_title") - if CallRoute.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') - = render "call_routes/index_core", :call_routes => CallRoute.call + = render "call_routes/index_core", :call_routes => CallRoute.all = render :partial => 'shared/create_link', :locals => {:child_class => CallRoute} - else %p diff --git a/app/views/tenants/_gateways.html.haml b/app/views/tenants/_gateways.html.haml new file mode 100644 index 0000000..c861ad3 --- /dev/null +++ b/app/views/tenants/_gateways.html.haml @@ -0,0 +1,8 @@ +%h2= t("gateways.index.page_title") + +- if Gateway.count <= GsParameter.get('NUMBER_OF_SHOWN_ITEMS') + = render "gateways/index_core", :gateways => Gateway.all + = render :partial => 'shared/create_link', :locals => {:child_class => Gateway} +- else + %p + = link_to t("gateways.index.page_title"), gateways_path \ No newline at end of file -- cgit v1.2.3 From fe5b9f2c046561f9918a5660b4a5193ef66fd3aa Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 20:01:06 +0100 Subject: Replaced some order with reorder within cache key generation. --- app/views/gs_parameters/index.html.haml | 2 +- app/views/tenants/_gs_parameter_table.html.haml | 6 +++--- app/views/tenants/_table_of_functions.html.haml | 10 +++++----- app/views/users/_index_core.html.haml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'app') diff --git a/app/views/gs_parameters/index.html.haml b/app/views/gs_parameters/index.html.haml index 37fe825..3844c3d 100644 --- a/app/views/gs_parameters/index.html.haml +++ b/app/views/gs_parameters/index.html.haml @@ -1,7 +1,7 @@ - title t("gs_parameters.index.page_title") - if @gs_parameters && @gs_parameters.count > 0 - - cache(['gs_parameters_table', I18n.locale, @gs_parameters_unordered.order(:updated_at).last, @gs_parameters_unordered.count]) do + - cache(['gs_parameters_table', I18n.locale, @gs_parameters_unordered.reorder(:updated_at).last, @gs_parameters_unordered.count]) do - if @sections %table - @sections.each do |section| diff --git a/app/views/tenants/_gs_parameter_table.html.haml b/app/views/tenants/_gs_parameter_table.html.haml index 3af06cf..94c44e5 100644 --- a/app/views/tenants/_gs_parameter_table.html.haml +++ b/app/views/tenants/_gs_parameter_table.html.haml @@ -1,4 +1,4 @@ -- cache(['gs_parameters_tenant_overview_table', I18n.locale, tenant, GuiFunction.count, GuiFunction.order(:updated_at).last, GsParameter.count, GsParameter.order(:updated_at).last]) do +- cache(['gs_parameters_tenant_overview_table', I18n.locale, tenant, GuiFunction.count, GuiFunction.reorder(:updated_at).last, GsParameter.count, GsParameter.reorder(:updated_at).last]) do %table %tr{:class => 'even'} %th @@ -14,11 +14,11 @@ %td = link_to GuiFunction.count.to_s, gui_functions_path %td - = l GuiFunction.order(:updated_at).last.updated_at, :format => :short + = l GuiFunction.reorder(:updated_at).last.updated_at, :format => :short %tr{:class => 'even'} %td = t("gs_parameters.name") %td = link_to GsParameter.count.to_s, gs_parameters_path %td - = l GsParameter.order(:updated_at).last.updated_at, :format => :short + = l GsParameter.reorder(:updated_at).last.updated_at, :format => :short diff --git a/app/views/tenants/_table_of_functions.html.haml b/app/views/tenants/_table_of_functions.html.haml index 75b2332..957687b 100644 --- a/app/views/tenants/_table_of_functions.html.haml +++ b/app/views/tenants/_table_of_functions.html.haml @@ -1,4 +1,4 @@ -- cache(['table_of_pbx_features', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.order(:updated_at).last, tenant.conferences.count, tenant.conferences.order(:updated_at).last, tenant.hunt_groups.count, tenant.hunt_groups.order(:updated_at).last, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.order(:updated_at).last]) do +- cache(['table_of_pbx_features', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do %table %tr{:class => 'even'} %th @@ -6,7 +6,7 @@ %th Anzahl %th - - cache(['table_of_pbx_features_callthroughs_row', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.order(:updated_at).last]) do + - cache(['table_of_pbx_features_callthroughs_row', I18n.locale, tenant, tenant.callthroughs.count, tenant.callthroughs.reorder(:updated_at).last]) do %tr{:class => 'odd'} %td = t("callthroughs.name") @@ -17,7 +17,7 @@ = '-' %td = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Callthrough} - - cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.order(:updated_at).last]) do + - cache(['table_of_pbx_features_conferences_row', I18n.locale, tenant, tenant.conferences.count, tenant.conferences.reorder(:updated_at).last]) do %tr{:class => 'even'} %td = t("conferences.name") @@ -28,7 +28,7 @@ = '-' %td = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => Conference} - - cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.order(:updated_at).last]) do + - cache(['table_of_pbx_features_hunt_groups_row', I18n.locale, tenant, tenant.hunt_groups.count, tenant.hunt_groups.reorder(:updated_at).last]) do %tr{:class => 'odd'} %td = t("hunt_groups.name") @@ -39,7 +39,7 @@ = '-' %td = render :partial => 'shared/create_link', :locals => {:parent => tenant, :child_class => HuntGroup} - - cache(['table_of_pbx_features_automatic_call_distributors_row', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.order(:updated_at).last]) do + - cache(['table_of_pbx_features_automatic_call_distributors_row', I18n.locale, tenant, tenant.automatic_call_distributors.count, tenant.automatic_call_distributors.reorder(:updated_at).last]) do %tr{:class => 'even'} %td = t("automatic_call_distributors.name") diff --git a/app/views/users/_index_core.html.haml b/app/views/users/_index_core.html.haml index 9376826..5f0cb41 100644 --- a/app/views/users/_index_core.html.haml +++ b/app/views/users/_index_core.html.haml @@ -1,4 +1,4 @@ -- cache(['user_table_row_inner_td', I18n.locale, current_user, users.order(:updated_at).last, users.count, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do +- cache(['user_table_row_inner_td', I18n.locale, current_user, users.reorder(:updated_at).last, users.count, GsParameter.get('NUMBER_OF_SHOWN_ITEMS')]) do %table %tr %th -- cgit v1.2.3 From a2abe7dffb8fe31687910ca4be6dc0374a247d00 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 20:07:28 +0100 Subject: Fixed some strange cancan problem. #119 --- app/controllers/call_routes_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 5ef7c4b..0f4a02d 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,5 +1,5 @@ class CallRoutesController < ApplicationController - load_and_authorize_resource :call_route + authorize_resource :call_route before_filter :spread_breadcrumbs def index @@ -25,6 +25,7 @@ class CallRoutesController < ApplicationController end def edit + @call_route = CallRoute.find(params[:id]) end def update -- cgit v1.2.3 From 4e67f8769a3a3199bfb5b363fe9baa231c329a2b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 20:57:35 +0100 Subject: Refactoring --- app/controllers/tenants_controller.rb | 19 +++++++++++++++-- app/models/gateway.rb | 7 ++++++ app/models/tenant.rb | 11 ++-------- app/views/gateways/_index_core.html.haml | 34 ++++++++++++++++-------------- app/views/tenants/_admin_area.de.html.haml | 32 ---------------------------- app/views/tenants/_admin_area.html.haml | 24 +++++++++++---------- app/views/tenants/show.html.haml | 4 ++-- 7 files changed, 59 insertions(+), 72 deletions(-) delete mode 100644 app/views/tenants/_admin_area.de.html.haml (limited to 'app') diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb index 7bb8ecd..cb67e5f 100644 --- a/app/controllers/tenants_controller.rb +++ b/app/controllers/tenants_controller.rb @@ -1,13 +1,17 @@ class TenantsController < ApplicationController - load_and_authorize_resource :tenant + authorize_resource :tenant def index + @tenants = Tenant.scoped end def show + @tenant = Tenant.find(params[:id]) + @gateways = Gateway.order(:updated_at) end def new + @tenant = Tenant.new @tenant.name = generate_a_new_name(@tenant) @tenant.sip_domain = SipDomain.last @tenant.country = GemeinschaftSetup.first.country @@ -18,6 +22,8 @@ class TenantsController < ApplicationController end def create + @tenant = Tenant.new(tenant_params) + if @tenant.save # Become a member of this tenant. # @@ -86,10 +92,12 @@ class TenantsController < ApplicationController end def edit + @tenant = Tenant.find(params[:id]) end def update - if @tenant.update_attributes(params[:tenant]) + @tenant = Tenant.find(params[:id]) + if @tenant.update_attributes(tenant_params) redirect_to @tenant, :notice => t('tenants.controller.successfuly_updated') else render :edit @@ -97,8 +105,15 @@ class TenantsController < ApplicationController end def destroy + @tenant = Tenant.find(params[:id]) @tenant.destroy redirect_to tenants_url, :notice => t('tenants.controller.successfuly_destroyed') end + + private + def tenant_params + params.require(:tenant).permit(:name, :description, :sip_domain_id, :country_id, :language_id, :from_field_pin_change_email, :from_field_voicemail_email +) + end end diff --git a/app/models/gateway.rb b/app/models/gateway.rb index 21dc831..3e791a6 100644 --- a/app/models/gateway.rb +++ b/app/models/gateway.rb @@ -14,6 +14,7 @@ class Gateway < ActiveRecord::Base :presence => true, :inclusion => { :in => TECHNOLOGIES } + after_initialize :set_defaults before_validation :downcase_technology def to_s @@ -25,4 +26,10 @@ class Gateway < ActiveRecord::Base self.technology = self.technology.downcase if !self.technology.blank? end + def set_defaults + if TECHNOLOGIES.count == 1 + self.technology = TECHNOLOGIES.first + end + end + end diff --git a/app/models/tenant.rb b/app/models/tenant.rb index c3e2926..419ac3a 100644 --- a/app/models/tenant.rb +++ b/app/models/tenant.rb @@ -1,15 +1,8 @@ # encoding: UTF-8 class Tenant < ActiveRecord::Base - attr_accessible :name, :description, :sip_domain_id, :country_id, :language_id, :from_field_pin_change_email, :from_field_voicemail_email - - if GsParameter.get('STRICT_INTERNAL_EXTENSION_HANDLING') == true - attr_accessible :internal_extension_ranges - end - - if GsParameter.get('STRICT_DID_HANDLING') == true - attr_accessible :did_list - end + # https://github.com/rails/strong_parameters + include ActiveModel::ForbiddenAttributesProtection # Associations: # diff --git a/app/views/gateways/_index_core.html.haml b/app/views/gateways/_index_core.html.haml index 21414c3..dd2d1f5 100644 --- a/app/views/gateways/_index_core.html.haml +++ b/app/views/gateways/_index_core.html.haml @@ -1,17 +1,19 @@ -%table - %tr - %th= t('gateways.index.name') - %th= t('gateways.index.technology') - %th= t('gateways.index.inbound') - %th= t('gateways.index.outbound') - %th= t('gateways.index.description') +- cache(['gateways_table', gateways.count, gateways.first, gateways.last]) do + %table + %tr + %th= t('gateways.index.name') + %th= t('gateways.index.technology') + %th= t('gateways.index.inbound') + %th= t('gateways.index.outbound') + %th= t('gateways.index.description') - - reset_cycle - - for gateway in gateways - %tr{:class => cycle('odd', 'even')} - %td= gateway.name - %td= gateway.technology - %td= gateway.inbound - %td= gateway.outbound - %td= gateway.description - =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gateway} \ No newline at end of file + - reset_cycle + - for gateway in gateways + %tr{:class => cycle('odd', 'even')} + - cache(['gateway_single_table_row_within_tr', gateway, gateways.count]) do + %td= gateway.name + %td= gateway.technology + %td= gateway.inbound + %td= gateway.outbound + %td= gateway.description + =render :partial => 'shared/index_view_edit_destroy_part', :locals => {:child => gateway} \ No newline at end of file diff --git a/app/views/tenants/_admin_area.de.html.haml b/app/views/tenants/_admin_area.de.html.haml deleted file mode 100644 index 6a4bef9..0000000 --- a/app/views/tenants/_admin_area.de.html.haml +++ /dev/null @@ -1,32 +0,0 @@ -= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} - -= render :partial => 'users_table', :locals => {:tenant => @tenant} - -= render :partial => 'user_groups_table', :locals => {:tenant => @tenant} - -%h2 Features -= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} - -= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} - -%h2 Gemeinschaft Konfiguration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} - -%p - Das System kann - = PhoneModel.count - verschiedene Telefonmodelle von den folgenden Herstellern verwalten: - - Manufacturer.all.each do |manufacturer| - - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last - = succeed ', ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last - = succeed ' und ' do - =link_to manufacturer, manufacturer_path(manufacturer) - - else - = succeed '.' do - =link_to manufacturer, manufacturer_path(manufacturer) - -= render :partial => 'call_routes', :locals => {:tenant => @tenant} - -= render :partial => 'gateways', :locals => {:tenant => @tenant} \ No newline at end of file diff --git a/app/views/tenants/_admin_area.html.haml b/app/views/tenants/_admin_area.html.haml index b974c02..7e7e46b 100644 --- a/app/views/tenants/_admin_area.html.haml +++ b/app/views/tenants/_admin_area.html.haml @@ -1,30 +1,32 @@ -= render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => @tenant} += render :partial => 'tenants/sip_accounts_and_phones', :locals => {:tenant => tenant} -= render :partial => 'users_table', :locals => {:tenant => @tenant} += render :partial => 'users_table', :locals => {:tenant => tenant} -= render :partial => 'user_groups_table', :locals => {:tenant => @tenant} += render :partial => 'user_groups_table', :locals => {:tenant => tenant} %h2 Features -= render :partial => 'tenants/table_of_functions', :locals => {:tenant => @tenant} += render :partial => 'tenants/table_of_functions', :locals => {:tenant => tenant} -= render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => @tenant} += render :partial => 'tenants/table_of_phone_books', :locals => {:tenant => tenant} -%h2 Gemeinschaft Configuration -= render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => @tenant} +%h2 Gemeinschaft Konfiguration += render :partial => 'tenants/gs_parameter_table', :locals => {:tenant => tenant} %p - This system can setup + Das System kann = PhoneModel.count - different phone models from the manufacturers + verschiedene Telefonmodelle von den folgenden Herstellern verwalten: - Manufacturer.all.each do |manufacturer| - if manufacturer != Manufacturer.last && manufacturer != Manufacturer.limit(Manufacturer.count - 1).last = succeed ', ' do =link_to manufacturer, manufacturer_path(manufacturer) - elsif manufacturer == Manufacturer.limit(Manufacturer.count - 1).last - = succeed ' and ' do + = succeed ' und ' do =link_to manufacturer, manufacturer_path(manufacturer) - else = succeed '.' do =link_to manufacturer, manufacturer_path(manufacturer) -= render :partial => 'call_routes', :locals => {:tenant => @tenant} \ No newline at end of file += render :partial => 'call_routes', :locals => {:tenant => tenant} + += render :partial => 'gateways', :locals => {:tenant => tenant, :gateways => gateways} \ No newline at end of file diff --git a/app/views/tenants/show.html.haml b/app/views/tenants/show.html.haml index f5cff5f..9b9d4ec 100644 --- a/app/views/tenants/show.html.haml +++ b/app/views/tenants/show.html.haml @@ -7,5 +7,5 @@ = render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @tenant } -- if @tenant.user_groups.where(:name => 'Admins').count > 0 && @tenant.user_groups.where(:name => 'Admins').first.users.include?(current_user) - = render 'admin_area' \ No newline at end of file +- if @tenant.user_groups.where(:name => 'Admins').any? && @tenant.user_groups.where(:name => 'Admins').first.users.include?(current_user) + = render :partial => 'admin_area', :locals => { :tenant => @tenant, :gateways => @gateways} \ No newline at end of file -- cgit v1.2.3 From fb18fd9bae2d24bef4652b40a4b0d206b77ebb4f Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 20 Jan 2013 21:09:10 +0100 Subject: Added breadcrumbs. --- app/controllers/call_routes_controller.rb | 9 +++++++-- app/controllers/gateways_controller.rb | 16 ++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 0f4a02d..2437d8d 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -1,22 +1,25 @@ class CallRoutesController < ApplicationController authorize_resource :call_route - before_filter :spread_breadcrumbs def index @call_routes = CallRoute.order([:routing_table, :position]) @routing_tables = @call_routes.pluck(:routing_table).uniq.sort + spread_breadcrumbs end def show @call_route = CallRoute.find(params[:id]) + spread_breadcrumbs end def new @call_route = CallRoute.new + spread_breadcrumbs end def create @call_route = CallRoute.new(call_route_parameter_params) + spread_breadcrumbs if @call_route.save redirect_to @call_route, :notice => t('call_routes.controller.successfuly_created') else @@ -26,10 +29,12 @@ class CallRoutesController < ApplicationController def edit @call_route = CallRoute.find(params[:id]) + spread_breadcrumbs end def update @call_route = CallRoute.find(params[:id]) + spread_breadcrumbs if @call_route.update_attributes(call_route_parameter_params) redirect_to @call_route, :notice => t('call_routes.controller.successfuly_updated') else @@ -61,7 +66,7 @@ class CallRoutesController < ApplicationController def spread_breadcrumbs add_breadcrumb t("call_routes.index.page_title"), call_routes_path if @call_route && !@call_route.new_record? - add_breadcrumb @call_route, call_route_path(@call_route) + add_breadcrumb @call_route, @call_route end end diff --git a/app/controllers/gateways_controller.rb b/app/controllers/gateways_controller.rb index 6173ca3..5741195 100644 --- a/app/controllers/gateways_controller.rb +++ b/app/controllers/gateways_controller.rb @@ -1,18 +1,24 @@ class GatewaysController < ApplicationController + authorize_resource :gateway + def index @gateways = Gateway.all + spread_breadcrumbs end def show @gateway = Gateway.find(params[:id]) + spread_breadcrumbs end def new @gateway = Gateway.new + spread_breadcrumbs end def create @gateway = Gateway.new(params[:gateway]) + spread_breadcrumbs if @gateway.save redirect_to @gateway, :notice => t('gateways.controller.successfuly_created') else @@ -22,10 +28,12 @@ class GatewaysController < ApplicationController def edit @gateway = Gateway.find(params[:id]) + spread_breadcrumbs end def update @gateway = Gateway.find(params[:id]) + spread_breadcrumbs if @gateway.update_attributes(params[:gateway]) redirect_to @gateway, :notice => t('gateways.controller.successfuly_updated') else @@ -38,4 +46,12 @@ class GatewaysController < ApplicationController @gateway.destroy redirect_to gateways_url, :notice => t('gateways.controller.successfuly_destroyed') end + + private + def spread_breadcrumbs + add_breadcrumb t("gateways.index.page_title"), gateways_path + if @gateway && !@gateway.new_record? + add_breadcrumb @gateway, @gateway + end + end end -- cgit v1.2.3 From a6779c02f83d1873ebc33b1610013dcbadfeb10b Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 11:07:54 +0100 Subject: Bug fix #121 --- app/controllers/call_routes_controller.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/controllers/call_routes_controller.rb b/app/controllers/call_routes_controller.rb index 2437d8d..0259a10 100644 --- a/app/controllers/call_routes_controller.rb +++ b/app/controllers/call_routes_controller.rb @@ -49,11 +49,13 @@ class CallRoutesController < ApplicationController end def move_higher + @call_route = CallRoute.find(params[:id]) @call_route.move_higher redirect_to :back end def move_lower + @call_route = CallRoute.find(params[:id]) @call_route.move_lower redirect_to :back end -- cgit v1.2.3 From f7c8227521a758f769d3bde892b8b7201bf841dc Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 21 Jan 2013 13:02:49 +0100 Subject: factory_defaults_prerouting method added --- app/models/call_route.rb | 212 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 1fe61e9..0bf7816 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -26,4 +26,216 @@ class CallRoute < ActiveRecord::Base def move_down? return self.position.to_i < CallRoute.where(:routing_table => self.routing_table ).order(:position).last.position.to_i end + + def self.factory_defaults_prerouting(country_code, national_prefix = '', international_prefix = '', trunk_prefix = '', area_code = '') + CallRoute.where(:routing_table => "prerouting").destroy_all + + CallRoute.create_prerouting_entry('international call', [ + { :pattern => '^'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => '+%1', }, + ], 'phonenumber') + + CallRoute.create_prerouting_entry('national call', [ + { :pattern => '^'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => '+'+country_code+'%1', }, + ], 'phonenumber') + + if !trunk_prefix.blank? && !area_code.blank? + CallRoute.create_prerouting_entry('local call', [ + { :pattern => '^'+trunk_prefix+'([1-9]%d+)$', :replacement => '+'+country_code+area_code+'%1', }, + ], 'phonenumber') + end + + CallRoute.create_prerouting_entry('log in', [ + { :pattern => '^%*0%*$', :replacement => 'f-li', }, + { :pattern => '^%*0%*(%+?%d+)#*$', :replacement => 'f-li-%1', }, + { :pattern => '^%*0%*(%+?%d+)%*(%d+)#*$', :replacement => 'f-li-%1-%2', }, + ]) + + CallRoute.create_prerouting_entry('log out', [ + { :pattern => '^#0#$', :replacement => 'f-lo', }, + ]) + + CallRoute.create_prerouting_entry('toggle ACD membership', [ + { :pattern => '^%*5%*(%+?%d+)#$', :replacement => 'f-acdmtg-0-%1', }, + ]) + + CallRoute.create_prerouting_entry('activate CLIP', [ + { :pattern => '^%*30#$', :replacement => 'f-clipon', }, + ]) + + CallRoute.create_prerouting_entry('deactivate CLIP', [ + { :pattern => '^#30#$', :replacement => 'f-clipoff', }, + ]) + + CallRoute.create_prerouting_entry('activate CLIR', [ + { :pattern => '^#31#$', :replacement => 'f-cliron', }, + ]) + + CallRoute.create_prerouting_entry('deactivate CLIR', [ + { :pattern => '^%*31#$', :replacement => 'f-cliroff', }, + ]) + + elements = [ + { :pattern => '^#31#(%+?[1-9]%d+)$', :replacement => 'f-dcliron-%1', }, + { :pattern => '^#31#'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+%1' }, + { :pattern => '^#31#'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+'%1' }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^#31#'+trunk_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+area_code+'%1' } + end + + CallRoute.create_prerouting_entry('activate CLIR for call', elements) + + elements = [ + { :pattern => '^%*31#(%+?[1-9]%d+)$', :replacement => 'f-dcliroff-%1', }, + { :pattern => '^%*31#'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+%1' }, + { :pattern => '^%*31#'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+'%1' }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^%*31#'+trunk_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+area_code+'%1' } + end + + CallRoute.create_prerouting_entry('deactivate CLIR for call', elements) + + CallRoute.create_prerouting_entry('activate call waiting', [ + { :pattern => '^%*43#$', :replacement => 'f-cwaon', }, + ]) + + CallRoute.create_prerouting_entry('deactivate call waiting', [ + { :pattern => '^#43#$', :replacement => 'f-cwaoff', }, + ]) + + CallRoute.create_prerouting_entry('deactivate all call forwards', [ + { :pattern => '^#002#$', :replacement => 'f-cfoff', }, + ]) + + CallRoute.create_prerouting_entry('delete all call forwards', [ + { :pattern => '^##002#$', :replacement => 'f-cfdel', }, + ]) + + elements = [ + { :pattern => '^%*21#$', :replacement => 'f-cfu', }, + { :pattern => '^%*%*?21%*(%+?[1-9]%d+)#$', :replacement => 'f-cfu-%1', }, + { :pattern => '^%*%*?21%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+%1', }, + { :pattern => '^%*%*?21%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+'%1', }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?21%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+area_code+'%1' } + end + + CallRoute.create_prerouting_entry('set unconditional call forwarding', elements) + + CallRoute.create_prerouting_entry('deactivate unconditional call forwarding', [ + { :pattern => '^#21#$', :replacement => 'f-cfuoff', }, + ]) + + CallRoute.create_prerouting_entry('delete unconditional call forwarding', [ + { :pattern => '^##21#$', :replacement => 'f-cfudel', }, + ]) + + elements = [ + { :pattern => '^%*61#$', :replacement => 'f-cfn', }, + { :pattern => '^%*%*?61%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+%1', }, + { :pattern => '^%*%*?61%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1', }, + { :pattern => '^%*%*?61%*(%+?[1-9]%d+)#$', :replacement => 'f-cfn-%1', }, + { :pattern => '^%*%*?61%*'+trunk_prefix+international_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+%1-%2', }, + { :pattern => '^%*%*?61%*'+trunk_prefix+national_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1-%2', }, + { :pattern => '^%*%*?61%*(%+?[1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-%1-%2', }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?61%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1' } + elements << { :pattern => '^%*%*?61%*'+trunk_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1-%2' } + end + + CallRoute.create_prerouting_entry('call forward if not answered', elements) + + CallRoute.create_prerouting_entry('deactivate call forward if not answered', [ + { :pattern => '^#61#$', :replacement => 'f-cfnoff', }, + ]) + + CallRoute.create_prerouting_entry('delete call forward if not answered', [ + { :pattern => '^##61#$', :replacement => 'f-cfndel', }, + ]) + + elements = [ + { :pattern => '^%*62#$', :replacement => 'f-cfo', }, + { :pattern => '^%*%*?62%*(%+?[1-9]%d+)#$', :replacement => 'f-cfo-%1', }, + { :pattern => '^%*%*?62%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+%1', }, + { :pattern => '^%*%*?62%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+'%1', }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?62%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+area_code+'%1' } + end + + CallRoute.create_prerouting_entry('call forward if offline', elements) + + CallRoute.create_prerouting_entry('deactivate call forward if offline', [ + { :pattern => '^#62#$', :replacement => 'f-cfooff', }, + ]) + + CallRoute.create_prerouting_entry('delete call forward if offline', [ + { :pattern => '^##62#$', :replacement => 'f-cfodel', }, + ]) + + elements = [ + { :pattern => '^%*67#$', :replacement => 'f-cfb', }, + { :pattern => '^%*%*?67%*(%+?[1-9]%d+)#$', :replacement => 'f-cfb-%1', }, + { :pattern => '^%*%*?67%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+%1', }, + { :pattern => '^%*%*?67%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+'%1', }, + ] + + if !trunk_prefix.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?67%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+area_code+'%1' } + end + + CallRoute.create_prerouting_entry('call forward if busy', elements) + + CallRoute.create_prerouting_entry('deactivate call forward if busy', [ + { :pattern => '^#67#$', :replacement => 'f-cfboff', }, + ]) + + CallRoute.create_prerouting_entry('delete call forward if busy', [ + { :pattern => '^##67#$', :replacement => 'f-cfbdel', }, + ]) + + + CallRoute.create_prerouting_entry('redial', [ + { :pattern => '^%*66#$', :replacement => 'f-redial', }, + ]) + + CallRoute.create_prerouting_entry('check voicemail', [ + { :pattern => '^%*98$', :replacement => 'f-vmcheck', }, + { :pattern => '^%*98#$', :replacement => 'f-vmcheck', }, + { :pattern => '^%*98%*(%+?%d+)#$', :replacement => 'f-vmcheck-%1', }, + ]) + + CallRoute.create_prerouting_entry('acivate auto logout', [ + { :pattern => '^%*1337%*1%*1#$', :replacement => 'f-loaon', }, + ]) + + CallRoute.create_prerouting_entry('deacivate auto logout', [ + { :pattern => '^%*1337%*1%*0#$', :replacement => 'f-loaoff', }, + ]) + end + + def self.create_prerouting_entry(name, elements, endpoint_type = 'dialplanfunction') + call_route = CallRoute.create(:routing_table => 'prerouting', :name => name, :endpoint_type => endpoint_type) + + if !call_route.errors.any? then + elements.each do |element| + call_route.route_elements.create( + :var_in => 'destination_number', + :var_out => 'destination_number', + :pattern => element[:pattern], + :replacement => element[:replacement], + :action => 'match', + :mandatory => false + ) + end + end + end end -- cgit v1.2.3 From 86e94e36e52ff7a3dbc7219db5b3bea5a7f56711 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 14:09:38 +0100 Subject: factory_defaults_prerouting --- app/controllers/gemeinschaft_setups_controller.rb | 8 ++++++++ app/models/gemeinschaft_setup.rb | 12 ++++++++++++ app/views/gemeinschaft_setups/new.de.html.haml | 1 + app/views/gemeinschaft_setups/new.html.haml | 1 + 4 files changed, 22 insertions(+) (limited to 'app') diff --git a/app/controllers/gemeinschaft_setups_controller.rb b/app/controllers/gemeinschaft_setups_controller.rb index 27c0a83..347e043 100644 --- a/app/controllers/gemeinschaft_setups_controller.rb +++ b/app/controllers/gemeinschaft_setups_controller.rb @@ -45,6 +45,14 @@ class GemeinschaftSetupsController < ApplicationController super_tenant_super_admin_group = super_tenant.user_groups.create(:name => t('gemeinschaft_setups.initial_setup.super_admin_group_name')) super_tenant_super_admin_group.user_group_memberships.create(:user_id => user.id) + # Set CallRoute defaults + CallRoute.factory_defaults_prerouting(@gemeinschaft_setup.country.country_code, + @gemeinschaft_setup.country.trunk_prefix, + @gemeinschaft_setup.country.international_call_prefix, + '', + @gemeinschaft_setup.default_area_code + ) + # Set a couple of URLs in the GsParameter table GsParameter.where(:name => 'phone_book_entry_image_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}/uploads/phone_book_entry/image") GsParameter.where(:name => 'ringtone_url').first.update_attributes(:value => "http://#{@gemeinschaft_setup.sip_domain.host}") diff --git a/app/models/gemeinschaft_setup.rb b/app/models/gemeinschaft_setup.rb index 0b3eeae..6056236 100644 --- a/app/models/gemeinschaft_setup.rb +++ b/app/models/gemeinschaft_setup.rb @@ -10,8 +10,20 @@ class GemeinschaftSetup < ActiveRecord::Base # after_create :expire_cache + before_validation :format_default_area_code + private def expire_cache ActionController::Base.expire_page(Rails.application.routes.url_helpers.new_gemeinschaft_setup_path) end + + def format_default_area_code + if self.default_area_code.blank? + self.default_area_code = nil + else + if self.country != nil && !self.country.trunk_prefix.blank? + self.default_area_code.gsub(/^#{self.country.trunk_prefix}/,'') + end + end + end end diff --git a/app/views/gemeinschaft_setups/new.de.html.haml b/app/views/gemeinschaft_setups/new.de.html.haml index 2e148f3..1afa5d4 100644 --- a/app/views/gemeinschaft_setups/new.de.html.haml +++ b/app/views/gemeinschaft_setups/new.de.html.haml @@ -20,6 +20,7 @@ = f.association :country, :label => t('gemeinschaft_setups.form.country_id.label'), :hint => conditional_hint('gemeinschaft_setups.form.country_id.hint'), :include_blank => false = f.association :language, :label => t('gemeinschaft_setups.form.language_id.label'), :hint => conditional_hint('gemeinschaft_setups.form.language_id.hint'), :include_blank => false + = f.input :default_area_code, :label => t('gemeinschaft_setups.form.default_area_code.label'), :hint => conditional_hint('gemeinschaft_setups.form.default_area_code.hint') .actions = f.button :submit, conditional_t('gemeinschaft_setups.form.submit') \ No newline at end of file diff --git a/app/views/gemeinschaft_setups/new.html.haml b/app/views/gemeinschaft_setups/new.html.haml index ab5a70f..da3c60e 100644 --- a/app/views/gemeinschaft_setups/new.html.haml +++ b/app/views/gemeinschaft_setups/new.html.haml @@ -20,6 +20,7 @@ = f.association :country, :label => t('gemeinschaft_setups.form.country_id.label'), :hint => conditional_hint('gemeinschaft_setups.form.country_id.hint'), :include_blank => false = f.association :language, :label => t('gemeinschaft_setups.form.language_id.label'), :hint => conditional_hint('gemeinschaft_setups.form.language_id.hint'), :include_blank => false + = f.input :default_area_code, :label => t('gemeinschaft_setups.form.default_area_code.label'), :hint => conditional_hint('gemeinschaft_setups.form.default_area_code.hint') .actions = f.button :submit, conditional_t('gemeinschaft_setups.form.submit') \ No newline at end of file -- cgit v1.2.3 From 7159618255c6911075723f6b11ba84b85e9e40cd Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 21 Jan 2013 14:49:11 +0100 Subject: naming --- app/models/call_route.rb | 64 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'app') diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 0bf7816..28120c1 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -27,20 +27,20 @@ class CallRoute < ActiveRecord::Base return self.position.to_i < CallRoute.where(:routing_table => self.routing_table ).order(:position).last.position.to_i end - def self.factory_defaults_prerouting(country_code, national_prefix = '', international_prefix = '', trunk_prefix = '', area_code = '') + def self.factory_defaults_prerouting(country_code, national_prefix = '', international_prefix = '', trunk_access_code = '', area_code = '') CallRoute.where(:routing_table => "prerouting").destroy_all CallRoute.create_prerouting_entry('international call', [ - { :pattern => '^'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => '+%1', }, + { :pattern => '^'+trunk_access_code+international_prefix+'([1-9]%d+)$', :replacement => '+%1', }, ], 'phonenumber') CallRoute.create_prerouting_entry('national call', [ - { :pattern => '^'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => '+'+country_code+'%1', }, + { :pattern => '^'+trunk_access_code+national_prefix+'([1-9]%d+)$', :replacement => '+'+country_code+'%1', }, ], 'phonenumber') - if !trunk_prefix.blank? && !area_code.blank? + if !trunk_access_code.blank? && !area_code.blank? CallRoute.create_prerouting_entry('local call', [ - { :pattern => '^'+trunk_prefix+'([1-9]%d+)$', :replacement => '+'+country_code+area_code+'%1', }, + { :pattern => '^'+trunk_access_code+'([1-9]%d+)$', :replacement => '+'+country_code+area_code+'%1', }, ], 'phonenumber') end @@ -76,24 +76,24 @@ class CallRoute < ActiveRecord::Base elements = [ { :pattern => '^#31#(%+?[1-9]%d+)$', :replacement => 'f-dcliron-%1', }, - { :pattern => '^#31#'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+%1' }, - { :pattern => '^#31#'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+'%1' }, + { :pattern => '^#31#'+trunk_access_code+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+%1' }, + { :pattern => '^#31#'+trunk_access_code+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+'%1' }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^#31#'+trunk_prefix+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+area_code+'%1' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^#31#'+trunk_access_code+'([1-9]%d+)$', :replacement => 'f-dcliron-+'+country_code+area_code+'%1' } end CallRoute.create_prerouting_entry('activate CLIR for call', elements) elements = [ { :pattern => '^%*31#(%+?[1-9]%d+)$', :replacement => 'f-dcliroff-%1', }, - { :pattern => '^%*31#'+trunk_prefix+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+%1' }, - { :pattern => '^%*31#'+trunk_prefix+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+'%1' }, + { :pattern => '^%*31#'+trunk_access_code+international_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+%1' }, + { :pattern => '^%*31#'+trunk_access_code+national_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+'%1' }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^%*31#'+trunk_prefix+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+area_code+'%1' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^%*31#'+trunk_access_code+'([1-9]%d+)$', :replacement => 'f-dcliroff-+'+country_code+area_code+'%1' } end CallRoute.create_prerouting_entry('deactivate CLIR for call', elements) @@ -117,12 +117,12 @@ class CallRoute < ActiveRecord::Base elements = [ { :pattern => '^%*21#$', :replacement => 'f-cfu', }, { :pattern => '^%*%*?21%*(%+?[1-9]%d+)#$', :replacement => 'f-cfu-%1', }, - { :pattern => '^%*%*?21%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+%1', }, - { :pattern => '^%*%*?21%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+'%1', }, + { :pattern => '^%*%*?21%*'+trunk_access_code+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+%1', }, + { :pattern => '^%*%*?21%*'+trunk_access_code+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+'%1', }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^%*%*?21%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+area_code+'%1' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?21%*'+trunk_access_code+'([1-9]%d+)#$', :replacement => 'f-cfu-+'+country_code+area_code+'%1' } end CallRoute.create_prerouting_entry('set unconditional call forwarding', elements) @@ -137,17 +137,17 @@ class CallRoute < ActiveRecord::Base elements = [ { :pattern => '^%*61#$', :replacement => 'f-cfn', }, - { :pattern => '^%*%*?61%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+%1', }, - { :pattern => '^%*%*?61%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1', }, + { :pattern => '^%*%*?61%*'+trunk_access_code+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+%1', }, + { :pattern => '^%*%*?61%*'+trunk_access_code+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1', }, { :pattern => '^%*%*?61%*(%+?[1-9]%d+)#$', :replacement => 'f-cfn-%1', }, - { :pattern => '^%*%*?61%*'+trunk_prefix+international_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+%1-%2', }, - { :pattern => '^%*%*?61%*'+trunk_prefix+national_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1-%2', }, + { :pattern => '^%*%*?61%*'+trunk_access_code+international_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+%1-%2', }, + { :pattern => '^%*%*?61%*'+trunk_access_code+national_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+'%1-%2', }, { :pattern => '^%*%*?61%*(%+?[1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-%1-%2', }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^%*%*?61%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1' } - elements << { :pattern => '^%*%*?61%*'+trunk_prefix+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1-%2' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?61%*'+trunk_access_code+'([1-9]%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1' } + elements << { :pattern => '^%*%*?61%*'+trunk_access_code+'([1-9]%d+)%*(%d+)#$', :replacement => 'f-cfn-+'+country_code+area_code+'%1-%2' } end CallRoute.create_prerouting_entry('call forward if not answered', elements) @@ -163,12 +163,12 @@ class CallRoute < ActiveRecord::Base elements = [ { :pattern => '^%*62#$', :replacement => 'f-cfo', }, { :pattern => '^%*%*?62%*(%+?[1-9]%d+)#$', :replacement => 'f-cfo-%1', }, - { :pattern => '^%*%*?62%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+%1', }, - { :pattern => '^%*%*?62%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+'%1', }, + { :pattern => '^%*%*?62%*'+trunk_access_code+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+%1', }, + { :pattern => '^%*%*?62%*'+trunk_access_code+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+'%1', }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^%*%*?62%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+area_code+'%1' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?62%*'+trunk_access_code+'([1-9]%d+)#$', :replacement => 'f-cfo-+'+country_code+area_code+'%1' } end CallRoute.create_prerouting_entry('call forward if offline', elements) @@ -184,12 +184,12 @@ class CallRoute < ActiveRecord::Base elements = [ { :pattern => '^%*67#$', :replacement => 'f-cfb', }, { :pattern => '^%*%*?67%*(%+?[1-9]%d+)#$', :replacement => 'f-cfb-%1', }, - { :pattern => '^%*%*?67%*'+trunk_prefix+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+%1', }, - { :pattern => '^%*%*?67%*'+trunk_prefix+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+'%1', }, + { :pattern => '^%*%*?67%*'+trunk_access_code+international_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+%1', }, + { :pattern => '^%*%*?67%*'+trunk_access_code+national_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+'%1', }, ] - if !trunk_prefix.blank? && !area_code.blank? - elements << { :pattern => '^%*%*?67%*'+trunk_prefix+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+area_code+'%1' } + if !trunk_access_code.blank? && !area_code.blank? + elements << { :pattern => '^%*%*?67%*'+trunk_access_code+'([1-9]%d+)#$', :replacement => 'f-cfb-+'+country_code+area_code+'%1' } end CallRoute.create_prerouting_entry('call forward if busy', elements) -- cgit v1.2.3 From 5fbbe9c7479a7dc615b8d5630b9e1b2a6ce11b15 Mon Sep 17 00:00:00 2001 From: spag Date: Mon, 21 Jan 2013 15:43:28 +0100 Subject: umlauts added --- app/controllers/config_snom_controller.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app') diff --git a/app/controllers/config_snom_controller.rb b/app/controllers/config_snom_controller.rb index 24f6e59..149e601 100644 --- a/app/controllers/config_snom_controller.rb +++ b/app/controllers/config_snom_controller.rb @@ -5,13 +5,13 @@ class ConfigSnomController < ApplicationController KEY_REGEXP = { '0' => "[ -.,_0]+", '1' => "[ -.,_1]+", - '2' => "[abc2]", - '3' => "[def3]", - '4' => "[ghi4]", + '2' => "[abc2\xC3\xA4]", + '3' => "[def3\xC3\xA9]", + '4' => "[ghi4\xC3\xAF]", '5' => "[jkl5]", - '6' => "[mno6]", - '7' => "[pqrs7]", - '8' => "[tuv8]", + '6' => "[mno6\xC3\xB6]", + '7' => "[pqrs7\xC3\x9F]", + '8' => "[tuv8\xC3\xBC]", '9' => "[wxyz9]", } -- cgit v1.2.3 From 18ed88c7e3c789366f6e5443dc4ee0bc981a4b88 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 20:18:16 +0100 Subject: Started the migration to Twitter Bootstrap. --- app/assets/images/amooma-logo.png | Bin 1314 -> 0 bytes app/assets/images/bg-body.png | Bin 1768 -> 0 bytes .../images/gradients/light-to-dark-blue-x63.png | Bin 187 -> 0 bytes .../images/gradients/white-gray-x29-reverse.png | Bin 123 -> 0 bytes app/assets/images/gradients/white-gray-x29.png | Bin 126 -> 0 bytes app/assets/images/gradients/white-texture-x63.png | Bin 6927 -> 0 bytes app/assets/images/icons/cellphone-32x.png | Bin 1938 -> 0 bytes app/assets/images/icons/clock-32x.png | Bin 5968 -> 0 bytes app/assets/images/icons/cross-16x.png | Bin 3350 -> 0 bytes app/assets/images/icons/facebook-32x.png | Bin 402 -> 0 bytes app/assets/images/icons/fax-32x.png | Bin 5762 -> 0 bytes .../images/icons/glyphicons-halflings-white.png | Bin 0 -> 8777 bytes app/assets/images/icons/glyphicons-halflings.png | Bin 0 -> 12799 bytes app/assets/images/icons/gs_envelope_16x.png | Bin 371 -> 0 bytes app/assets/images/icons/gs_forward_16x.png | Bin 301 -> 0 bytes app/assets/images/icons/gs_missed_16x.png | Bin 354 -> 0 bytes app/assets/images/icons/gs_placed_16x.png | Bin 397 -> 0 bytes app/assets/images/icons/gs_received_16x.png | Bin 390 -> 0 bytes app/assets/images/icons/headphones-16x.png | Bin 3285 -> 0 bytes app/assets/images/icons/headphones-32x.png | Bin 5906 -> 0 bytes app/assets/images/icons/house-32x.png | Bin 5741 -> 0 bytes app/assets/images/icons/mic-32x.png | Bin 5837 -> 0 bytes app/assets/images/icons/microphone-16x.png | Bin 3239 -> 0 bytes app/assets/images/icons/microphone-32x.png | Bin 5837 -> 0 bytes app/assets/images/icons/mute-16x.png | Bin 3349 -> 0 bytes app/assets/images/icons/phone-down-32x.png | Bin 5879 -> 0 bytes app/assets/images/icons/phone-down-green-32x.png | Bin 3426 -> 0 bytes app/assets/images/icons/phone-down-grey-32x.png | Bin 3283 -> 0 bytes app/assets/images/icons/phone-down-red-32x.png | Bin 3312 -> 0 bytes app/assets/images/icons/phone-mobile-32x.png | Bin 5509 -> 0 bytes app/assets/images/icons/phone-up-32x.png | Bin 5861 -> 0 bytes app/assets/images/icons/search-13x16.png | Bin 849 -> 0 bytes app/assets/images/icons/skype-32x.png | Bin 625 -> 0 bytes app/assets/images/icons/star-16x.png | Bin 3379 -> 0 bytes app/assets/images/icons/suitcase-32x.png | Bin 5550 -> 0 bytes app/assets/images/icons/tag-16x.png | Bin 3286 -> 0 bytes app/assets/images/icons/twitter-32x.png | Bin 397 -> 0 bytes app/assets/images/icons/unmute-16x.png | Bin 3373 -> 0 bytes app/assets/images/icons/user-16x.png | Bin 3287 -> 0 bytes app/assets/images/icons/user-female-16x.png | Bin 1680 -> 0 bytes app/assets/images/icons/user-male-16x.png | Bin 1559 -> 0 bytes app/assets/images/logo.png | Bin 7490 -> 0 bytes app/assets/images/phones/snom/Visio_snom300.png | Bin 0 -> 51018 bytes app/assets/images/phones/snom/Visio_snom320.png | Bin 0 -> 66491 bytes app/assets/images/phones/snom/Visio_snom360.png | Bin 0 -> 68592 bytes app/assets/images/phones/snom/Visio_snom370.png | Bin 0 -> 68924 bytes app/assets/images/phones/snom/Visio_snom820.png | Bin 0 -> 60875 bytes app/assets/images/phones/snom/Visio_snom821.png | Bin 0 -> 60875 bytes app/assets/images/phones/snom/Visio_snom870.png | Bin 0 -> 59457 bytes .../images/screenshots/gs5/gs5_boot_menu.png | Bin 0 -> 94638 bytes .../images/screenshots/gs5/gs5_conferences_new.png | Bin 0 -> 195085 bytes app/assets/images/screenshots/gs5/gs5_login.png | Bin 0 -> 65422 bytes .../screenshots/gs5/gs5_phone_book_entries.png | Bin 0 -> 216341 bytes .../images/screenshots/gs5/gs5_phones_new.png | Bin 0 -> 195178 bytes .../images/screenshots/gs5/gs5_setup_admin.png | Bin 0 -> 185624 bytes .../images/screenshots/gs5/gs5_tenants_new.png | Bin 0 -> 208446 bytes app/assets/images/stefan-wintermeyer-klein.jpg | Bin 0 -> 1610 bytes app/assets/images/stefan-wintermeyer.jpg | Bin 0 -> 2100110 bytes app/assets/images/stubs/user-36x.jpg | Bin 2093 -> 0 bytes app/assets/images/user.png | Bin 4800 -> 0 bytes app/assets/javascripts/api/rows.js.coffee | 3 - app/assets/javascripts/application.js | 19 +- app/assets/javascripts/bootstrap.js | 2025 +++++++ app/assets/javascripts/config_siemens.js.coffee | 3 - app/assets/javascripts/core.coffee | 5 - app/assets/javascripts/phones.js.coffee | 3 - app/assets/javascripts/softkeys.js.coffee | 25 - app/assets/javascripts/vendor/autoresize.jquery.js | 94 - .../vendor/fancybox/jquery.easing-1.3.pack.js | 205 - .../vendor/fancybox/jquery.fancybox-1.3.4.pack.js | 46 - .../fancybox/jquery.mousewheel-3.0.4.pack.js | 14 - app/assets/javascripts/vendor/html5boilerplate.js | 20 - app/assets/javascripts/vendor/jquery-1.6.2.min.js | 18 - app/assets/javascripts/vendor/jquery.condom.js | 52 - .../javascripts/vendor/jquery.easy-slider-1.7.js | 225 - .../javascripts/vendor/jquery.survival-kit.coffee | 36 - app/assets/javascripts/vendor/jquery.tmpl.js | 486 -- .../javascripts/vendor/modernizr-2.0.6.min.js | 1116 ---- app/assets/stylesheets/api/rows.css.scss | 3 - app/assets/stylesheets/app/layouts/_app.scss | 24 - .../stylesheets/app/layouts/_conference.scss | 136 - .../stylesheets/app/layouts/_phone-book-entry.scss | 176 - app/assets/stylesheets/app/pages/_phone_book.scss | 25 - app/assets/stylesheets/app/shared/_contents.scss | 374 -- app/assets/stylesheets/app/shared/_footers.scss | 90 - app/assets/stylesheets/app/shared/_handheld.scss | 25 - app/assets/stylesheets/app/shared/_headers.scss | 145 - app/assets/stylesheets/app/shared/_ie.scss | 7 - app/assets/stylesheets/app/shared/_media.scss | 16 - app/assets/stylesheets/app/shared/_print.scss | 17 - app/assets/stylesheets/application.css | 15 + app/assets/stylesheets/application.css.scss | 117 - .../stylesheets/bootstrap/bootstrap-responsive.css | 1088 ++++ app/assets/stylesheets/bootstrap/bootstrap.css.erb | 5893 ++++++++++++++++++++ .../stylesheets/gemeinschaft-generic.css.scss | 13 + app/assets/stylesheets/scaffolds.css.scss | 56 - app/assets/stylesheets/vendor/README | 1 - .../stylesheets/vendor/boilerplate-1.0/README | 15 - .../stylesheets/vendor/boilerplate-1.0/_reset.scss | 37 - .../vendor/boilerplate-1.0/_styles.scss | 171 - .../stylesheets/vendor/boilerplate-2.0/README | 16 - .../vendor/boilerplate-2.0/_styles.scss | 209 - .../stylesheets/vendor/easy-slider/_numeric.scss | 44 - .../stylesheets/vendor/facebox/_facebox.scss | 85 - app/assets/stylesheets/vendor/fancy-box/README | 4 - .../stylesheets/vendor/fancy-box/_fancy-box.scss | 336 -- app/assets/stylesheets/vendor/fancy-buttons/README | 3 - .../vendor/fancy-buttons/_fancy-buttons.scss | 189 - .../vendor/fancy-buttons/_fancy-gradient.scss | 28 - .../stylesheets/vendor/survival-kit/_blog.scss | 99 - .../stylesheets/vendor/survival-kit/_effects.scss | 97 - .../stylesheets/vendor/survival-kit/_forms.scss | 313 -- .../stylesheets/vendor/survival-kit/_headers.scss | 36 - .../stylesheets/vendor/survival-kit/_images.scss | 121 - .../stylesheets/vendor/survival-kit/_lists.scss | 37 - .../stylesheets/vendor/survival-kit/_loader.scss | 11 - .../vendor/survival-kit/_navigation.scss | 230 - .../stylesheets/vendor/survival-kit/_secure.scss | 3 - .../stylesheets/vendor/survival-kit/_tools.scss | 267 - .../access_authorizations/_index_core.html.haml | 2 +- app/views/access_authorizations/edit.html.haml | 2 +- app/views/access_authorizations/index.html.haml | 2 +- app/views/access_authorizations/new.html.haml | 2 +- app/views/access_authorizations/show.html.haml | 2 +- app/views/acd_agents/_index_core.html.haml | 2 +- app/views/acd_agents/edit.html.haml | 2 +- app/views/acd_agents/index.html.haml | 2 +- app/views/acd_agents/new.html.haml | 2 +- app/views/acd_agents/show.html.haml | 2 +- app/views/acd_callers/_index_core.html.haml | 2 +- app/views/acd_callers/index.html.haml | 2 +- app/views/acd_callers/show.html.haml | 2 +- app/views/addresses/_index_core.html.haml | 2 +- app/views/addresses/edit.html.haml | 2 +- app/views/addresses/index.html.haml | 2 +- app/views/addresses/new.html.haml | 2 +- app/views/addresses/show.html.haml | 2 +- .../_index_core.html.haml | 2 +- .../automatic_call_distributors/edit.html.haml | 2 +- .../automatic_call_distributors/index.html.haml | 2 +- .../automatic_call_distributors/new.html.haml | 2 +- .../automatic_call_distributors/show.html.haml | 4 +- app/views/call_forwards/_index_core.html.haml | 2 +- app/views/call_forwards/edit.html.haml | 2 +- app/views/call_forwards/index.html.haml | 2 +- app/views/call_forwards/new.html.haml | 2 +- app/views/call_forwards/show.html.haml | 2 +- app/views/call_histories/_index_core.html.haml | 2 +- app/views/call_histories/index.html.haml | 4 +- app/views/call_routes/_index_core.html.haml | 4 +- app/views/call_routes/edit.html.haml | 2 +- app/views/call_routes/index.html.haml | 4 +- app/views/call_routes/new.html.haml | 2 +- app/views/call_routes/show.html.haml | 2 +- app/views/calls/_index_core.html.haml | 2 +- app/views/calls/index.html.haml | 2 +- app/views/callthroughs/_index_core.html.haml | 2 +- app/views/callthroughs/edit.html.haml | 2 +- app/views/callthroughs/index.html.haml | 2 +- app/views/callthroughs/new.html.haml | 2 +- app/views/callthroughs/show.html.haml | 2 +- .../conference_invitees/_index_core.html.haml | 2 +- app/views/conference_invitees/edit.html.haml | 2 +- app/views/conference_invitees/index.html.haml | 2 +- app/views/conference_invitees/new.html.haml | 2 +- app/views/conference_invitees/show.html.haml | 2 +- app/views/conferences/_index_core.html.haml | 2 +- app/views/conferences/edit.html.haml | 2 +- app/views/conferences/index.html.haml | 2 +- app/views/conferences/new.html.haml | 2 +- app/views/conferences/show.html.haml | 2 +- app/views/config_polycom/_call_history.xml.haml | 2 +- app/views/config_polycom/_phone_book.xml.haml | 2 +- app/views/fax_accounts/_index_core.html.haml | 2 +- app/views/fax_accounts/edit.html.haml | 2 +- app/views/fax_accounts/index.html.haml | 2 +- app/views/fax_accounts/new.html.haml | 2 +- app/views/fax_accounts/show.html.haml | 2 +- app/views/fax_documents/_index_core.html.haml | 2 +- app/views/fax_documents/edit.html.haml | 2 +- app/views/fax_documents/index.html.haml | 2 +- app/views/fax_documents/new.html.haml | 2 +- app/views/fax_documents/show.html.haml | 2 +- .../_index_core.html.haml | 2 +- .../freeswitch_voicemail_msgs/index.html.haml | 2 +- app/views/gateway_parameters/_index_core.html.haml | 2 +- app/views/gateway_parameters/edit.html.haml | 2 +- app/views/gateway_parameters/index.html.haml | 2 +- app/views/gateway_parameters/new.html.haml | 2 +- app/views/gateway_parameters/show.html.haml | 2 +- app/views/gateway_settings/_index_core.html.haml | 2 +- app/views/gateway_settings/edit.html.haml | 2 +- app/views/gateway_settings/index.html.haml | 2 +- app/views/gateway_settings/new.html.haml | 2 +- app/views/gateway_settings/show.html.haml | 2 +- app/views/gateways/_index_core.html.haml | 2 +- app/views/gateways/edit.html.haml | 2 +- app/views/gateways/index.html.haml | 2 +- app/views/gateways/new.html.haml | 2 +- app/views/gateways/show.html.haml | 2 +- app/views/gemeinschaft_setups/new.de.html.haml | 3 +- app/views/gemeinschaft_setups/new.html.haml | 3 +- .../_index_core.html.haml | 2 +- .../gs_cluster_sync_log_entries/edit.html.haml | 2 +- .../gs_cluster_sync_log_entries/index.html.haml | 2 +- .../gs_cluster_sync_log_entries/new.html.haml | 2 +- .../gs_cluster_sync_log_entries/show.html.haml | 2 +- app/views/gs_nodes/_index_core.html.haml | 2 +- app/views/gs_nodes/edit.html.haml | 2 +- app/views/gs_nodes/index.html.haml | 2 +- app/views/gs_nodes/new.html.haml | 2 +- app/views/gs_nodes/show.html.haml | 2 +- app/views/gs_parameters/edit.html.haml | 2 +- app/views/gs_parameters/index.html.haml | 6 +- app/views/gs_parameters/show.html.haml | 2 +- app/views/gui_functions/_index_core.html.haml | 2 +- app/views/gui_functions/edit.html.haml | 2 +- app/views/gui_functions/index.html.haml | 2 +- app/views/gui_functions/new.html.haml | 2 +- app/views/gui_functions/show.html.haml | 2 +- app/views/hunt_group_members/_index_core.html.haml | 2 +- app/views/hunt_group_members/edit.html.haml | 2 +- app/views/hunt_group_members/index.html.haml | 2 +- app/views/hunt_group_members/new.html.haml | 2 +- app/views/hunt_group_members/show.html.haml | 2 +- app/views/hunt_groups/_index_core.html.haml | 2 +- app/views/hunt_groups/edit.html.haml | 2 +- app/views/hunt_groups/index.html.haml | 2 +- app/views/hunt_groups/new.html.haml | 2 +- app/views/hunt_groups/show.html.haml | 2 +- app/views/layouts/_footer.html.haml | 3 + app/views/layouts/_navbar.html.haml | 21 + app/views/layouts/application.html.haml | 73 +- app/views/layouts/old-application.html.haml | 48 + app/views/layouts/old_navbar.html.haml | 10 + app/views/layouts/test.haml | 0 app/views/manufacturers/_index_core.html.haml | 2 +- app/views/manufacturers/edit.html.haml | 2 +- app/views/manufacturers/index.html.haml | 2 +- app/views/manufacturers/new.html.haml | 2 +- app/views/manufacturers/show.html.haml | 2 +- app/views/page/beginners_intro.de.html.haml | 2 +- app/views/page/beginners_intro.html.haml | 2 +- app/views/page/conference.html.haml | 2 +- app/views/page/index.de.html.haml | 2 +- app/views/page/index.html.haml | 2 +- .../phone_book_entries/_index_core.de.html.haml | 2 +- app/views/phone_book_entries/_index_core.html.haml | 2 +- app/views/phone_book_entries/edit.html.haml | 2 +- app/views/phone_book_entries/index.html.haml | 2 +- app/views/phone_book_entries/new.html.haml | 2 +- app/views/phone_book_entries/show.html.haml | 2 +- .../phone_book_entries/show.html.haml.examlple | 2 +- app/views/phone_books/_index_core.html.haml | 2 +- app/views/phone_books/edit.html.haml | 2 +- app/views/phone_books/index.html.haml | 2 +- app/views/phone_books/new.html.haml | 2 +- app/views/phone_books/show.html.haml | 2 +- app/views/phone_models/_index_core.html.haml | 2 +- app/views/phone_models/edit.html.haml | 2 +- app/views/phone_models/index.html.haml | 2 +- app/views/phone_models/new.html.haml | 2 +- app/views/phone_models/show.html.haml | 2 +- .../phone_number_ranges/_index_core.html.haml | 2 +- app/views/phone_number_ranges/edit.html.haml | 2 +- app/views/phone_number_ranges/index.html.haml | 2 +- app/views/phone_number_ranges/new.html.haml | 2 +- app/views/phone_number_ranges/show.html.haml | 2 +- app/views/phone_numbers/_index_core.html.haml | 2 +- app/views/phone_numbers/edit.html.haml | 2 +- app/views/phone_numbers/index.html.haml | 2 +- app/views/phone_numbers/new.html.haml | 2 +- app/views/phone_numbers/show.html.haml | 2 +- app/views/phone_sip_accounts/_index_core.html.haml | 2 +- app/views/phone_sip_accounts/index.html.haml | 2 +- app/views/phone_sip_accounts/new.html.haml | 2 +- app/views/phone_sip_accounts/show.html.haml | 2 +- app/views/phones/_index_core.html.haml | 2 +- app/views/phones/edit.html.haml | 2 +- app/views/phones/index.html.haml | 2 +- app/views/phones/new.html.haml | 2 +- app/views/phones/show.html.haml | 2 +- app/views/ringtones/_index_core.html.haml | 2 +- app/views/ringtones/edit.html.haml | 2 +- app/views/ringtones/index.html.haml | 2 +- app/views/ringtones/new.html.haml | 2 +- app/views/ringtones/show.html.haml | 2 +- app/views/route_elements/_index_core.html.haml | 2 +- app/views/route_elements/edit.html.haml | 2 +- app/views/route_elements/index.html.haml | 2 +- app/views/route_elements/new.html.haml | 2 +- app/views/route_elements/show.html.haml | 2 +- app/views/sessions/new.html.haml | 2 +- app/views/shared/_create_link.html.haml | 13 +- app/views/shared/_flash.html.haml | 19 - .../shared/_index_view_edit_destroy_part.html.haml | 62 +- app/views/shared/_show_edit_destroy_part.html.haml | 20 +- app/views/shared/_system_message.html.haml | 10 - app/views/sip_accounts/_index_core.html.haml | 2 +- app/views/sip_accounts/edit.html.haml | 2 +- app/views/sip_accounts/index.html.haml | 2 +- app/views/sip_accounts/new.html.haml | 2 +- app/views/sip_accounts/show.html.haml | 2 +- app/views/sip_domains/_index_core.html.haml | 2 +- app/views/sip_domains/edit.html.haml | 2 +- app/views/sip_domains/index.html.haml | 2 +- app/views/sip_domains/new.html.haml | 2 +- app/views/sip_domains/show.html.haml | 2 +- app/views/softkeys/_index_core.html.haml | 2 +- app/views/softkeys/edit.html.haml | 2 +- app/views/softkeys/index.html.haml | 2 +- app/views/softkeys/new.html.haml | 2 +- app/views/softkeys/show.html.haml | 2 +- app/views/system_messages/_index_core.html.haml | 2 +- app/views/system_messages/index.html.haml | 2 +- app/views/system_messages/new.html.haml | 2 +- app/views/system_messages/show.html.haml | 2 +- app/views/tenants/_gs_parameter_table.html.haml | 8 +- app/views/tenants/_index_core.html.haml | 2 +- .../tenants/_sip_accounts_and_phones.html.haml | 8 +- app/views/tenants/_table_of_functions.html.haml | 12 +- app/views/tenants/edit.html.haml | 2 +- app/views/tenants/index.html.haml | 2 +- app/views/tenants/new.html.haml | 2 +- app/views/tenants/show.html.haml | 2 +- .../user_group_memberships/_index_core.html.haml | 2 +- app/views/user_group_memberships/edit.html.haml | 2 +- app/views/user_group_memberships/index.html.haml | 2 +- app/views/user_group_memberships/new.html.haml | 2 +- app/views/user_group_memberships/show.html.haml | 2 +- app/views/user_groups/_index_core.html.haml | 2 +- app/views/user_groups/edit.html.haml | 2 +- app/views/user_groups/index.html.haml | 2 +- app/views/user_groups/new.html.haml | 2 +- app/views/user_groups/show.html.haml | 2 +- app/views/users/_index_core.html.haml | 2 +- app/views/users/edit.html.haml | 2 +- app/views/users/index.html.haml | 2 +- app/views/users/new.html.haml | 2 +- app/views/users/show.html.haml | 8 +- app/views/voicemail_messages/_index_core.html.haml | 2 +- app/views/voicemail_messages/index.html.haml | 4 +- app/views/voicemail_settings/edit.html.haml | 2 +- app/views/voicemail_settings/show.html.haml | 2 +- app/views/whitelists/_index_core.html.haml | 2 +- app/views/whitelists/edit.html.haml | 2 +- app/views/whitelists/index.html.haml | 2 +- app/views/whitelists/new.html.haml | 2 +- app/views/whitelists/show.html.haml | 2 +- 349 files changed, 9454 insertions(+), 6274 deletions(-) delete mode 100644 app/assets/images/amooma-logo.png delete mode 100644 app/assets/images/bg-body.png delete mode 100644 app/assets/images/gradients/light-to-dark-blue-x63.png delete mode 100644 app/assets/images/gradients/white-gray-x29-reverse.png delete mode 100644 app/assets/images/gradients/white-gray-x29.png delete mode 100644 app/assets/images/gradients/white-texture-x63.png delete mode 100644 app/assets/images/icons/cellphone-32x.png delete mode 100644 app/assets/images/icons/clock-32x.png delete mode 100644 app/assets/images/icons/cross-16x.png delete mode 100644 app/assets/images/icons/facebook-32x.png delete mode 100644 app/assets/images/icons/fax-32x.png create mode 100644 app/assets/images/icons/glyphicons-halflings-white.png create mode 100644 app/assets/images/icons/glyphicons-halflings.png delete mode 100644 app/assets/images/icons/gs_envelope_16x.png delete mode 100644 app/assets/images/icons/gs_forward_16x.png delete mode 100644 app/assets/images/icons/gs_missed_16x.png delete mode 100644 app/assets/images/icons/gs_placed_16x.png delete mode 100644 app/assets/images/icons/gs_received_16x.png delete mode 100644 app/assets/images/icons/headphones-16x.png delete mode 100644 app/assets/images/icons/headphones-32x.png delete mode 100644 app/assets/images/icons/house-32x.png delete mode 100644 app/assets/images/icons/mic-32x.png delete mode 100644 app/assets/images/icons/microphone-16x.png delete mode 100644 app/assets/images/icons/microphone-32x.png delete mode 100644 app/assets/images/icons/mute-16x.png delete mode 100644 app/assets/images/icons/phone-down-32x.png delete mode 100644 app/assets/images/icons/phone-down-green-32x.png delete mode 100644 app/assets/images/icons/phone-down-grey-32x.png delete mode 100644 app/assets/images/icons/phone-down-red-32x.png delete mode 100644 app/assets/images/icons/phone-mobile-32x.png delete mode 100644 app/assets/images/icons/phone-up-32x.png delete mode 100644 app/assets/images/icons/search-13x16.png delete mode 100644 app/assets/images/icons/skype-32x.png delete mode 100644 app/assets/images/icons/star-16x.png delete mode 100644 app/assets/images/icons/suitcase-32x.png delete mode 100644 app/assets/images/icons/tag-16x.png delete mode 100644 app/assets/images/icons/twitter-32x.png delete mode 100644 app/assets/images/icons/unmute-16x.png delete mode 100644 app/assets/images/icons/user-16x.png delete mode 100644 app/assets/images/icons/user-female-16x.png delete mode 100644 app/assets/images/icons/user-male-16x.png delete mode 100644 app/assets/images/logo.png create mode 100644 app/assets/images/phones/snom/Visio_snom300.png create mode 100644 app/assets/images/phones/snom/Visio_snom320.png create mode 100644 app/assets/images/phones/snom/Visio_snom360.png create mode 100644 app/assets/images/phones/snom/Visio_snom370.png create mode 100644 app/assets/images/phones/snom/Visio_snom820.png create mode 100644 app/assets/images/phones/snom/Visio_snom821.png create mode 100644 app/assets/images/phones/snom/Visio_snom870.png create mode 100644 app/assets/images/screenshots/gs5/gs5_boot_menu.png create mode 100644 app/assets/images/screenshots/gs5/gs5_conferences_new.png create mode 100644 app/assets/images/screenshots/gs5/gs5_login.png create mode 100644 app/assets/images/screenshots/gs5/gs5_phone_book_entries.png create mode 100644 app/assets/images/screenshots/gs5/gs5_phones_new.png create mode 100644 app/assets/images/screenshots/gs5/gs5_setup_admin.png create mode 100644 app/assets/images/screenshots/gs5/gs5_tenants_new.png create mode 100644 app/assets/images/stefan-wintermeyer-klein.jpg create mode 100644 app/assets/images/stefan-wintermeyer.jpg delete mode 100644 app/assets/images/stubs/user-36x.jpg delete mode 100644 app/assets/images/user.png delete mode 100644 app/assets/javascripts/api/rows.js.coffee create mode 100644 app/assets/javascripts/bootstrap.js delete mode 100644 app/assets/javascripts/config_siemens.js.coffee delete mode 100644 app/assets/javascripts/core.coffee delete mode 100644 app/assets/javascripts/phones.js.coffee delete mode 100644 app/assets/javascripts/softkeys.js.coffee delete mode 100644 app/assets/javascripts/vendor/autoresize.jquery.js delete mode 100755 app/assets/javascripts/vendor/fancybox/jquery.easing-1.3.pack.js delete mode 100755 app/assets/javascripts/vendor/fancybox/jquery.fancybox-1.3.4.pack.js delete mode 100755 app/assets/javascripts/vendor/fancybox/jquery.mousewheel-3.0.4.pack.js delete mode 100644 app/assets/javascripts/vendor/html5boilerplate.js delete mode 100755 app/assets/javascripts/vendor/jquery-1.6.2.min.js delete mode 100644 app/assets/javascripts/vendor/jquery.condom.js delete mode 100644 app/assets/javascripts/vendor/jquery.easy-slider-1.7.js delete mode 100644 app/assets/javascripts/vendor/jquery.survival-kit.coffee delete mode 100644 app/assets/javascripts/vendor/jquery.tmpl.js delete mode 100755 app/assets/javascripts/vendor/modernizr-2.0.6.min.js delete mode 100644 app/assets/stylesheets/api/rows.css.scss delete mode 100644 app/assets/stylesheets/app/layouts/_app.scss delete mode 100644 app/assets/stylesheets/app/layouts/_conference.scss delete mode 100644 app/assets/stylesheets/app/layouts/_phone-book-entry.scss delete mode 100644 app/assets/stylesheets/app/pages/_phone_book.scss delete mode 100644 app/assets/stylesheets/app/shared/_contents.scss delete mode 100644 app/assets/stylesheets/app/shared/_footers.scss delete mode 100644 app/assets/stylesheets/app/shared/_handheld.scss delete mode 100644 app/assets/stylesheets/app/shared/_headers.scss delete mode 100644 app/assets/stylesheets/app/shared/_ie.scss delete mode 100644 app/assets/stylesheets/app/shared/_media.scss delete mode 100644 app/assets/stylesheets/app/shared/_print.scss create mode 100644 app/assets/stylesheets/application.css delete mode 100644 app/assets/stylesheets/application.css.scss create mode 100644 app/assets/stylesheets/bootstrap/bootstrap-responsive.css create mode 100644 app/assets/stylesheets/bootstrap/bootstrap.css.erb create mode 100644 app/assets/stylesheets/gemeinschaft-generic.css.scss delete mode 100644 app/assets/stylesheets/scaffolds.css.scss delete mode 100644 app/assets/stylesheets/vendor/README delete mode 100644 app/assets/stylesheets/vendor/boilerplate-1.0/README delete mode 100644 app/assets/stylesheets/vendor/boilerplate-1.0/_reset.scss delete mode 100644 app/assets/stylesheets/vendor/boilerplate-1.0/_styles.scss delete mode 100644 app/assets/stylesheets/vendor/boilerplate-2.0/README delete mode 100644 app/assets/stylesheets/vendor/boilerplate-2.0/_styles.scss delete mode 100644 app/assets/stylesheets/vendor/easy-slider/_numeric.scss delete mode 100644 app/assets/stylesheets/vendor/facebox/_facebox.scss delete mode 100644 app/assets/stylesheets/vendor/fancy-box/README delete mode 100755 app/assets/stylesheets/vendor/fancy-box/_fancy-box.scss delete mode 100644 app/assets/stylesheets/vendor/fancy-buttons/README delete mode 100644 app/assets/stylesheets/vendor/fancy-buttons/_fancy-buttons.scss delete mode 100644 app/assets/stylesheets/vendor/fancy-buttons/_fancy-gradient.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_blog.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_effects.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_forms.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_headers.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_images.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_lists.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_loader.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_navigation.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_secure.scss delete mode 100644 app/assets/stylesheets/vendor/survival-kit/_tools.scss create mode 100644 app/views/layouts/_footer.html.haml create mode 100644 app/views/layouts/_navbar.html.haml create mode 100644 app/views/layouts/old-application.html.haml create mode 100644 app/views/layouts/old_navbar.html.haml create mode 100644 app/views/layouts/test.haml delete mode 100644 app/views/shared/_flash.html.haml delete mode 100644 app/views/shared/_system_message.html.haml (limited to 'app') diff --git a/app/assets/images/amooma-logo.png b/app/assets/images/amooma-logo.png deleted file mode 100644 index 11096ff..0000000 Binary files a/app/assets/images/amooma-logo.png and /dev/null differ diff --git a/app/assets/images/bg-body.png b/app/assets/images/bg-body.png deleted file mode 100644 index 777eff6..0000000 Binary files a/app/assets/images/bg-body.png and /dev/null differ diff --git a/app/assets/images/gradients/light-to-dark-blue-x63.png b/app/assets/images/gradients/light-to-dark-blue-x63.png deleted file mode 100644 index 7eb020f..0000000 Binary files a/app/assets/images/gradients/light-to-dark-blue-x63.png and /dev/null differ diff --git a/app/assets/images/gradients/white-gray-x29-reverse.png b/app/assets/images/gradients/white-gray-x29-reverse.png deleted file mode 100644 index 7b7e879..0000000 Binary files a/app/assets/images/gradients/white-gray-x29-reverse.png and /dev/null differ diff --git a/app/assets/images/gradients/white-gray-x29.png b/app/assets/images/gradients/white-gray-x29.png deleted file mode 100644 index a1671d0..0000000 Binary files a/app/assets/images/gradients/white-gray-x29.png and /dev/null differ diff --git a/app/assets/images/gradients/white-texture-x63.png b/app/assets/images/gradients/white-texture-x63.png deleted file mode 100644 index 1576e8f..0000000 Binary files a/app/assets/images/gradients/white-texture-x63.png and /dev/null differ diff --git a/app/assets/images/icons/cellphone-32x.png b/app/assets/images/icons/cellphone-32x.png deleted file mode 100644 index cfc41f5..0000000 Binary files a/app/assets/images/icons/cellphone-32x.png and /dev/null differ diff --git a/app/assets/images/icons/clock-32x.png b/app/assets/images/icons/clock-32x.png deleted file mode 100644 index c076042..0000000 Binary files a/app/assets/images/icons/clock-32x.png and /dev/null differ diff --git a/app/assets/images/icons/cross-16x.png b/app/assets/images/icons/cross-16x.png deleted file mode 100644 index e22ed6f..0000000 Binary files a/app/assets/images/icons/cross-16x.png and /dev/null differ diff --git a/app/assets/images/icons/facebook-32x.png b/app/assets/images/icons/facebook-32x.png deleted file mode 100644 index 08fa0f7..0000000 Binary files a/app/assets/images/icons/facebook-32x.png and /dev/null differ diff --git a/app/assets/images/icons/fax-32x.png b/app/assets/images/icons/fax-32x.png deleted file mode 100644 index b05ee59..0000000 Binary files a/app/assets/images/icons/fax-32x.png and /dev/null differ diff --git a/app/assets/images/icons/glyphicons-halflings-white.png b/app/assets/images/icons/glyphicons-halflings-white.png new file mode 100644 index 0000000..3bf6484 Binary files /dev/null and b/app/assets/images/icons/glyphicons-halflings-white.png differ diff --git a/app/assets/images/icons/glyphicons-halflings.png b/app/assets/images/icons/glyphicons-halflings.png new file mode 100644 index 0000000..a996999 Binary files /dev/null and b/app/assets/images/icons/glyphicons-halflings.png differ diff --git a/app/assets/images/icons/gs_envelope_16x.png b/app/assets/images/icons/gs_envelope_16x.png deleted file mode 100644 index 6a82ade..0000000 Binary files a/app/assets/images/icons/gs_envelope_16x.png and /dev/null differ diff --git a/app/assets/images/icons/gs_forward_16x.png b/app/assets/images/icons/gs_forward_16x.png deleted file mode 100644 index 13c57eb..0000000 Binary files a/app/assets/images/icons/gs_forward_16x.png and /dev/null differ diff --git a/app/assets/images/icons/gs_missed_16x.png b/app/assets/images/icons/gs_missed_16x.png deleted file mode 100644 index 0b3b706..0000000 Binary files a/app/assets/images/icons/gs_missed_16x.png and /dev/null differ diff --git a/app/assets/images/icons/gs_placed_16x.png b/app/assets/images/icons/gs_placed_16x.png deleted file mode 100644 index b5065e9..0000000 Binary files a/app/assets/images/icons/gs_placed_16x.png and /dev/null differ diff --git a/app/assets/images/icons/gs_received_16x.png b/app/assets/images/icons/gs_received_16x.png deleted file mode 100644 index cd40c1a..0000000 Binary files a/app/assets/images/icons/gs_received_16x.png and /dev/null differ diff --git a/app/assets/images/icons/headphones-16x.png b/app/assets/images/icons/headphones-16x.png deleted file mode 100644 index dee8346..0000000 Binary files a/app/assets/images/icons/headphones-16x.png and /dev/null differ diff --git a/app/assets/images/icons/headphones-32x.png b/app/assets/images/icons/headphones-32x.png deleted file mode 100644 index 89a5df7..0000000 Binary files a/app/assets/images/icons/headphones-32x.png and /dev/null differ diff --git a/app/assets/images/icons/house-32x.png b/app/assets/images/icons/house-32x.png deleted file mode 100644 index b112915..0000000 Binary files a/app/assets/images/icons/house-32x.png and /dev/null differ diff --git a/app/assets/images/icons/mic-32x.png b/app/assets/images/icons/mic-32x.png deleted file mode 100644 index 30c4531..0000000 Binary files a/app/assets/images/icons/mic-32x.png and /dev/null differ diff --git a/app/assets/images/icons/microphone-16x.png b/app/assets/images/icons/microphone-16x.png deleted file mode 100644 index b62422d..0000000 Binary files a/app/assets/images/icons/microphone-16x.png and /dev/null differ diff --git a/app/assets/images/icons/microphone-32x.png b/app/assets/images/icons/microphone-32x.png deleted file mode 100644 index 30c4531..0000000 Binary files a/app/assets/images/icons/microphone-32x.png and /dev/null differ diff --git a/app/assets/images/icons/mute-16x.png b/app/assets/images/icons/mute-16x.png deleted file mode 100644 index 0656f3f..0000000 Binary files a/app/assets/images/icons/mute-16x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-down-32x.png b/app/assets/images/icons/phone-down-32x.png deleted file mode 100644 index 38c3560..0000000 Binary files a/app/assets/images/icons/phone-down-32x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-down-green-32x.png b/app/assets/images/icons/phone-down-green-32x.png deleted file mode 100644 index 9f21d45..0000000 Binary files a/app/assets/images/icons/phone-down-green-32x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-down-grey-32x.png b/app/assets/images/icons/phone-down-grey-32x.png deleted file mode 100644 index 2b604ce..0000000 Binary files a/app/assets/images/icons/phone-down-grey-32x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-down-red-32x.png b/app/assets/images/icons/phone-down-red-32x.png deleted file mode 100644 index f4cbde7..0000000 Binary files a/app/assets/images/icons/phone-down-red-32x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-mobile-32x.png b/app/assets/images/icons/phone-mobile-32x.png deleted file mode 100644 index b373e1a..0000000 Binary files a/app/assets/images/icons/phone-mobile-32x.png and /dev/null differ diff --git a/app/assets/images/icons/phone-up-32x.png b/app/assets/images/icons/phone-up-32x.png deleted file mode 100644 index 9b765c7..0000000 Binary files a/app/assets/images/icons/phone-up-32x.png and /dev/null differ diff --git a/app/assets/images/icons/search-13x16.png b/app/assets/images/icons/search-13x16.png deleted file mode 100644 index 16aa3c6..0000000 Binary files a/app/assets/images/icons/search-13x16.png and /dev/null differ diff --git a/app/assets/images/icons/skype-32x.png b/app/assets/images/icons/skype-32x.png deleted file mode 100644 index c3b0978..0000000 Binary files a/app/assets/images/icons/skype-32x.png and /dev/null differ diff --git a/app/assets/images/icons/star-16x.png b/app/assets/images/icons/star-16x.png deleted file mode 100644 index 6b16932..0000000 Binary files a/app/assets/images/icons/star-16x.png and /dev/null differ diff --git a/app/assets/images/icons/suitcase-32x.png b/app/assets/images/icons/suitcase-32x.png deleted file mode 100644 index f53daa9..0000000 Binary files a/app/assets/images/icons/suitcase-32x.png and /dev/null differ diff --git a/app/assets/images/icons/tag-16x.png b/app/assets/images/icons/tag-16x.png deleted file mode 100644 index b4522d7..0000000 Binary files a/app/assets/images/icons/tag-16x.png and /dev/null differ diff --git a/app/assets/images/icons/twitter-32x.png b/app/assets/images/icons/twitter-32x.png deleted file mode 100644 index 51351a7..0000000 Binary files a/app/assets/images/icons/twitter-32x.png and /dev/null differ diff --git a/app/assets/images/icons/unmute-16x.png b/app/assets/images/icons/unmute-16x.png deleted file mode 100644 index e9dfde0..0000000 Binary files a/app/assets/images/icons/unmute-16x.png and /dev/null differ diff --git a/app/assets/images/icons/user-16x.png b/app/assets/images/icons/user-16x.png deleted file mode 100644 index 909403a..0000000 Binary files a/app/assets/images/icons/user-16x.png and /dev/null differ diff --git a/app/assets/images/icons/user-female-16x.png b/app/assets/images/icons/user-female-16x.png deleted file mode 100644 index 38dde34..0000000 Binary files a/app/assets/images/icons/user-female-16x.png and /dev/null differ diff --git a/app/assets/images/icons/user-male-16x.png b/app/assets/images/icons/user-male-16x.png deleted file mode 100644 index e03fd0f..0000000 Binary files a/app/assets/images/icons/user-male-16x.png and /dev/null differ diff --git a/app/assets/images/logo.png b/app/assets/images/logo.png deleted file mode 100644 index e4432b8..0000000 Binary files a/app/assets/images/logo.png and /dev/null differ diff --git a/app/assets/images/phones/snom/Visio_snom300.png b/app/assets/images/phones/snom/Visio_snom300.png new file mode 100644 index 0000000..42e7a87 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom300.png differ diff --git a/app/assets/images/phones/snom/Visio_snom320.png b/app/assets/images/phones/snom/Visio_snom320.png new file mode 100644 index 0000000..9e91a57 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom320.png differ diff --git a/app/assets/images/phones/snom/Visio_snom360.png b/app/assets/images/phones/snom/Visio_snom360.png new file mode 100644 index 0000000..aeb9115 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom360.png differ diff --git a/app/assets/images/phones/snom/Visio_snom370.png b/app/assets/images/phones/snom/Visio_snom370.png new file mode 100644 index 0000000..e900b34 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom370.png differ diff --git a/app/assets/images/phones/snom/Visio_snom820.png b/app/assets/images/phones/snom/Visio_snom820.png new file mode 100644 index 0000000..3ec75c7 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom820.png differ diff --git a/app/assets/images/phones/snom/Visio_snom821.png b/app/assets/images/phones/snom/Visio_snom821.png new file mode 100644 index 0000000..3ec75c7 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom821.png differ diff --git a/app/assets/images/phones/snom/Visio_snom870.png b/app/assets/images/phones/snom/Visio_snom870.png new file mode 100644 index 0000000..1550591 Binary files /dev/null and b/app/assets/images/phones/snom/Visio_snom870.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_boot_menu.png b/app/assets/images/screenshots/gs5/gs5_boot_menu.png new file mode 100644 index 0000000..0502d3a Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_boot_menu.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_conferences_new.png b/app/assets/images/screenshots/gs5/gs5_conferences_new.png new file mode 100644 index 0000000..e0369af Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_conferences_new.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_login.png b/app/assets/images/screenshots/gs5/gs5_login.png new file mode 100644 index 0000000..97d6bbe Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_login.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_phone_book_entries.png b/app/assets/images/screenshots/gs5/gs5_phone_book_entries.png new file mode 100644 index 0000000..9a4be07 Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_phone_book_entries.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_phones_new.png b/app/assets/images/screenshots/gs5/gs5_phones_new.png new file mode 100644 index 0000000..d9024e6 Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_phones_new.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_setup_admin.png b/app/assets/images/screenshots/gs5/gs5_setup_admin.png new file mode 100644 index 0000000..f97ff8f Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_setup_admin.png differ diff --git a/app/assets/images/screenshots/gs5/gs5_tenants_new.png b/app/assets/images/screenshots/gs5/gs5_tenants_new.png new file mode 100644 index 0000000..0f6a6e2 Binary files /dev/null and b/app/assets/images/screenshots/gs5/gs5_tenants_new.png differ diff --git a/app/assets/images/stefan-wintermeyer-klein.jpg b/app/assets/images/stefan-wintermeyer-klein.jpg new file mode 100644 index 0000000..3b62099 Binary files /dev/null and b/app/assets/images/stefan-wintermeyer-klein.jpg differ diff --git a/app/assets/images/stefan-wintermeyer.jpg b/app/assets/images/stefan-wintermeyer.jpg new file mode 100644 index 0000000..4fdeb30 Binary files /dev/null and b/app/assets/images/stefan-wintermeyer.jpg differ diff --git a/app/assets/images/stubs/user-36x.jpg b/app/assets/images/stubs/user-36x.jpg deleted file mode 100644 index 8a391a0..0000000 Binary files a/app/assets/images/stubs/user-36x.jpg and /dev/null differ diff --git a/app/assets/images/user.png b/app/assets/images/user.png deleted file mode 100644 index c0e33c7..0000000 Binary files a/app/assets/images/user.png and /dev/null differ diff --git a/app/assets/javascripts/api/rows.js.coffee b/app/assets/javascripts/api/rows.js.coffee deleted file mode 100644 index 7615679..0000000 --- a/app/assets/javascripts/api/rows.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 1762043..9097d83 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,14 +1,15 @@ -// This is a manifest file that'll be compiled into including all the files listed below. -// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically -// be included in the compiled file accessible from http://example.com/assets/application.js +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // the compiled file. // +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// //= require jquery //= require jquery_ujs -//= require core -//= require vendor/modernizr-2.0.6.min.js -//= require vendor/jquery.condom.js -//= require vendor/jquery.survival-kit -//= require phones -//= require softkeys +//= require_tree . diff --git a/app/assets/javascripts/bootstrap.js b/app/assets/javascripts/bootstrap.js new file mode 100644 index 0000000..c753bd6 --- /dev/null +++ b/app/assets/javascripts/bootstrap.js @@ -0,0 +1,2025 @@ +/* =================================================== + * bootstrap-transition.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#transitions + * =================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-alert.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#alerts + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(window.jQuery);/* ============================================================ + * bootstrap-button.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#buttons + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(window.jQuery);/* ========================================================== + * bootstrap-carousel.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#carousel + * ========================================================== + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.options = options + this.options.slide && this.slide(this.options.slide) + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , to: function (pos) { + var $active = this.$element.find('.item.active') + , children = $active.parent().children() + , activePos = children.index($active) + , that = this + + if (pos > (children.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activePos == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activePos ? 'next' : 'prev', $(children[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle() + } + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + }) + + if ($next.hasClass('active')) return + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + $target.carousel(options) + e.preventDefault() + }) + +}(window.jQuery);/* ============================================================= + * bootstrap-collapse.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#collapse + * ============================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSIBLE PLUGIN DEFINITION + * ============================== */ + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = typeof option == 'object' && option + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSIBLE DATA-API + * ==================== */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(window.jQuery);/* ============================================================ + * bootstrap-dropdown.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#dropdowns + * ============================================================ + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + $parent.toggleClass('open') + $this.focus() + } + + return false + } + + , keydown: function (e) { + var $this + , $items + , $active + , $parent + , isActive + , index + + if (!/(38|40|27)/.test(e.keyCode)) return + + $this = $(this) + + e.preventDefault() + e.stopPropagation() + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + if (!isActive || (isActive && e.keyCode == 27)) return $this.click() + + $items = $('[role=menu] li:not(.divider) a', $parent) + + if (!$items.length) return + + index = $items.index($items.filter(':focus')) + + if (e.keyCode == 38 && index > 0) index-- // up + if (e.keyCode == 40 && index < $items.length - 1) index++ // down + if (!~index) index = 0 + + $items + .eq(index) + .focus() + } + + } + + function clearMenus() { + $(toggle).each(function () { + getParent($(this)).removeClass('open') + }) + } + + function getParent($this) { + var selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + $parent.length || ($parent = $this.parent()) + + return $parent + } + + + /* DROPDOWN PLUGIN DEFINITION + * ========================== */ + + $.fn.dropdown = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('dropdown') + if (!data) $this.data('dropdown', (data = new Dropdown(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.dropdown.Constructor = Dropdown + + + /* APPLY TO STANDARD DROPDOWN ELEMENTS + * =================================== */ + + $(document) + .on('click.dropdown.data-api touchstart.dropdown.data-api', clearMenus) + .on('click.dropdown touchstart.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) + .on('click.dropdown.data-api touchstart.dropdown.data-api' , toggle, Dropdown.prototype.toggle) + .on('keydown.dropdown.data-api touchstart.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) + +}(window.jQuery);/* ========================================================= + * bootstrap-modal.js v2.2.1 + * http://twitter.github.com/bootstrap/javascript.html#modals + * ========================================================= + * Copyright 2012 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================= */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* MODAL CLASS DEFINITION + * ====================== */ + + var Modal = function (element, options) { + this.options = options + this.$element = $(element) + .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) + this.options.remote && this.$element.find('.modal-body').load(this.options.remote) + } + + Modal.prototype = { + + constructor: Modal + + , toggle: function () { + return this[!this.isShown ? 'show' : 'hide']() + } + + , show: function () { + var that = this + , e = $.Event('show') + + this.$element.trigger(e) + + if (this.isShown || e.isDefaultPrevented()) return + + this.isShown = true + + this.escape() + + this.backdrop(function () { + var transition = $.support.transition && that.$element.hasClass('fade') + + if (!that.$element.parent().length) { + that.$element.appendTo(document.body) //don't move modals dom position + } + + that.$element + .show() + + if (transition) { + that.$element[0].offsetWidth // force reflow + } + + that.$element + .addClass('in') + .attr('aria-hidden', false) + + that.enforceFocus() + + transition ? + that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : + that.$element.focus().trigger('shown') + + }) + } + + , hide: function (e) { + e && e.preventDefault() + + var that = this + + e = $.Event('hide') + + this.$element.trigger(e) + + if (!this.isShown || e.isDefaultPrevented()) return + + this.isShown = false + + this.escape() + + $(document).off('focusin.modal') + + this.$element + .removeClass('in') + .attr('aria-hidden', true) + + $.support.transition && this.$element.hasClass('fade') ? + this.hideWithTransition() : + this.hideModal() + } + + , enforceFocus: function () { + var that = this + $(document).on('focusin.modal', function (e) { + if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { + that.$element.focus() + } + }) + } + + , escape: function () { + var that = this + if (this.isShown && this.options.keyboard) { + this.$element.on('keyup.dismiss.modal', function ( e ) { + e.which == 27 && that.hide() + }) + } else if (!this.isShown) { + this.$element.off('keyup.dismiss.modal') + } + } + + , hideWithTransition: function () { + var that = this + , timeout = setTimeout(function () { + that.$element.off($.support.transition.end) + that.hideModal() + }, 500) + + this.$element.one($.support.transition.end, function () { + clearTimeout(timeout) + that.hideModal() + }) + } + + , hideModal: function (that) { + this.$element + .hide() + .trigger('hidden') + + this.backdrop() + } + + , removeBackdrop: function () { + this.$backdrop.remove() + this.$backdrop = null + } + + , backdrop: function (callback) { + var that = this + , animate = this.$element.hasClass('fade') ? 'fade' : '' + + if (this.isShown && this.options.backdrop) { + var doAnimate = $.support.transition && animate + + this.$backdrop = $('