diff options
-rw-r--r-- | app/controllers/page_controller.rb | 1 | ||||
-rw-r--r-- | app/controllers/tenants_controller.rb | 21 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 20 | ||||
-rw-r--r-- | app/views/page/beginners_intro.de.html.haml | 33 | ||||
-rw-r--r-- | app/views/page/beginners_intro.html.haml | 33 | ||||
-rw-r--r-- | config/routes.rb | 1 |
6 files changed, 105 insertions, 4 deletions
diff --git a/app/controllers/page_controller.rb b/app/controllers/page_controller.rb index 1f37449..4ea4d25 100644 --- a/app/controllers/page_controller.rb +++ b/app/controllers/page_controller.rb @@ -7,6 +7,7 @@ class PageController < ApplicationController def index;end def conference;end + def beginners_intro;end private def if_fresh_system_then_go_to_wizard diff --git a/app/controllers/tenants_controller.rb b/app/controllers/tenants_controller.rb index 724d179..7bb8ecd 100644 --- a/app/controllers/tenants_controller.rb +++ b/app/controllers/tenants_controller.rb @@ -58,14 +58,27 @@ class TenantsController < ApplicationController end if Delayed::Job.count > 0 - redirect_to @tenant, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs', + if SipAccount.any? || Phone.any? + redirect_to @tenant, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs', :resource => @tenant, :amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count ) - else - redirect_to @tenant, :notice => t('tenants.controller.successfuly_created', - :resource => @tenant + else + redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created_plus_delayed_jobs', + :resource => @tenant, + :amount_of_numbers => @tenant.array_of_internal_extension_numbers.count + @tenant.array_of_dids.count ) + end + else + if SipAccount.any? || Phone.any? + redirect_to @tenant, :notice => t('tenants.controller.successfuly_created', + :resource => @tenant + ) + else + redirect_to page_beginners_intro_path, :notice => t('tenants.controller.successfuly_created', + :resource => @tenant + ) + end end else render :new diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index de6be79..de4d677 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,2 +1,22 @@ module ApplicationHelper + + # nicely_joined_with_commata(['1', '2', '3', '4']) + # = '1, 2, 3 und 4' + # + def nicely_joined_with_commata(array_of_things) + if array_of_things.count == 1 + array_of_things.first.to_s + else + if array_of_things.count > 1 + output = array_of_things[0, array_of_things.count - 1].map{|item| item.to_s}.join(', ') + if I18n.locale == :de + output += ' und ' + else + output += ' and ' + end + output += array_of_things.last.to_s + end + end + end + end diff --git a/app/views/page/beginners_intro.de.html.haml b/app/views/page/beginners_intro.de.html.haml new file mode 100644 index 0000000..8d129db --- /dev/null +++ b/app/views/page/beginners_intro.de.html.haml @@ -0,0 +1,33 @@ +- title "Erste Schritte mit Gemeinschaft #{GEMEINSCHAFT_VERSION}!" + +%p + Sie müssen als erstes mindestens zwei neue SIP-Accounts anlegen. Dabei haben Sie die Wahl zwischen folgenden Varianten: + +%ul + %li + %strong + Personalisierter SIP-Accounts + %br + Dieser wird einer bestimmten Person zugeordnet. In einer normalen Gemeinschaft-Installation sind die meisten SIP-Accounts personalisiert. + %br + =link_to "SIP-Account für #{current_user} anlegen.", new_user_sip_account_path(current_user) + %li + %strong + Firmen SIP-Accounts + %br + Es gibt bestimmte SIP-Account, die keiner bestimmten Person zugeordnet werden können (z.B. für Telefone in einem Konferenzraum). Dafür gibt es Firmen SIP-Accounts. + %br + =link_to "SIP-Account für #{current_user.current_tenant} anlegen.", new_tenant_sip_account_path(current_user.current_tenant) + +%h2 Rufnummern + +%p + Mit denen von Ihnen angelegten SIP-Accounts können Sie schon intern telefonieren. Dazu müssen Sie den SIP-Accounts jeweils eine interne Telefonnummer zuweisen (z.B. 20 und 21) und ein SIP Soft- oder Hardphone mit den Account-Daten konfigurieren. + +%h2 Telefone + +%p + Komfortabler ist der Betrieb von im Provisioning unterstützen Telefone. Diese können Sie beim Anlegen direkt mit einem bestimmten SIP-Account verknüpfen. Danach müssen Sie nur noch die Provisioningdaten per Hand ins Telefon eintragen oder ein paar Einstellungen in Ihrem DHCP-Server vornehmen. Hilfe dazu finden Sie im #{link_to 'Wiki', 'https://github.com/amooma/GS5/wiki'} und der #{link_to 'Mailingliste', 'https://groups.google.com/group/gs5-users/'}. +%p + Folgende Telefone werden in der Version #{GEMEINSCHAFT_VERSION} vom automatischen Provisioning unterstützt: + = nicely_joined_with_commata(PhoneModel.order(:name).map{|phone_model| "#{phone_model.to_s}"})
\ No newline at end of file diff --git a/app/views/page/beginners_intro.html.haml b/app/views/page/beginners_intro.html.haml new file mode 100644 index 0000000..6227142 --- /dev/null +++ b/app/views/page/beginners_intro.html.haml @@ -0,0 +1,33 @@ +- title "First steps with Gemeinschaft #{GEMEINSCHAFT_VERSION}!" + +%p + You have to create at least two new SIP accounts. You have the choice of two different versions: + +%ul + %li + %strong + Personalized SIP accounts + %br + They are linked to a user. In a normal Gemeinschaft installation the majority of accounts are personlized. + %br + =link_to "Create a SIP account for #{current_user}.", new_user_sip_account_path(current_user) + %li + %strong + Company SIP accounts + %br + These are for phones which are not linked to a specific person (e.g. phones in conference rooms). + %br + =link_to "Create a SIP account for #{current_user.current_tenant}.", new_tenant_sip_account_path(current_user.current_tenant) + +%h2 Phone numbers + +%p + You can use your SIP accounts to make internal calls. But before that you have to add phone numbers to each SIP account (e.g. 20 and 21). After you did that you can configure any SIP phone with the SIP account configuration and start using your new PBX. + +%h2 Phones + +%p + More comfortable is the use of auto provisioned phones. They can be linked to SIP accounts. After creating them in the WebGUI you have to set the Provisioning URL in the phone or setup your DHCP server to give them this data. You'll find help in our #{link_to 'Wiki', 'https://github.com/amooma/GS5/wiki'} or in our #{link_to 'mailinglist', 'https://groups.google.com/group/gs5-users/'}. +%p + In version #{GEMEINSCHAFT_VERSION} the following phones can be used for provisioning: + = nicely_joined_with_commata(PhoneModel.order(:name).map{|phone_model| "#{phone_model.to_s}"})
\ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 64d64cf..33238dc 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -199,6 +199,7 @@ Gemeinschaft42c::Application.routes.draw do get "page/index" get "page/conference" + get "page/beginners_intro" root :to => "page#index" |