diff options
author | Peter Kozak <spag@golwen.net> | 2013-02-12 13:07:17 +0000 |
---|---|---|
committer | Peter Kozak <spag@golwen.net> | 2013-02-12 13:07:17 +0000 |
commit | 1abd4544ad482079765be838dd6819e9997af9ac (patch) | |
tree | 6aa9c0f6e9ba2ee03e509a9858dc43cbafb25db6 | |
parent | 902447a1baf7e9d8385c269a601361c8c3f2f14b (diff) | |
parent | fb66a5e5a4c5d5f9eac4a5e8de6a286482cb55d5 (diff) |
Merge branch 'develop' of github.com:amooma/GS5 into develop
-rw-r--r-- | app/assets/javascripts/route_element.js.coffee | 6 | ||||
-rw-r--r-- | app/assets/stylesheets/application.css | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/route_elements.css.scss | 5 | ||||
-rw-r--r-- | app/controllers/route_elements_controller.rb | 14 | ||||
-rw-r--r-- | app/models/call_route.rb | 2 | ||||
-rw-r--r-- | app/views/call_routes/show.html.haml | 49 | ||||
-rw-r--r-- | app/views/phones/_form_core.html.haml | 2 | ||||
-rw-r--r-- | app/views/phones/show.html.haml | 2 | ||||
-rw-r--r-- | app/views/route_elements/_form_core.html.haml | 1 | ||||
-rw-r--r-- | app/views/route_elements/_index_core.html.haml | 50 | ||||
-rw-r--r-- | app/views/route_elements/show.html.haml | 54 | ||||
-rw-r--r-- | config/locales/views/call_routes/de.yml | 24 | ||||
-rw-r--r-- | config/locales/views/phones/de.yml | 6 | ||||
-rw-r--r-- | config/locales/views/route_elements/de.yml | 20 | ||||
-rw-r--r-- | config/locales/views/sip_accounts/de.yml | 4 | ||||
-rw-r--r-- | config/routes.rb | 4 | ||||
-rw-r--r-- | db/schema.rb | 48 |
17 files changed, 177 insertions, 115 deletions
diff --git a/app/assets/javascripts/route_element.js.coffee b/app/assets/javascripts/route_element.js.coffee new file mode 100644 index 0000000..75dc553 --- /dev/null +++ b/app/assets/javascripts/route_element.js.coffee @@ -0,0 +1,6 @@ +jQuery -> + $('#route_elements').sortable + axis: 'y' + handle: '.handle' + update: -> + $.post($(this).data('update-url'), $(this).sortable('serialize'))
\ No newline at end of file diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index 3e1cc66..44868e4 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -15,4 +15,5 @@ *= require call_routes *= require softkeys *= require phone_numbers + *= require route_elements */ diff --git a/app/assets/stylesheets/route_elements.css.scss b/app/assets/stylesheets/route_elements.css.scss new file mode 100644 index 0000000..a0080ab --- /dev/null +++ b/app/assets/stylesheets/route_elements.css.scss @@ -0,0 +1,5 @@ +#route_elements .handle { + font-size: 12px; + color: #777; + cursor: move; +}
\ No newline at end of file diff --git a/app/controllers/route_elements_controller.rb b/app/controllers/route_elements_controller.rb index 9c6f2b7..9c9033e 100644 --- a/app/controllers/route_elements_controller.rb +++ b/app/controllers/route_elements_controller.rb @@ -44,14 +44,14 @@ 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 sort + #call_route = RouteElement.find(params[:route_element].first).call_route + + params[:route_element].each do |route_element_id| + @call_route.route_elements.find(route_element_id).move_to_bottom + end - def move_lower - @route_element.move_lower - redirect_to :back + render nothing: true end private diff --git a/app/models/call_route.rb b/app/models/call_route.rb index 6e0dcab..8bc811a 100644 --- a/app/models/call_route.rb +++ b/app/models/call_route.rb @@ -4,7 +4,7 @@ class CallRoute < ActiveRecord::Base ROUTING_TABLES = ['prerouting', 'outbound', 'inbound', 'dtmf'] - has_many :route_elements, :dependent => :destroy + has_many :route_elements, :dependent => :destroy, :order => :position validates :name, :presence => true diff --git a/app/views/call_routes/show.html.haml b/app/views/call_routes/show.html.haml index a33a29b..7c695c8 100644 --- a/app/views/call_routes/show.html.haml +++ b/app/views/call_routes/show.html.haml @@ -1,26 +1,33 @@ - content_for :title, t("call_routes.show.page_title") -%p - %strong= t('call_routes.show.position') + ":" - = @call_route.position -%p - %strong= t('call_routes.show.table') + ":" - = @call_route.routing_table -%p - %strong= t('call_routes.show.name') + ":" - = @call_route.name -%p - %strong= t('call_routes.show.endpoint') + ":" - - endpoint = @call_route.endpoint - - if endpoint - = endpoint - - else - = @call_route.endpoint_type +.row + .span5 + %table.table.table-striped + %tr + %td + %strong= t('call_routes.show.table') + ":" + %td + = @call_route.routing_table + %tr + %td + %strong= t('call_routes.show.name') + ":" + %td + = @call_route.name + %tr + %td + %strong= t('call_routes.show.endpoint') + ":" + %td + - if @call_route.endpoint.blank? + = @call_route.endpoint_type + - else + = @call_route.endpoint -= render :partial => 'shared/show_edit_destroy_part', :locals => { :child => @call_route } + = 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 +.row + .span12 + %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 } + = render :partial => 'shared/create_link', :locals => { :parent => @call_route, :child_class => RouteElement } diff --git a/app/views/phones/_form_core.html.haml b/app/views/phones/_form_core.html.haml index 17b9ca8..31f3c24 100644 --- a/app/views/phones/_form_core.html.haml +++ b/app/views/phones/_form_core.html.haml @@ -11,5 +11,5 @@ - if defined? GsParameter.get('NIGHTLY_REBOOT_OF_PHONES') && GsParameter.get('NIGHTLY_REBOOT_OF_PHONES') == true = f.input :nightly_reboot, :label => t('phones.form.nightly_reboot.label'), :hint => conditional_hint('phones.form.nightly_reboot.hint') - - if !GsParameter.get('PROVISIONING_KEY_LENGTH').nil? && GsParameter.get('PROVISIONING_KEY_LENGTH') > 0 + - if GsParameter.get('PROVISIONING_KEY_LENGTH') == 0 = f.input :provisioning_key_active, :label => t('phones.form.provisioning_key_active.label'), :hint => conditional_hint('phones.form.provisioning_key_active.hint') diff --git a/app/views/phones/show.html.haml b/app/views/phones/show.html.haml index 86ac380..e9b8b21 100644 --- a/app/views/phones/show.html.haml +++ b/app/views/phones/show.html.haml @@ -34,7 +34,7 @@ %td = @phone.nightly_reboot == true ? t('simple_form.yes') : t('simple_form.no') - - if !GsParameter.get('PROVISIONING_KEY_LENGTH').nil? && GsParameter.get('PROVISIONING_KEY_LENGTH') > 0 + - if GsParameter.get('PROVISIONING_KEY_LENGTH') == 0 %tr %td %strong= t('phones.show.provisioning_key_active') + ":" diff --git a/app/views/route_elements/_form_core.html.haml b/app/views/route_elements/_form_core.html.haml index d22467e..a9a38a7 100644 --- a/app/views/route_elements/_form_core.html.haml +++ b/app/views/route_elements/_form_core.html.haml @@ -4,5 +4,4 @@ = 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, :collection => RouteElement::ELEMENT_ACTIONS, :label => t('route_elements.form.action.label'), :hint => conditional_hint('route_elements.form.action.hint'), :include_blank => false - = f.input :position, :label => t('route_elements.form.position.label'), :hint => conditional_hint('route_elements.form.position.hint') = f.input :mandatory, :label => t('route_elements.form.mandatory.label'), :hint => conditional_hint('route_elements.form.mandatory.hint') diff --git a/app/views/route_elements/_index_core.html.haml b/app/views/route_elements/_index_core.html.haml index f68a9ba..b7d2bc1 100644 --- a/app/views/route_elements/_index_core.html.haml +++ b/app/views/route_elements/_index_core.html.haml @@ -1,22 +1,46 @@ %table.table.table-striped %thead %tr + - if route_elements.count > 1 + %th %th - %th= t('route_elements.index.var_in') - %th= t('route_elements.index.var_out') + %span.hidden-phone + = t('route_elements.index.var_in') + %th + %span.hidden-phone + = 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 + %span.hidden-phone + = t('route_elements.index.replacement') + %th + %span.hidden-phone + = t('route_elements.index.action') + %th + %span.hidden-phone + = t('route_elements.index.mandatory') - %tbody + %tbody{ :id => "route_elements", :'data-update-url' => sort_call_route_route_elements_url(route_elements.first.call_route)} - for route_element in route_elements - %tr - %td= route_element.position - %td= route_element.var_in - %td= route_element.var_out + = content_tag_for :tr, route_element do + - if route_elements.count > 1 + %td + %span.handle + %i.icon-resize-vertical + %td + %span.hidden-phone + = route_element.var_in + %td + %span.hidden-phone + = route_element.var_out %td= route_element.pattern - %td= route_element.replacement - %td= route_element.action - %td= route_element.mandatory + %td + %span.hidden-phone + = route_element.replacement + %td + %span.hidden-phone + = route_element.action + %td + %span.hidden-phone + = route_element.mandatory =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 1d07cbc..937df5e 100644 --- a/app/views/route_elements/show.html.haml +++ b/app/views/route_elements/show.html.haml @@ -1,25 +1,37 @@ - content_for :title, t("route_elements.show.page_title") -%p - %strong= t('route_elements.show.position') + ":" - = @route_element.position -%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 +.row + .span6 + %table.table.table-striped + %tr + %td + %strong= t('route_elements.show.var_in') + ":" + %td + = @route_element.var_in + %tr + %td + %strong= t('route_elements.show.var_out') + ":" + %td + = @route_element.var_out + %tr + %td + %strong= t('route_elements.show.pattern') + ":" + %td + = @route_element.pattern + %tr + %td + %strong= t('route_elements.show.replacement') + ":" + %td + = @route_element.replacement + %tr + %td + %strong= t('route_elements.show.action') + ":" + %td + = @route_element.action + %tr + %td + %strong= t('route_elements.show.mandatory') + ":" + %td + = @route_element.mandatory = render :partial => 'shared/show_edit_destroy_part', :locals => {:parent => @call_route, :child => @route_element }
\ No newline at end of file diff --git a/config/locales/views/call_routes/de.yml b/config/locales/views/call_routes/de.yml index 77b597b..c9df1c2 100644 --- a/config/locales/views/call_routes/de.yml +++ b/config/locales/views/call_routes/de.yml @@ -1,25 +1,25 @@ de: call_routes: - name: 'Call Route' + name: 'Call-Route' controller: - successfuly_created: 'Call Route wurde angelegt.' - successfuly_updated: 'Call Route wurde aktualisiert.' - successfuly_destroyed: 'Call Route wurde gelöscht.' + successfuly_created: 'Call-Route wurde angelegt.' + successfuly_updated: 'Call-Route wurde aktualisiert.' + successfuly_destroyed: 'Call-Route wurde gelöscht.' index: - page_title: 'Liste aller Call Routen' - routing_table: 'Routing Table' + page_title: 'Liste Call-Routen' + routing_table: 'Routing Tabelle' name: 'Name' - endpoint: 'Endpoint' + endpoint: 'Endpunkt' position: 'Position' actions: - confirm_destroy: 'Sind Sie sicher, dass Sie folgendes löschen möchten: Call Route' + confirm_destroy: 'Sind Sie sicher, dass Sie folgendes löschen möchten: Call-Route' destroy: 'Löschen' edit: 'Bearbeiten' show: 'Anzeigen' create: 'Neu anlegen' - create_for: 'Call Route neu anlegen für %{resource}' + create_for: 'Call-Route neu anlegen für %{resource}' show: - page_title: 'Call Route bearbeiten' + page_title: 'Call-Route bearbeiten' routing_table: 'Routing Table' name: 'Name' endpoint: 'Endpoint' @@ -30,11 +30,11 @@ de: edit: 'Bearbeiten' view_all: 'Alle anzeigen' new: - page_title: 'Call Route neu anlegen' + page_title: 'Call-Route neu anlegen' actions: back_to_list: 'Zurück zur Übersicht' edit: - page_title: 'Call Route bearbeiten' + page_title: 'Call-Route bearbeiten' actions: back_to_list: 'Zurück zur Übersicht' edit: 'Bearbeiten' diff --git a/config/locales/views/phones/de.yml b/config/locales/views/phones/de.yml index 373db13..02875c4 100644 --- a/config/locales/views/phones/de.yml +++ b/config/locales/views/phones/de.yml @@ -9,9 +9,9 @@ de: page_title: 'Telefone' mac_address: 'MAC-Adresse' phone_model_id: 'Modell' - hot_deskable: 'Hot-Desk fähig' - ip_address: 'IP-Adresse' - last_ip_address: 'Letzte IP-Adresse' + hot_deskable: 'Hot-Desk' + ip_address: 'IP' + last_ip_address: 'Letzte IP' http_user: 'Phone WebGUI Username' http_password: 'Phone WebGUI Passwort' nightly_reboot: 'Nachts automatischer Reboot' diff --git a/config/locales/views/route_elements/de.yml b/config/locales/views/route_elements/de.yml index fe14671..70a6162 100644 --- a/config/locales/views/route_elements/de.yml +++ b/config/locales/views/route_elements/de.yml @@ -1,12 +1,12 @@ de: route_elements: - name: 'Route element' + name: 'Routen-Element' controller: - successfuly_created: 'Route element wurde angelegt.' - successfuly_updated: 'Route element wurde aktualisiert.' - successfuly_destroyed: 'Route element wurde gelöscht.' + successfuly_created: 'Routen-Element wurde angelegt.' + successfuly_updated: 'Routen-Element wurde aktualisiert.' + successfuly_destroyed: 'Routen-Element wurde gelöscht.' index: - page_title: 'Übersicht von Route element' + page_title: 'Liste Routen-Elemente' call_route_id: 'Call route' var_in: 'Var in' var_out: 'Var out' @@ -16,14 +16,14 @@ de: mandatory: 'Mandatory' position: 'Position' actions: - confirm_destroy: 'Sind Sie sicher, dass Sie folgendes löschen möchten: Route element' + confirm_destroy: 'Sind Sie sicher, dass Sie folgendes löschen möchten: Routen-Element' destroy: 'Löschen' edit: 'Bearbeiten' show: 'Anzeigen' create: 'Neu anlegen' - create_for: 'Route element neu anlegen für %{resource}' + create_for: 'Routen-Element neu anlegen für %{resource}' show: - page_title: 'Route element bearbeiten' + page_title: 'Routen-Element bearbeiten' call_route_id: 'Call route' var_in: 'Var in' var_out: 'Var out' @@ -38,11 +38,11 @@ de: edit: 'Bearbeiten' view_all: 'Alle anzeigen' new: - page_title: 'Route element neu anlegen' + page_title: 'Routen-Element neu anlegen' actions: back_to_list: 'Zurück zur Übersicht' edit: - page_title: 'Route element bearbeiten' + page_title: 'Routen-Element bearbeiten' actions: back_to_list: 'Zurück zur Übersicht' edit: 'Bearbeiten' diff --git a/config/locales/views/sip_accounts/de.yml b/config/locales/views/sip_accounts/de.yml index 2820336..8fe2300 100644 --- a/config/locales/views/sip_accounts/de.yml +++ b/config/locales/views/sip_accounts/de.yml @@ -11,11 +11,11 @@ de: caller_name: 'Caller Name' password: 'Passwort' voicemail_pin: 'Anrufbeantworter PIN' - phone_numbers: 'Telefonnummern' + phone_numbers: 'Tel.Nr.' call_waiting: 'Anklopfen' clir: 'Rufnummernunterdrückung (CLIR)' clip: 'Rufnummernanzeige (CLIP)' - hotdeskable: 'Hot-Desk fähig' + hotdeskable: 'Hot-Desk' clip_no_screening: 'Spezifische Rufnummernanzeige (CLIP -no screening-)' callforward_rules_act_per_sip_account: 'Rufweiterleitungen gelten für das gesamte SIP-Account' online: 'Online' diff --git a/config/routes.rb b/config/routes.rb index 2586e85..8060f1c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,7 +16,9 @@ Gemeinschaft42c::Application.routes.draw do post :sort get :show_variables } - resources :route_elements + resources :route_elements do + collection { post :sort } + end end resources :gateways do diff --git a/db/schema.rb b/db/schema.rb index 5e51305..fc2b635 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130206144829) do +ActiveRecord::Schema.define(:version => 20130212071000) do create_table "access_authorizations", :force => true do |t| t.string "access_authorizationable_type" @@ -129,21 +129,11 @@ ActiveRecord::Schema.define(:version => 20130206144829) do t.datetime "finished_at" t.string "state" t.string "directory" - t.integer "size_of_the_backup" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false t.string "backup_file" end - create_table "backups", :force => true do |t| - t.datetime "start_at" - t.datetime "end_at" - t.string "directory" - t.string "size" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false - end - create_table "call_forward_cases", :force => true do |t| t.string "value" t.datetime "created_at", :null => false @@ -656,6 +646,28 @@ ActiveRecord::Schema.define(:version => 20130206144829) do t.string "hostname", :limit => 256 end + create_table "intruders", :force => true do |t| + t.string "list_type" + t.string "key" + t.integer "points" + t.integer "bans" + t.datetime "ban_last" + t.datetime "ban_end" + t.string "contact_ip" + t.integer "contact_port" + t.integer "contact_count" + t.datetime "contact_last" + t.float "contacts_per_second" + t.float "contacts_per_second_max" + t.string "user_agent" + t.string "to_user" + t.string "comment" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + add_index "intruders", ["key"], :name => "index_intruders_on_key", :unique => true + create_table "languages", :force => true do |t| t.string "name" t.string "code" @@ -961,15 +973,9 @@ ActiveRecord::Schema.define(:version => 20130206144829) do t.datetime "updated_at", :null => false t.integer "sip_account_id" t.integer "softkey_function_id" - t.integer "call_forward_id" t.string "uuid" - end - - create_table "system_messages", :force => true do |t| - t.integer "user_id" - t.string "content" - t.datetime "created_at", :null => false - t.datetime "updated_at", :null => false + t.string "softkeyable_type" + t.integer "softkeyable_id" end create_table "tasks", :id => false, :force => true do |t| |