From 7525ca487b993cc04c5540c0cf3bee4dabc2cc1c Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sun, 30 Dec 2012 21:04:13 +0100 Subject: Added nightly build to the release number. --- config/initializers/gemeinschaft_parameters.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/initializers') diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb index b1481ef..1624165 100644 --- a/config/initializers/gemeinschaft_parameters.rb +++ b/config/initializers/gemeinschaft_parameters.rb @@ -1,6 +1,6 @@ # Use this file to set generic parameters for Gemeinschaft -GEMEINSCHAFT_VERSION = '5.0.2' +GEMEINSCHAFT_VERSION = '5.0.2-nightly-build' SUPER_TENANT_NAME = 'Super-Tenant' # System defaults -- cgit v1.2.3 From 6d809427f7dbff9509603cab3339c6fbda9ea992 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 5 Jan 2013 12:50:17 +0100 Subject: Add the initializer to set the constants. --- config/initializers/gemeinschaft_parameters.rb | 84 ++------------------------ 1 file changed, 4 insertions(+), 80 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb index 1624165..dd6b2eb 100644 --- a/config/initializers/gemeinschaft_parameters.rb +++ b/config/initializers/gemeinschaft_parameters.rb @@ -1,81 +1,5 @@ -# Use this file to set generic parameters for Gemeinschaft +# Set some constants. -GEMEINSCHAFT_VERSION = '5.0.2-nightly-build' -SUPER_TENANT_NAME = 'Super-Tenant' - -# System defaults -MINIMUM_PIN_LENGTH = 4 -MAXIMUM_PIN_LENGTH = 10 - -# GUI -GUI_REDIRECT_HTTPS = false - -# Phone numbers -# Only touch this if you know what you are doing! -STRICT_INTERNAL_EXTENSION_HANDLING = false -STRICT_DID_HANDLING = false - -# SIP defaults -DEFAULT_LENGTH_SIP_AUTH_NAME = 10 -DEFAULT_LENGTH_SIP_PASSWORD = 15 -CALL_WAITING = false -DEFAULT_CLIR_SETTING = false -DEFAULT_CLIP_SETTING = true - -TO_S_MAX_CALLER_NAME_LENGTH = 25 -TO_S_MAX_LENGTH_OF_AUTH_NAME = 6 - -# Pagination defaults -DEFAULT_PAGINATION_ENTRIES_PER_PAGE = 50 - -# Conference defaults -MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE = 100 -DEFAULT_MAX_CONFERENCE_MEMBERS = 10 - -# Misc defaults -MAX_EXTENSION_LENGTH = 6 - -# Fax defaults -DEFAULT_NUMBER_OF_RETRIES = 3 -DAYS_TILL_AUTO_DELETE = 90 - -# Names of PhoneNumberRanges -INTERNAL_EXTENSIONS = 'internal_extensions' -SERVICE_NUMBERS = 'service_numbers' -DIRECT_INWARD_DIALING_NUMBERS = 'direct_inward_dialing_numbers' - -# Callthrough defaults -CALLTHROUGH_HAS_WHITELISTS = true - -# Hunt groups -HUNT_GROUP_STRATEGIES = ['ring_all', 'ring_recursively'] -VALID_SECONDS_BETWEEN_JUMPS_VALUES = (1 .. 60).to_a.map{|x| x * 2} - -# Callforward -DEFAULT_CALL_FORWARD_DEPTH = 1 -MAX_CALL_FORWARD_DEPTH = 40 -CALLFORWARD_DESTINATION_DEFAULT = '+49' -CALLFORWARD_RULES_ACT_PER_SIP_ACCOUNT_DEFAULT = true - -# Phone -PROVISIONING_AUTO_ADD_PHONE = true -PROVISIONING_AUTO_ADD_SIP_ACCOUNT = true -PROVISIONING_AUTO_TENANT_ID = 2 -PROVISIONING_AUTO_SIP_ACCOUNT_CALLER_PREFIX = 'Gemeinschaft ' -PROVISIONING_IEEE8021X_EAP_USERNAME = '' -PROVISIONING_IEEE8021X_EAP_PASSWORD = '' -NIGHTLY_REBOOT_OF_PHONES = true -SIEMENS_HISTORY_RELOAD_TIMES = {0..6 => 600, 7..20 => 40, 21..24 => 300} - -# API configuration -DEFAULT_API_TENANT_ID = 2 -REMOTE_IP_ADDRESS_WHITELIST = [] # e.g. ['10.0.0.1'] -IMPORT_CSV_FILE = '/var/tmp/ExampleVoipCsvExport.csv' -DOUBLE_CHECK_POSITIVE_USERS_CSV = '/var/tmp/ExampleDoubleCheckVoipCsvExport.csv' -IMPORT_CSV_ENCODING = 'UTF-8' -USER_NAME_PREFIX = 'dtc' -CALLTHROUGH_NAME_TO_BE_USED_FOR_DEFAULT_ACTIVATION = 'Callthrough for employees' - -# GS Cluster configuration -WRITE_GS_CLUSTER_SYNC_LOG = true -HOMEBASE_IP_ADDRESS = '0.0.0.0' +GsParameter.all.each do |gs_parameter| + gs_parameter.generate_constant +end \ No newline at end of file -- cgit v1.2.3 From e76890d5f4634d47514a592d501d9792ae2ff7bb Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 5 Jan 2013 21:00:52 +0100 Subject: Different scaffold for GsParameter. --- config/initializers/gemeinschaft_parameters.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb index dd6b2eb..844ff32 100644 --- a/config/initializers/gemeinschaft_parameters.rb +++ b/config/initializers/gemeinschaft_parameters.rb @@ -1,5 +1,5 @@ # Set some constants. -GsParameter.all.each do |gs_parameter| - gs_parameter.generate_constant -end \ No newline at end of file +# GsParameter.all.each do |gs_parameter| +# gs_parameter.generate_constant +# end -- cgit v1.2.3 From ddb3dfa92ec0878240211cb2b7a8e125961b1360 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 5 Jan 2013 23:01:16 +0100 Subject: Moved to GsParemeter.get and set defaults for a couple of validations. --- config/initializers/gemeinschaft_parameters.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb index 844ff32..e3fa11f 100644 --- a/config/initializers/gemeinschaft_parameters.rb +++ b/config/initializers/gemeinschaft_parameters.rb @@ -1,5 +1,3 @@ # Set some constants. -# GsParameter.all.each do |gs_parameter| -# gs_parameter.generate_constant -# end + -- cgit v1.2.3 From 57196d838691aeba38ad7e088e83c0881a213861 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 5 Jan 2013 23:07:21 +0100 Subject: Deleted a not anymore needed initializer. --- config/initializers/gemeinschaft_parameters.rb | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 config/initializers/gemeinschaft_parameters.rb (limited to 'config/initializers') diff --git a/config/initializers/gemeinschaft_parameters.rb b/config/initializers/gemeinschaft_parameters.rb deleted file mode 100644 index e3fa11f..0000000 --- a/config/initializers/gemeinschaft_parameters.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Set some constants. - - -- cgit v1.2.3 From a742a9038210691169b407c2897a38ded8618f84 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 11 Jan 2013 12:28:35 +0100 Subject: Generate a secret_token (for signed cookies). --- config/initializers/secret_token.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/initializers') diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb index 6f04f07..ecd511c 100644 --- a/config/initializers/secret_token.rb +++ b/config/initializers/secret_token.rb @@ -4,4 +4,4 @@ # If you change this key, all old signed cookies will become invalid! # Make sure the secret is at least 30 characters and all random, # no regular words or you'll be exposed to dictionary attacks. -Gemeinschaft42c::Application.config.secret_token = '9a59cac7fe4b23e0253a7beb341d9498d721923e966b45983f441f991e81f758067a6d9a949247d489773288284ab96b5015be52bf7b2834e666d43f864034e4' +Gemeinschaft42c::Application.config.secret_token = GsParameter.get('SECRET_TOKEN') -- cgit v1.2.3 From 12e91c4932e32808e5a9bf3f454920e7fb1b7d61 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 17:27:15 +0100 Subject: Imports the GS version number from ENV['GS_VERSION']. #98 --- config/initializers/update_gs_version_number.rb | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 config/initializers/update_gs_version_number.rb (limited to 'config/initializers') diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb new file mode 100644 index 0000000..303b1e0 --- /dev/null +++ b/config/initializers/update_gs_version_number.rb @@ -0,0 +1,6 @@ +# The Gemeinschaft version is stored in an environment variable. +# It equals the branch in git. +# +if !ENV['GS_VERSION'].nil? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] + GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION']) +end \ No newline at end of file -- cgit v1.2.3 From 8d1167c53e9edaf6e5a2b3e89dd4fd2a2c872dbb Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 17:55:10 +0100 Subject: Added GsParameter.table_exists? #98 --- config/initializers/update_gs_version_number.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'config/initializers') diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb index 303b1e0..914f007 100644 --- a/config/initializers/update_gs_version_number.rb +++ b/config/initializers/update_gs_version_number.rb @@ -1,6 +1,6 @@ # The Gemeinschaft version is stored in an environment variable. # It equals the branch in git. # -if !ENV['GS_VERSION'].nil? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] +if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION']) end \ No newline at end of file -- cgit v1.2.3 From 313a6bfb2c5eddca7872bda007b7eae87306e5c6 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Fri, 18 Jan 2013 19:06:01 +0100 Subject: Update config/initializers/update_gs_version_number.rb --- config/initializers/update_gs_version_number.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb index 914f007..972c480 100644 --- a/config/initializers/update_gs_version_number.rb +++ b/config/initializers/update_gs_version_number.rb @@ -2,5 +2,7 @@ # It equals the branch in git. # if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] - GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION']) -end \ No newline at end of file + if GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').any? + GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION']) + end +end -- cgit v1.2.3 From edb3c4d6eeb603a84403bf81e695330a8ea9c603 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 19 Jan 2013 08:37:14 +0100 Subject: Bugfix --- config/initializers/update_gs_version_number.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb index 972c480..4770858 100644 --- a/config/initializers/update_gs_version_number.rb +++ b/config/initializers/update_gs_version_number.rb @@ -2,7 +2,8 @@ # It equals the branch in git. # if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEMEINSCHAFT_VERSION') != ENV['GS_VERSION'] - if GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').any? - GsParameter.where(:name => 'GEMEINSCHAFT_VERSION').first.update_attributes(:name => ENV['GS_VERSION']) - end + version = GsParameter.find_or_create_by_name('GEMEINSCHAFT_VERSION') + version.section = 'Generic' + version.value = ENV['GS_VERSION'] + version.save end -- cgit v1.2.3 From c8973406e83861f593af33c959abd4529a855437 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Mon, 21 Jan 2013 20:30:07 +0100 Subject: rails generate simple_form:install --bootstrap --- config/initializers/simple_form.rb | 173 +++++++++++++++++++++++++++++++++++-- 1 file changed, 165 insertions(+), 8 deletions(-) (limited to 'config/initializers') diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 2e3d9fb..ab84483 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -1,19 +1,176 @@ # Use this setup block to configure all options available in SimpleForm. SimpleForm.setup do |config| - config.wrappers :tag => :div, :class => :input, - :error_class => :field_with_errors do |b| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, :class => :input, + :hint_class => :field_with_hint, :error_class => :field_with_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. - # Form extensions + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes b.use :html5 - b.optional :pattern - b.use :maxlength + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input :placeholder => "Placeholder" b.use :placeholder - b.use :readonly - # Form components + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable the lookup for any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + b.optional :maxlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs b.use :label_input - b.use :error, :wrap_with => { :tag => :span, :class => :error } b.use :hint, :wrap_with => { :tag => :span, :class => :hint } + b.use :error, :wrap_with => { :tag => :span, :class => :error } + end + + config.wrappers :bootstrap, :tag => 'div', :class => 'control-group', :error_class => 'error' do |b| + b.use :html5 + b.use :placeholder + b.use :label + b.wrapper :tag => 'div', :class => 'controls' do |ba| + ba.use :input + ba.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' } + ba.use :hint, :wrap_with => { :tag => 'p', :class => 'help-block' } + end + end + + config.wrappers :prepend, :tag => 'div', :class => "control-group", :error_class => 'error' do |b| + b.use :html5 + b.use :placeholder + b.use :label + b.wrapper :tag => 'div', :class => 'controls' do |input| + input.wrapper :tag => 'div', :class => 'input-prepend' do |prepend| + prepend.use :input + end + input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' } + input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' } + end end + config.wrappers :append, :tag => 'div', :class => "control-group", :error_class => 'error' do |b| + b.use :html5 + b.use :placeholder + b.use :label + b.wrapper :tag => 'div', :class => 'controls' do |input| + input.wrapper :tag => 'div', :class => 'input-append' do |append| + append.use :input + end + input.use :hint, :wrap_with => { :tag => 'span', :class => 'help-block' } + input.use :error, :wrap_with => { :tag => 'span', :class => 'help-inline' } + end + end + + # Wrappers for forms and inputs using the Twitter Bootstrap toolkit. + # Check the Bootstrap docs (http://twitter.github.com/bootstrap) + # to learn about the different styles for forms and inputs, + # buttons and other elements. + config.default_wrapper = :bootstrap + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # :inline => input + label + # :nested => label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = 'btn' + + # Method used to tidy up errors. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = 'alert alert-error' + + # ID to add for error notification helper. + # config.error_notification_id = nil + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. Please note that when using :boolean_style = :nested, + # SimpleForm will force this option to be a label. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + config.label_class = 'control-label' + + # You can define the class to use on all forms. Default is simple_form. + # config.form_class = :simple_form + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use default HTML5 validations (novalidate option). + # Default is enabled. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # Default size for text inputs. + # config.default_input_size = 50 + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? end -- cgit v1.2.3 From 5d15c975b7d4509d786ab7b95ec61ed7ad166b14 Mon Sep 17 00:00:00 2001 From: Julian Pawlowski Date: Tue, 22 Jan 2013 12:15:48 +0100 Subject: add GS_BUILDNAME as tooltip in the footer --- config/initializers/update_gs_version_number.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'config/initializers') diff --git a/config/initializers/update_gs_version_number.rb b/config/initializers/update_gs_version_number.rb index 4770858..d9e1aae 100644 --- a/config/initializers/update_gs_version_number.rb +++ b/config/initializers/update_gs_version_number.rb @@ -7,3 +7,10 @@ if !ENV['GS_VERSION'].nil? && GsParameter.table_exists? && GsParameter.get('GEME version.value = ENV['GS_VERSION'] version.save end + +if !ENV['GS_BUILDNAME'].nil? && GsParameter.table_exists? && GsParameter.get('GS_BUILDNAME') != ENV['GS_BUILDNAME'] + buildname = GsParameter.find_or_create_by_name('GEMEINSCHAFT_BUILDNAME') + buildname.section = 'Generic' + buildname.value = ENV['GS_BUILDNAME'] + buildname.save +end -- cgit v1.2.3