From e9e7135639a17a1e03efffdecc743854e9c47f88 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 8 Jul 2013 14:32:24 +0200 Subject: [PATCH 01/18] run bundle update and make it work again --- Gemfile | 27 ++-- Gemfile.lock | 126 ++++++++++-------- app/assets/javascripts/application.js | 14 +- .../bootstrap_and_overrides.css.less | 15 +-- .../initializers/client_side_validations.rb | 7 +- 5 files changed, 103 insertions(+), 86 deletions(-) diff --git a/Gemfile b/Gemfile index 9bec3431..1372c1cc 100644 --- a/Gemfile +++ b/Gemfile @@ -4,28 +4,29 @@ ruby "1.9.3" gem "rails", '~> 3.2.9' -# Gems used only for assets and not required -# in production environments by default. -group :assets do - gem 'sass-rails', '~> 3.2.3' - gem 'coffee-rails', '~> 3.2.1' - - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - gem 'therubyracer', platforms: :ruby - - gem 'uglifier', '>= 1.0.3' -end - gem 'jquery-rails' gem 'bootstrap-datepicker-rails' +# Gems used only for assets and not required +# in production environments by default. +group :assets do + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + gem 'therubyracer', platforms: :ruby + + gem 'sass-rails', '~> 3.2.3' + gem 'coffee-rails', '~> 3.2.1' + gem 'less-rails-bootstrap' + + gem 'uglifier', '>= 1.0.3' +end gem 'mysql2' gem 'prawn' gem 'haml-rails' gem 'kaminari' -gem 'client_side_validations' gem 'simple_form' +gem 'client_side_validations' +gem 'client_side_validations-simple_form' gem 'inherited_resources' gem 'localize_input', git: "git://github.com/bennibu/localize_input.git" gem 'wikicloth' diff --git a/Gemfile.lock b/Gemfile.lock index c10e145e..df5d8313 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -49,17 +49,19 @@ GEM activesupport (3.2.13) i18n (= 0.6.1) multi_json (~> 1.0) - acts_as_tree (1.2.0) + acts_as_tree (1.4.0) activerecord (>= 3.0.0) + afm (0.2.0) arel (3.0.2) - better_errors (0.2.0) + better_errors (0.9.0) coderay (>= 1.0.0) - erubis (>= 2.7.0) - binding_of_caller (0.6.8) + erubis (>= 2.6.6) + binding_of_caller (0.7.2) + debug_inspector (>= 0.0.1) bootstrap-datepicker-rails (1.1.1.1) railties (>= 3.0) builder (3.0.4) - bullet (4.3.0) + bullet (4.6.0) uniform_notifier capistrano (2.13.5) highline @@ -69,58 +71,65 @@ GEM net-ssh-gateway (>= 1.1.0) capistrano-ext (1.2.1) capistrano (>= 1.0.0) - chronic (0.9.0) - client_side_validations (3.1.4) - coderay (1.0.8) + chronic (0.9.1) + client_side_validations (3.2.5) + client_side_validations-simple_form (2.1.0) + client_side_validations (~> 3.2.5) + simple_form (~> 2.1.0) + coderay (1.0.9) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.3.3) + coffee-script-source (1.6.3) commonjs (0.2.6) daemons (1.1.9) + debug_inspector (0.0.2) erubis (2.7.0) eventmachine (1.0.3) - exception_notification (2.6.1) + exception_notification (4.0.0) actionmailer (>= 3.0.4) + activesupport (>= 3.0.4) execjs (1.4.0) multi_json (~> 1.0) expression_parser (0.9.0) - haml (3.1.7) - haml-rails (0.3.5) + haml (4.0.3) + tilt + haml-rails (0.4) actionpack (>= 3.1, < 4.1) activesupport (>= 3.1, < 4.1) - haml (~> 3.1) + haml (>= 3.1, < 4.1) railties (>= 3.1, < 4.1) has_scope (0.5.1) - hashery (2.0.1) + hashery (2.1.0) highline (1.6.19) - hike (1.2.1) + hike (1.2.3) i18n (0.6.1) - inherited_resources (1.3.1) + inherited_resources (1.4.0) has_scope (~> 0.5.0) - responders (~> 0.6) + responders (~> 0.9) journey (1.0.4) - jquery-rails (2.1.3) - railties (>= 3.1.0, < 5.0) - thor (~> 0.14) - json (1.7.7) + jquery-rails (3.0.2) + railties (>= 3.0, < 5.0) + thor (>= 0.14, < 2.0) + json (1.8.0) kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - less (2.2.2) + less (2.3.2) commonjs (~> 0.2.6) - less-rails (2.2.3) + less-rails (2.3.3) actionpack (>= 3.1) - less (~> 2.2.0) - libv8 (3.3.10.4) - mail (2.5.3) - i18n (>= 0.4.0) + less (~> 2.3.1) + less-rails-bootstrap (2.3.3) + less-rails (~> 2.3.1) + libv8 (3.11.8.17) + mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - mailcatcher (0.5.11) + mailcatcher (0.5.12) activesupport (~> 3.0) eventmachine (~> 1.0.0) haml (>= 3.1, < 5) @@ -134,21 +143,23 @@ GEM activerecord (~> 3.1) activesupport (~> 3.1) polyamorous (~> 0.5.0) - mime-types (1.21) + mime-types (1.23) mono_logger (1.1.0) - multi_json (1.7.3) + multi_json (1.7.7) mysql2 (0.3.11) - net-scp (1.1.1) + net-scp (1.1.2) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (2.6.7) + net-ssh (2.6.8) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) - pdf-reader (1.2.0) + pdf-reader (1.3.3) Ascii85 (~> 1.0.0) + afm (~> 0.2.0) hashery (~> 2.0) ruby-rc4 + ttfunk polyamorous (0.5.0) activerecord (~> 3.0) polyglot (0.3.3) @@ -181,12 +192,13 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.0.3) + rake (10.1.0) rdoc (3.12.2) json (~> 1.4) redis (3.0.4) redis-namespace (1.3.0) redis (~> 3.0.0) + ref (1.0.5) responders (0.9.3) railties (~> 3.1) resque (1.24.1) @@ -195,24 +207,25 @@ GEM redis-namespace (~> 1.2) sinatra (>= 0.9.2) vegas (~> 0.1.2) - ruby-prof (0.11.2) + ruby-prof (0.13.0) ruby-rc4 (0.1.5) - sass (3.2.1) - sass-rails (3.2.5) + sass (3.2.9) + sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - simple-navigation (3.9.0) + simple-navigation (3.11.0) activesupport (>= 2.3.2) - simple-navigation-bootstrap (0.0.4) + simple-navigation-bootstrap (1.0.0) + railties (>= 3.1) simple-navigation (>= 3.7.0) - simple_form (2.0.3) + simple_form (2.1.0) actionpack (~> 3.0) activemodel (~> 3.0) - sinatra (1.3.6) + sinatra (1.4.3) rack (~> 1.4) - rack-protection (~> 1.3) - tilt (~> 1.3, >= 1.3.3) + rack-protection (~> 1.4) + tilt (~> 1.3, >= 1.3.4) skinny (0.2.3) eventmachine (~> 1.0.0) thin (~> 1.5.0) @@ -221,33 +234,34 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.6) - test-unit (2.5.3) - therubyracer (0.10.2) - libv8 (~> 3.3.10) + sqlite3 (1.3.7) + test-unit (2.5.5) + therubyracer (0.11.4) + libv8 (~> 3.11.8.12) + ref thin (1.5.1) daemons (>= 1.0.9) eventmachine (>= 0.12.6) rack (>= 1.0.0) - thor (0.17.0) + thor (0.18.1) tilt (1.4.1) - treetop (1.4.12) + treetop (1.4.14) polyglot polyglot (>= 0.3.1) ttfunk (1.0.3) - twitter-bootstrap-rails (2.1.3) + twitter-bootstrap-rails (2.2.7) actionpack (>= 3.1) - less-rails (~> 2.2.3) + execjs + rails (>= 3.1) railties (>= 3.1) - therubyracer (~> 0.10.2) tzinfo (0.3.37) - uglifier (1.3.0) + uglifier (2.1.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - uniform_notifier (1.1.1) + uniform_notifier (1.2.0) vegas (0.1.11) rack (>= 1.0.0) - whenever (0.8.1) + whenever (0.8.2) activesupport (>= 2.3.4) chronic (>= 0.6.3) wikicloth (0.8.0) @@ -268,6 +282,7 @@ DEPENDENCIES capistrano (= 2.13.5) capistrano-ext client_side_validations + client_side_validations-simple_form coffee-rails (~> 3.2.1) daemons exception_notification @@ -275,6 +290,7 @@ DEPENDENCIES inherited_resources jquery-rails kaminari + less-rails-bootstrap localize_input! mailcatcher meta_search diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index cf650243..f0645ea1 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,5 +1,4 @@ //= require jquery -//= require jquery-ui //= require jquery_ujs //= require twitter/bootstrap //= require jquery.tokeninput @@ -8,6 +7,7 @@ //= require bootstrap-datepicker/locales/bootstrap-datepicker.nl //= require jquery.observe_field //= require rails.validations +//= require rails.validations.simple_form //= require_self //= require ordering @@ -28,19 +28,19 @@ $.fn.extend({ $(function() { // Show/Hide a specific DOM element - $('a[data-toggle-this]').live('click', function() { + $('a[data-toggle-this]').on('click', function() { $($(this).data('toggle-this')).toggle(); return false; }); // Remove this item from DOM - $('a[data-remove-this]').live('click', function() { + $('a[data-remove-this]').on('click', function() { $($(this).data('remove-this')).remove(); return false; }); // Check/Uncheck a single checkbox - $('[data-check-this]').live('click', function() { + $('[data-check-this]').on('click', function() { var checkbox = $($(this).data('check-this')); checkbox.attr('checked', !checkbox.is(':checked')); highlightRow(checkbox); @@ -48,7 +48,7 @@ $(function() { }); // Check/Uncheck all checkboxes for a specific form - $('input[data-check-all]').live('click', function() { + $('input[data-check-all]').on('click', function() { var status = $(this).is(':checked'); var context = $(this).data('check-all'); var elms = $('input[type="checkbox"]', context); @@ -60,7 +60,7 @@ $(function() { }); // Submit form when changing a select menu. - $('form[data-submit-onchange] select').live('change', function() { + $('form[data-submit-onchange] select').on('change', function() { var confirmMessage = $(this).children(':selected').data('confirm'); if (confirmMessage) { if (confirm(confirmMessage)) { @@ -93,7 +93,7 @@ $(function() { }); // Remote paginations - $('div.pagination[data-remote] a').live('click', function() { + $('div.pagination[data-remote] a').on('click', function() { $.getScript($(this).attr('href')); return false; }); diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 58ac2122..b568fb71 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -10,15 +10,12 @@ body { @iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png'); // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) -// Note: If you use asset_path() here, your compiled boostrap_and_overrides.css will not -// have the proper paths. So for now we use the absolute path. -@fontAwesomeEotPath: '/assets/fontawesome-webfont.eot'; -@fontAwesomeWoffPath: '/assets/fontawesome-webfont.woff'; -@fontAwesomeTtfPath: '/assets/fontawesome-webfont.ttf'; -@fontAwesomeSvgPath: '/assets/fontawesome-webfont.svg'; - -// Font Awesome -@import "fontawesome"; +@fontAwesomeEotPath: asset-url('fontawesome-webfont.eot'); +@fontAwesomeEotPath_iefix: asset-url('fontawesome-webfont.eot?#iefix'); +@fontAwesomeWoffPath: asset-url('fontawesome-webfont.woff'); +@fontAwesomeTtfPath: asset-url('fontawesome-webfont.ttf'); +@fontAwesomeSvgPath: asset-url('fontawesome-webfont.svg#fontawesomeregular'); +@import 'fontawesome/font-awesome'; // Your custom LESS stylesheets goes here // diff --git a/config/initializers/client_side_validations.rb b/config/initializers/client_side_validations.rb index caf18378..30e21d0d 100644 --- a/config/initializers/client_side_validations.rb +++ b/config/initializers/client_side_validations.rb @@ -1,7 +1,10 @@ # ClientSideValidations Initializer -require 'client_side_validations/simple_form' if defined?(::SimpleForm) -require 'client_side_validations/formtastic' if defined?(::Formtastic) +# Uncomment to disable uniqueness validator, possible security issue +# ClientSideValidations::Config.disabled_validators = [:uniqueness] + +# Uncomment to validate number format with current I18n locale +# ClientSideValidations::Config.number_format_with_locale = true # Uncomment the following block if you want each input field to have the validation messages attached. # ActionView::Base.field_error_proc = Proc.new do |html_tag, instance| From 33b27d2fa70abbab3476eb70071ed374622279f3 Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 8 Jul 2013 22:41:06 +0200 Subject: [PATCH 02/18] proper usage of jQuery.on(), and update javascript in views as well --- app/assets/javascripts/application.js | 12 ++++++------ app/views/deliveries/_form.html.haml | 6 +++--- .../financial_transactions/new_collection.html.haml | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index f0645ea1..c5228350 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -28,19 +28,19 @@ $.fn.extend({ $(function() { // Show/Hide a specific DOM element - $('a[data-toggle-this]').on('click', function() { + $(document).on('click', 'a[data-toggle-this]', function() { $($(this).data('toggle-this')).toggle(); return false; }); // Remove this item from DOM - $('a[data-remove-this]').on('click', function() { + $(document).on('click', 'a[data-remove-this]', function() { $($(this).data('remove-this')).remove(); return false; }); // Check/Uncheck a single checkbox - $('[data-check-this]').on('click', function() { + $(document).on('click', '[data-check-this]', function() { var checkbox = $($(this).data('check-this')); checkbox.attr('checked', !checkbox.is(':checked')); highlightRow(checkbox); @@ -48,7 +48,7 @@ $(function() { }); // Check/Uncheck all checkboxes for a specific form - $('input[data-check-all]').on('click', function() { + $(document).on('click', 'input[data-check-all]', function() { var status = $(this).is(':checked'); var context = $(this).data('check-all'); var elms = $('input[type="checkbox"]', context); @@ -60,7 +60,7 @@ $(function() { }); // Submit form when changing a select menu. - $('form[data-submit-onchange] select').on('change', function() { + $(document).on('change', 'form[data-submit-onchange] select', function() { var confirmMessage = $(this).children(':selected').data('confirm'); if (confirmMessage) { if (confirm(confirmMessage)) { @@ -93,7 +93,7 @@ $(function() { }); // Remote paginations - $('div.pagination[data-remote] a').on('click', function() { + $(document).on('click', 'div.pagination[data-remote] a', function() { $.getScript($(this).attr('href')); return false; }); diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index 5eff702d..ba85b482 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -1,15 +1,15 @@ - content_for :javascript do :javascript $(function() { - $('.destroy_stock_change').live('click', function() { + $(document).on('click', '.destroy_stock_change', function() { $(this).prev('input').val('1').parent().hide(); return false; }); - $('.remove_new_stock_change').live('click', function() { + $(document).on('click', '.remove_new_stock_change', function() { $(this).parent().remove(); return false; - }) + }); }); = simple_form_for [@supplier, @delivery], validate: true do |f| diff --git a/app/views/finance/financial_transactions/new_collection.html.haml b/app/views/finance/financial_transactions/new_collection.html.haml index 324b118b..aaa67129 100644 --- a/app/views/finance/financial_transactions/new_collection.html.haml +++ b/app/views/finance/financial_transactions/new_collection.html.haml @@ -5,12 +5,12 @@ var ordergroup = "#{escape_javascript(render('ordergroup'))}" $(function() { - $('a[data-remove-transaction]').live('click', function() { + $(document).on('click', 'a[data-remove-transaction]', function() { $(this).parents('tr').remove(); return false; }); - $('a[data-add-transaction]').click(function() { + $(document).on('click', 'a[data-add-transaction]', function() { $('#ordergroups').append(ordergroup); return false; }); From cfae2791961c7b436cb0cff91f3c14e829c83ba3 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 12 Jul 2013 23:35:31 +0200 Subject: [PATCH 03/18] bundle update --- Gemfile.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index df5d8313..a9f7a177 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -111,7 +111,7 @@ GEM has_scope (~> 0.5.0) responders (~> 0.9) journey (1.0.4) - jquery-rails (3.0.2) + jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) json (1.8.0) @@ -261,7 +261,7 @@ GEM uniform_notifier (1.2.0) vegas (0.1.11) rack (>= 1.0.0) - whenever (0.8.2) + whenever (0.8.3) activesupport (>= 2.3.4) chronic (>= 0.6.3) wikicloth (0.8.0) From fc6fbdaa95ecb9971ba71853b52efb40a8e669ed Mon Sep 17 00:00:00 2001 From: wvengen Date: Sat, 13 Jul 2013 23:06:30 +0200 Subject: [PATCH 04/18] use less-rails, and make exception_notifier work again --- Gemfile | 16 +++++++--------- Gemfile.lock | 4 +--- config/initializers/load_app_config.rb | 12 +++++++----- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Gemfile b/Gemfile index 1372c1cc..04fa25f5 100644 --- a/Gemfile +++ b/Gemfile @@ -4,22 +4,20 @@ ruby "1.9.3" gem "rails", '~> 3.2.9' -gem 'jquery-rails' -gem 'bootstrap-datepicker-rails' - # Gems used only for assets and not required # in production environments by default. group :assets do - # See https://github.com/sstephenson/execjs#readme for more supported runtimes - gem 'therubyracer', platforms: :ruby - gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' - gem 'less-rails-bootstrap' - + gem 'less-rails' gem 'uglifier', '>= 1.0.3' + # See https://github.com/sstephenson/execjs#readme for more supported runtimes + gem 'therubyracer', platforms: :ruby end +gem 'jquery-rails' +gem 'bootstrap-datepicker-rails' + gem 'mysql2' gem 'prawn' gem 'haml-rails' @@ -42,7 +40,7 @@ gem 'resque' gem 'whenever', require: false # For defining cronjobs, see config/schedule.rb group :production do - gem 'exception_notification', require: 'exception_notifier' + gem 'exception_notification' end group :development do diff --git a/Gemfile.lock b/Gemfile.lock index a9f7a177..8095b8e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -123,8 +123,6 @@ GEM less-rails (2.3.3) actionpack (>= 3.1) less (~> 2.3.1) - less-rails-bootstrap (2.3.3) - less-rails (~> 2.3.1) libv8 (3.11.8.17) mail (2.5.4) mime-types (~> 1.16) @@ -290,7 +288,7 @@ DEPENDENCIES inherited_resources jquery-rails kaminari - less-rails-bootstrap + less-rails localize_input! mailcatcher meta_search diff --git a/config/initializers/load_app_config.rb b/config/initializers/load_app_config.rb index 1509536e..9501a48a 100644 --- a/config/initializers/load_app_config.rb +++ b/config/initializers/load_app_config.rb @@ -14,13 +14,15 @@ url_options.merge!({:port => FoodsoftConfig[:port]}) if FoodsoftConfig[:port] Foodsoft::Application.configure do config.action_mailer.default_url_options = url_options - if Rails.env !~ /development|test/ + if %w(production).include? Rails.env # Configuration of the exception_notification plugin # Mailadresses are set in config/app_config.yml - config.middleware.use ExceptionNotifier, - :email_prefix => FoodsoftConfig[:notification]['email_prefix'], - :sender_address => FoodsoftConfig[:notification]['sender_address'], - :exception_recipients => FoodsoftConfig[:notification]['error_recipients'] + config.middleware.use ExceptionNotification::Rack, + :email => { + :email_prefix => FoodsoftConfig[:notification]['email_prefix'], + :sender_address => FoodsoftConfig[:notification]['sender_address'], + :exception_recipients => FoodsoftConfig[:notification]['error_recipients'] + } end end From e5448603a4f00a93d2640eaf455229a3aa9209dc Mon Sep 17 00:00:00 2001 From: wvengen Date: Mon, 15 Jul 2013 23:45:09 +0200 Subject: [PATCH 05/18] update uglifier --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8095b8e8..693964f7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -253,7 +253,7 @@ GEM rails (>= 3.1) railties (>= 3.1) tzinfo (0.3.37) - uglifier (2.1.1) + uglifier (2.1.2) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) uniform_notifier (1.2.0) From ea399b2c7248babc8234270cbccbcecb5053933e Mon Sep 17 00:00:00 2001 From: wvengen Date: Tue, 16 Jul 2013 00:39:11 +0200 Subject: [PATCH 06/18] client_side_validations config --- config/initializers/client_side_validations.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/config/initializers/client_side_validations.rb b/config/initializers/client_side_validations.rb index 30e21d0d..95ff1644 100644 --- a/config/initializers/client_side_validations.rb +++ b/config/initializers/client_side_validations.rb @@ -1,9 +1,14 @@ # ClientSideValidations Initializer # Uncomment to disable uniqueness validator, possible security issue -# ClientSideValidations::Config.disabled_validators = [:uniqueness] +# Disabled because of possible security issue and because of bug +# https://github.com/bcardarella/client_side_validations/pull/532 +ClientSideValidations::Config.disabled_validators = [:uniqueness] # Uncomment to validate number format with current I18n locale +# Foodsoft is currently using localize_input which is activated on certain +# fields only, meaning we can't globally turn this on. The non-i18n number +# format is still supported - so for now keep false. # ClientSideValidations::Config.number_format_with_locale = true # Uncomment the following block if you want each input field to have the validation messages attached. From ccea97c2b37e9c596fd35675380c95d0cb673fa9 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 17 Jul 2013 11:31:12 +0200 Subject: [PATCH 07/18] update bootstrap assets --- app/assets/javascripts/bootstrap.js.coffee | 5 ++--- .../stylesheets/bootstrap_and_overrides.css.less | 12 +++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/bootstrap.js.coffee b/app/assets/javascripts/bootstrap.js.coffee index c9404a8e..94406798 100644 --- a/app/assets/javascripts/bootstrap.js.coffee +++ b/app/assets/javascripts/bootstrap.js.coffee @@ -1,4 +1,3 @@ jQuery -> - $("a[rel=popover]").popover() - $(".tooltip").tooltip() - $("a[rel=tooltip]").tooltip() \ No newline at end of file + $("a[rel~=popover], .has-popover").popover() + $("a[rel~=tooltip], .has-tooltip").tooltip() diff --git a/app/assets/stylesheets/bootstrap_and_overrides.css.less b/app/assets/stylesheets/bootstrap_and_overrides.css.less index 29364538..2cdb337e 100644 --- a/app/assets/stylesheets/bootstrap_and_overrides.css.less +++ b/app/assets/stylesheets/bootstrap_and_overrides.css.less @@ -1,13 +1,12 @@ @import "twitter/bootstrap/bootstrap"; +@import "twitter/bootstrap/responsive"; body { padding-top: 10px; } -@import "twitter/bootstrap/responsive"; - // Set the correct sprite paths -@iconSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings.png'); -@iconWhiteSpritePath: asset-path('twitter/bootstrap/glyphicons-halflings-white.png'); +@iconSpritePath: image-url('twitter/bootstrap/glyphicons-halflings.png'); +@iconWhiteSpritePath: image-url('twitter/bootstrap/glyphicons-halflings-white.png'); // Set the Font Awesome (Font Awesome is default. You can disable by commenting below lines) @fontAwesomeEotPath: asset-url('fontawesome-webfont.eot'); @@ -17,13 +16,16 @@ body { @fontAwesomeSvgPath: asset-url('fontawesome-webfont.svg#fontawesomeregular'); @import 'fontawesome/font-awesome'; +// Glyphicons +//@import "twitter/bootstrap/sprites.less"; + // Your custom LESS stylesheets goes here // // Since bootstrap was imported above you have access to its mixins which // you may use and inherit here // // If you'd like to override bootstrap's own variables, you can do so here as well -// See http://twitter.github.com/bootstrap/less.html for their names and documentation +// See http://twitter.github.com/bootstrap/customize.html#variables for their names and documentation // // Example: // @linkColor: #ff0000; From 1fed9834b35dbee8b329305b2a62ac1ddf8e0eb7 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 17 Jul 2013 11:31:27 +0200 Subject: [PATCH 08/18] fix tooltip after bootstrap update --- app/views/deliveries/_form.html.haml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index c1702708..c9bd8fcd 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -84,7 +84,8 @@ $('[data-toggle~="tooltip"]', context).tooltip({ animation: false, html: true, - placement: 'left' + placement: 'left', + container: 'body' // or they become a cell in the table }); } From 19a61a6c427eece90b0986fc162e314ec4bb5537 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 18 Sep 2013 16:53:49 +0200 Subject: [PATCH 09/18] update gems --- Gemfile.lock | 137 ++++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 68 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 3ced3672..059ef232 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -15,12 +15,12 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.0.2) - actionmailer (3.2.13) - actionpack (= 3.2.13) - mail (~> 2.5.3) - actionpack (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + actionmailer (3.2.14) + actionpack (= 3.2.14) + mail (~> 2.5.4) + actionpack (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) @@ -28,30 +28,30 @@ GEM rack-cache (~> 1.2) rack-test (~> 0.6.1) sprockets (~> 2.2.1) - activemodel (3.2.13) - activesupport (= 3.2.13) + activemodel (3.2.14) + activesupport (= 3.2.14) builder (~> 3.0.0) - activerecord (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) + activerecord (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.13) - activemodel (= 3.2.13) - activesupport (= 3.2.13) - activesupport (3.2.13) - i18n (= 0.6.1) + activeresource (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) + activesupport (3.2.14) + i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) acts_as_tree (1.4.0) activerecord (>= 3.0.0) afm (0.2.0) arel (3.0.2) - better_errors (0.9.0) + better_errors (1.0.1) coderay (>= 1.0.0) erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-datepicker-rails (1.1.1.1) + bootstrap-datepicker-rails (1.1.1.7) railties (>= 3.0) builder (3.0.4) bullet (4.6.0) @@ -72,12 +72,12 @@ GEM xpath (~> 2.0) childprocess (0.3.9) ffi (~> 1.0, >= 1.0.11) - chronic (0.9.1) - client_side_validations (3.2.5) + chronic (0.10.2) + client_side_validations (3.2.6) client_side_validations-simple_form (2.1.0) client_side_validations (~> 3.2.5) simple_form (~> 2.1.0) - coderay (1.0.9) + coderay (1.1.0) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) @@ -85,25 +85,24 @@ GEM coffee-script-source execjs coffee-script-source (1.6.3) - commonjs (0.2.6) + commonjs (0.2.7) daemons (1.1.9) - database_cleaner (0.7.1) + database_cleaner (1.1.1) debug_inspector (0.0.2) diff-lcs (1.2.4) erubis (2.7.0) eventmachine (1.0.3) - exception_notification (4.0.0) + exception_notification (4.0.1) actionmailer (>= 3.0.4) activesupport (>= 3.0.4) - execjs (1.4.0) - multi_json (~> 1.0) + execjs (2.0.1) expression_parser (0.9.0) factory_girl (4.2.0) activesupport (>= 3.0.0) factory_girl_rails (4.2.1) factory_girl (~> 4.2.0) railties (>= 3.0.0) - faker (1.1.2) + faker (1.2.0) i18n (~> 0.5) ffi (1.9.0) haml (4.0.3) @@ -113,16 +112,18 @@ GEM activesupport (>= 3.1, < 4.1) haml (>= 3.1, < 4.1) railties (>= 3.1, < 4.1) - has_scope (0.5.1) - hashery (2.1.0) + has_scope (0.6.0.rc) + actionpack (>= 3.2, < 5) + activesupport (>= 3.2, < 5) + hashery (2.1.1) highline (1.6.19) hike (1.2.3) - i18n (0.6.1) + i18n (0.6.5) i18n-spec (0.4.0) iso - inherited_resources (1.4.0) - has_scope (~> 0.5.0) - responders (~> 0.9) + inherited_resources (1.4.1) + has_scope (~> 0.6.0.rc) + responders (~> 1.0.0.rc) iso (0.2.0) i18n journey (1.0.4) @@ -133,12 +134,12 @@ GEM kaminari (0.14.1) actionpack (>= 3.0.0) activesupport (>= 3.0.0) - less (2.3.2) - commonjs (~> 0.2.6) - less-rails (2.3.3) + less (2.4.0) + commonjs (~> 0.2.7) + less-rails (2.4.2) actionpack (>= 3.1) - less (~> 2.3.1) - libv8 (3.11.8.17) + less (~> 2.4.0) + libv8 (3.16.14.3) mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) @@ -156,16 +157,16 @@ GEM activerecord (~> 3.1) activesupport (~> 3.1) polyamorous (~> 0.5.0) - mime-types (1.23) + mime-types (1.25) mini_portile (0.5.1) mono_logger (1.1.0) - multi_json (1.7.7) - mysql2 (0.3.11) + multi_json (1.8.0) + mysql2 (0.3.13) net-scp (1.1.2) net-ssh (>= 2.6.5) net-sftp (2.1.2) net-ssh (>= 2.6.5) - net-ssh (2.6.8) + net-ssh (2.7.0) net-ssh-gateway (1.2.0) net-ssh (>= 2.6.5) nokogiri (1.6.0) @@ -193,19 +194,19 @@ GEM rack rack-test (0.6.2) rack (>= 1.0) - rails (3.2.13) - actionmailer (= 3.2.13) - actionpack (= 3.2.13) - activerecord (= 3.2.13) - activeresource (= 3.2.13) - activesupport (= 3.2.13) + rails (3.2.14) + actionmailer (= 3.2.14) + actionpack (= 3.2.14) + activerecord (= 3.2.14) + activeresource (= 3.2.14) + activesupport (= 3.2.14) bundler (~> 1.0) - railties (= 3.2.13) + railties (= 3.2.14) rails-settings-cached (0.2.4) rails (>= 3.0.0) - railties (3.2.13) - actionpack (= 3.2.13) - activesupport (= 3.2.13) + railties (3.2.14) + actionpack (= 3.2.14) + activesupport (= 3.2.14) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) @@ -217,18 +218,18 @@ GEM redis-namespace (1.3.1) redis (~> 3.0.0) ref (1.0.5) - responders (0.9.3) - railties (~> 3.1) - resque (1.24.1) + responders (1.0.0.rc) + railties (>= 3.2, < 5) + resque (1.25.0) mono_logger (~> 1.0) multi_json (~> 1.0) redis-namespace (~> 1.2) sinatra (>= 0.9.2) vegas (~> 0.1.2) - rspec-core (2.14.2) - rspec-expectations (2.14.0) + rspec-core (2.14.5) + rspec-expectations (2.14.2) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.1) + rspec-mocks (2.14.3) rspec-rails (2.14.0) actionpack (>= 3.0) activesupport (>= 3.0) @@ -239,12 +240,12 @@ GEM ruby-prof (0.13.0) ruby-rc4 (0.1.5) rubyzip (0.9.9) - sass (3.2.9) + sass (3.2.10) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - select2-rails (3.4.3) + select2-rails (3.4.8) sass-rails thor (~> 0.14) selenium-webdriver (2.35.1) @@ -276,9 +277,9 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - therubyracer (0.11.4) - libv8 (~> 3.11.8.12) + sqlite3 (1.3.8) + therubyracer (0.12.0) + libv8 (~> 3.16.14.0) ref thin (1.5.1) daemons (>= 1.0.9) @@ -286,24 +287,24 @@ GEM rack (>= 1.0.0) thor (0.18.1) tilt (1.4.1) - treetop (1.4.14) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) ttfunk (1.0.3) - twitter-bootstrap-rails (2.2.7) + twitter-bootstrap-rails (2.2.8) actionpack (>= 3.1) execjs rails (>= 3.1) railties (>= 3.1) tzinfo (0.3.37) - uglifier (2.1.2) + uglifier (2.2.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) - uniform_notifier (1.2.0) + uniform_notifier (1.3.0) vegas (0.1.11) rack (>= 1.0.0) websocket (1.0.7) - whenever (0.8.3) + whenever (0.8.4) activesupport (>= 2.3.4) chronic (>= 0.6.3) wikicloth (0.8.0) From 75e858db71feb3f6c20a25a4fc3c2b8706997b5e Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 2 Oct 2013 22:55:14 +0200 Subject: [PATCH 10/18] bundle update --- Gemfile.lock | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 059ef232..a9112511 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -51,7 +51,7 @@ GEM erubis (>= 2.6.6) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-datepicker-rails (1.1.1.7) + bootstrap-datepicker-rails (1.1.1.8) railties (>= 3.0) builder (3.0.4) bullet (4.6.0) @@ -95,7 +95,7 @@ GEM exception_notification (4.0.1) actionmailer (>= 3.0.4) activesupport (>= 3.0.4) - execjs (2.0.1) + execjs (2.0.2) expression_parser (0.9.0) factory_girl (4.2.0) activesupport (>= 3.0.0) @@ -214,20 +214,20 @@ GEM rake (10.1.0) rdoc (3.12.2) json (~> 1.4) - redis (3.0.4) + redis (3.0.5) redis-namespace (1.3.1) redis (~> 3.0.0) ref (1.0.5) - responders (1.0.0.rc) + responders (1.0.0) railties (>= 3.2, < 5) - resque (1.25.0) + resque (1.25.1) mono_logger (~> 1.0) multi_json (~> 1.0) redis-namespace (~> 1.2) sinatra (>= 0.9.2) vegas (~> 0.1.2) rspec-core (2.14.5) - rspec-expectations (2.14.2) + rspec-expectations (2.14.3) diff-lcs (>= 1.1.3, < 2.0) rspec-mocks (2.14.3) rspec-rails (2.14.0) @@ -240,13 +240,12 @@ GEM ruby-prof (0.13.0) ruby-rc4 (0.1.5) rubyzip (0.9.9) - sass (3.2.10) + sass (3.2.11) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) - select2-rails (3.4.8) - sass-rails + select2-rails (3.5.0) thor (~> 0.14) selenium-webdriver (2.35.1) childprocess (>= 0.2.5) From 28644dc33406eec4b023fd340662f80f9cc1f35c Mon Sep 17 00:00:00 2001 From: Julius Date: Tue, 8 Oct 2013 19:58:11 +0200 Subject: [PATCH 11/18] Force update in Order#finish; rescue if error raised --- app/controllers/orders_controller.rb | 2 ++ app/models/order.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/orders_controller.rb b/app/controllers/orders_controller.rb index 7fba518a..e1cd7698 100644 --- a/app/controllers/orders_controller.rb +++ b/app/controllers/orders_controller.rb @@ -98,6 +98,8 @@ class OrdersController < ApplicationController order = Order.find(params[:id]) order.finish!(@current_user) redirect_to order, notice: I18n.t('orders.finish.notice') + rescue => error + redirect_to orders_url, alert: I18n.t('errors.general_msg', :msg => error.message) end # Renders the fax-text-file diff --git a/app/models/order.rb b/app/models/order.rb index f4545d02..057c0768 100644 --- a/app/models/order.rb +++ b/app/models/order.rb @@ -155,7 +155,7 @@ class Order < ActiveRecord::Base unless finished? Order.transaction do # set new order state (needed by notify_order_finished) - update_attributes(:state => 'finished', :ends => Time.now, :updated_by => user) + update_attributes!(:state => 'finished', :ends => Time.now, :updated_by => user) # Update order_articles. Save the current article_price to keep price consistency # Also save results for each group_order_result From b8ff4316345b22b782693a4c13c11520e7cb76b9 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 9 Oct 2013 10:35:27 +0200 Subject: [PATCH 12/18] clean up price tooltips javascript --- app/assets/javascripts/application.js | 16 ++++++++++++++++ app/views/deliveries/_form.html.haml | 11 ----------- app/views/deliveries/add_stock_change.js.erb | 1 - app/views/deliveries/create_stock_article.js.erb | 1 - app/views/deliveries/update_stock_article.js.erb | 1 - app/views/stock_takings/new.html.haml | 15 --------------- 6 files changed, 16 insertions(+), 29 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 39b99a65..221e83b0 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -120,6 +120,20 @@ $(function() { // Use bootstrap datepicker for dateinput $('.datepicker').datepicker({format: 'yyyy-mm-dd', language: I18n.locale}); + + // bootstrap tooltips (for price) + // Extra options don't work when using selector, so override defaults + // https://github.com/twbs/bootstrap/issues/3875 . These can still be + // overridden per tooltip using data-placement attributes and the like. + $.extend($.fn.tooltip.defaults, { + html: true, + animation: false, + placement: 'left', + container: 'body' + }); + $(document).tooltip({ + selector: '[data-toggle~="tooltip"]', + }); // See stupidtable.js for initialization of local table sorting }); @@ -146,3 +160,5 @@ function highlightRow(checkbox) { function setHiddenId(text, li) { $('hidden_id').value = li.id; } + + diff --git a/app/views/deliveries/_form.html.haml b/app/views/deliveries/_form.html.haml index c9bd8fcd..3e1a3b6c 100644 --- a/app/views/deliveries/_form.html.haml +++ b/app/views/deliveries/_form.html.haml @@ -61,8 +61,6 @@ return true; } }); - - enablePriceTooltips(); }); function mark_article_for_delivery(stock_article_id) { @@ -80,15 +78,6 @@ return ( 0 == $('#stock_change_stock_article_' + stock_article_id).length ); } - function enablePriceTooltips(context) { - $('[data-toggle~="tooltip"]', context).tooltip({ - animation: false, - html: true, - placement: 'left', - container: 'body' // or they become a cell in the table - }); - } - = simple_form_for [@supplier, @delivery], validate: true do |f| = f.error_notification = base_errors f.object diff --git a/app/views/deliveries/add_stock_change.js.erb b/app/views/deliveries/add_stock_change.js.erb index 3e233bb6..2d01bc68 100644 --- a/app/views/deliveries/add_stock_change.js.erb +++ b/app/views/deliveries/add_stock_change.js.erb @@ -13,7 +13,6 @@ var stock_change = $( '<%= j(render(:partial => 'stock_change', :locals => {:stock_change => @stock_change})) %>' ).addClass('success'); - enablePriceTooltips(stock_change); $('input.stock-change-quantity', stock_change).val(quantity); $('#stock_changes').append(stock_change); diff --git a/app/views/deliveries/create_stock_article.js.erb b/app/views/deliveries/create_stock_article.js.erb index 5e2893a9..cb9d0159 100644 --- a/app/views/deliveries/create_stock_article.js.erb +++ b/app/views/deliveries/create_stock_article.js.erb @@ -8,7 +8,6 @@ $('div.container-fluid').prepend( var stock_article_for_adding = $( '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article})) %>' ).addClass('success'); - enablePriceTooltips(stock_article_for_adding); $('#stock_articles_for_adding tbody').append(stock_article_for_adding); updateSort('#stock_articles_for_adding'); diff --git a/app/views/deliveries/update_stock_article.js.erb b/app/views/deliveries/update_stock_article.js.erb index ef46636d..7b2d56d6 100644 --- a/app/views/deliveries/update_stock_article.js.erb +++ b/app/views/deliveries/update_stock_article.js.erb @@ -10,7 +10,6 @@ $('div.container-fluid').prepend( var stock_article_for_adding = $( '<%= j(render(:partial => 'stock_article_for_adding', :locals => {:article => @stock_article, :delivery => @delivery})) %>' ).addClass('success'); - enablePriceTooltips(stock_article_for_adding); $('#stock_article_<%= @stock_article.id %>').replaceWith(stock_article_for_adding); updateSort('#stock_articles_for_adding'); diff --git a/app/views/stock_takings/new.html.haml b/app/views/stock_takings/new.html.haml index 6e4526f9..51239ba4 100644 --- a/app/views/stock_takings/new.html.haml +++ b/app/views/stock_takings/new.html.haml @@ -1,20 +1,5 @@ - title t('.title') -- content_for :javascript do - :javascript - $(function() { - enablePriceTooltips(); - }); - - function enablePriceTooltips(context) { - $('[data-toggle~="tooltip"]', context).tooltip({ - animation: false, - html: true, - placement: 'left', - container: 'body' - }); - } - - content_for :sidebar do %p %i= t('.text_deviations', inv_link: link_to(t('.temp_inventory'), stock_articles_path)).html_safe From 1afd8b83874d78bf492ab28637b92d896a2e900c Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 10 Oct 2013 17:47:12 +0200 Subject: [PATCH 13/18] bundle update --- Gemfile.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 83e3a43a..00e6eebe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -87,7 +87,7 @@ GEM coffee-script-source (1.6.3) commonjs (0.2.7) daemons (1.1.9) - database_cleaner (1.1.1) + database_cleaner (1.2.0) debug_inspector (0.0.2) diff-lcs (1.2.4) erubis (2.7.0) @@ -160,7 +160,7 @@ GEM mime-types (1.25) mini_portile (0.5.1) mono_logger (1.1.0) - multi_json (1.8.0) + multi_json (1.8.1) mysql2 (0.3.13) net-scp (1.1.2) net-ssh (>= 2.6.5) @@ -242,7 +242,7 @@ GEM ruby-prof (0.13.0) ruby-rc4 (0.1.5) rubyzip (0.9.9) - sass (3.2.11) + sass (3.2.12) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) @@ -297,7 +297,7 @@ GEM execjs rails (>= 3.1) railties (>= 3.1) - tzinfo (0.3.37) + tzinfo (0.3.38) uglifier (2.2.1) execjs (>= 0.3.0) multi_json (~> 1.0, >= 1.0.2) From d64590a534b15a2e44fe56795b2acd8972db6a3e Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 10 Oct 2013 17:49:06 +0200 Subject: [PATCH 14/18] more robustness --- app/models/ordergroup.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/ordergroup.rb b/app/models/ordergroup.rb index 6e1b65dc..0188abcf 100644 --- a/app/models/ordergroup.rb +++ b/app/models/ordergroup.rb @@ -66,7 +66,7 @@ class Ordergroup < Group end def avg_jobs_per_euro - stats[:orders_sum] != 0 ? stats[:jobs_size].to_f / stats[:orders_sum].to_f : 0 + stats[:jobs_size].to_f / stats[:orders_sum].to_f rescue 0 end # This is the ordergroup job per euro performance @@ -90,7 +90,7 @@ class Ordergroup < Group # Global average def self.avg_jobs_per_euro stats = Ordergroup.pluck(:stats) - stats.sum {|s| s[:jobs_size].to_f } / stats.sum {|s| s[:orders_sum].to_f } + stats.sum {|s| s[:jobs_size].to_f } / stats.sum {|s| s[:orders_sum].to_f } rescue 0 end def account_updated From 092bc6b1502a094d68273ad1528e90f6a508ca55 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 17 Oct 2013 15:32:03 +0200 Subject: [PATCH 15/18] translation updates --- config/locales/fr.yml | 1 + config/locales/nl.yml | 71 ++++++++++++++++++++++++------------------- 2 files changed, 40 insertions(+), 32 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index f9b71327..9fcefb99 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -507,6 +507,7 @@ fr: filename: Commande %{name}-%{date} - Répartition par cellules rows: - Nom de l'article + - Commandée - Quantité - Prix unitaire - Unités par lot diff --git a/config/locales/nl.yml b/config/locales/nl.yml index 2bef7df0..501ee0f1 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -42,10 +42,10 @@ nl: fc_price: prijs foodcoop fc_share: marge foodcoop gross_price: bruto prijs - name: - note: + name: Naam + note: Notitie price: netto prijs - supplier: + supplier: Leverancier tax: BTW unit: eenheid unit_quantity: groothandelseenheid @@ -332,7 +332,7 @@ nl: one: Er moet éen artikel bijgewerkt worden. other: Er moeten %{count} artikelen bijgewerkt worden. upload: - body: + body:

Het bestand moet een utf-8 tekstbestand zijn met als extensie '.csv'. De eerste regel wordt overgeslagen.

Velden moeten met een puntkomma (';') gescheiden worden, en tekst mag tussen dubbele aanhalingstekstens ("Tekst...") staan.

Volgende van de kolommen:

fields: season_amount: season_price: @@ -503,6 +503,7 @@ nl: filename: Bestelling %{name}-%{date} - Huishoudenslijst rows: - Artikel + - Besteld - Hoeveelheid - Prijs - Gr.Eenh. @@ -871,7 +872,7 @@ nl: remaining: nog %{remaining} title: Lopende bestellingen update: - error_general: + error_general: Er is een probleem opgetreden, de bestelling kon niet bijgewerkt worden. error_stale: In de tussentijd heeft iemand anders ook bestelt, daarom kon je bestelling niet opgeslagen worden. Sorry! notice: De bestelling is opgeslagen. helpers: @@ -913,8 +914,8 @@ nl: index: due_date_format: ! '%A %d %B' messages: - title: - view_all: + title: Nieuwste berichten + view_all: Alle berichten bekijken my_ordergroup: funds: ! '| Beschikbaar tegoed:' last_update: Laatst gewijzigd %{when} geleden @@ -944,7 +945,7 @@ nl: description: Omschrijving funds: ! 'Beschikbaar krediet:' invite: Iemand uitnodigen - people: + people: Personen search: Zoeken ... title: Mijn huishouden ordergroup_cancelled: Je bent geen lid meer van de groep %{group}. @@ -982,19 +983,25 @@ nl: write_message: Bericht schrijven invites: errors: - already_member: + already_member: is al lid van de foodcoop. modal_form: - body: - title: + body:

Hier kun je iemand die nog geen lid is uitnodigen voor de groep%{group}.

Na aanmelding is hij of zij automatisch lid van deze groep.

+ title: Iemand uitnodigen new: - action: - body: - success: + action: Uitnodiging versturen + body:

Hier kun je iemand die nog geen lid is, uitnodigen voor de groep %{group}.

+ success: Persoon is uitgenodigd. layouts: application1: title: Foodsoft - %{title} email: - footer: + footer: ! '-- + + Foodsoft: %{foodsoft} + + Foodcoop-Homepage: %{foodcoop} + + Help: %{help}' foodsoft: Foodsoft header: feedback: @@ -1011,7 +1018,7 @@ nl: page: Pagina %{number} login: accept_invitation: - body: + body:

Je bent uitgenodigd als lid voor foodcoop %{foodcoop} in de groep %{group}.

Als je wilt meedoen, vul dan dit formulier in.

Natuurlijk zullen we je informatie niet delen met anderen. Je kunt zelf aangeven, welke informatie voor andere leden beschikbaar is (maar beheerders hebben daar altijd toegang toe).

submit: Foodsoft account aanmaken title: Uitnodiging voor %{name} controller: @@ -1033,9 +1040,9 @@ nl: submit: Nieuw wachtwoord opslaan title: Nieuw wachtwoord mailer: - dateformat: + dateformat: ! '%d %b' feedback: - header: + header: ! '%{user} schreef op %{date}:' subject: foodsoft_message: footer: @@ -1107,21 +1114,21 @@ nl: new: list: desc: - mail: + mail: bijvoorbeeld door een email te sturen naar %{email}. subscribe: subscribe_msg: wiki: no_user_found: Geen gebruiker gevonden search: Zoeken ... search_user: Gebruiker zoeken - title: + title: Nieuw bericht show: - all_messages: - from: - reply: - sent_on: - subject: - title: + all_messages: Berichtenoverzicht + from: ! 'Van:' + reply: Antwoorden + sent_on: ! 'Verzonden:' + subject: ! 'Onderwerp:' + title: Bericht lezen model: delivery: each_stock_article_must_be_unique: In een levering mag ieder voorraadsartikel maar een keer voorkomen. @@ -1262,9 +1269,9 @@ nl: title: Artikel unit_quantity: index: - action_end: - confirm_delete: - confirm_end: + action_end: Sluiten + confirm_delete: Wil je de bestelling werkelijk verwijderen? + confirm_end: Wil je de bestelling %{order} werkelijk sluiten? Dit kun je niet ongedaan maken. ended_orders: Gesloten bestellingen ending: new_order: @@ -1285,11 +1292,11 @@ nl: title: orders: ending: - start: + start: Start status: - supplier: + supplier: Leverancier show: - action_end: + action_end: Sluiten! amounts: articles: articles_ordered: From 4e61e764dfdcd252d48f9390f216afd94fc10c29 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 17 Oct 2013 16:35:50 +0200 Subject: [PATCH 16/18] fix haml indentation errors --- app/views/shared/_open_orders.html.haml | 2 +- app/views/suppliers/_form.haml | 4 ++-- app/views/suppliers/show.haml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/shared/_open_orders.html.haml b/app/views/shared/_open_orders.html.haml index ebda2730..63259520 100644 --- a/app/views/shared/_open_orders.html.haml +++ b/app/views/shared/_open_orders.html.haml @@ -2,7 +2,7 @@ %h2= t '.title' - if ordergroup.not_enough_apples? .alert - = t '.not_enough_apples' + = t '.not_enough_apples' - unless Order.open.empty? %table.table.table-striped %thead diff --git a/app/views/suppliers/_form.haml b/app/views/suppliers/_form.haml index 09047bc1..93de2a97 100644 --- a/app/views/suppliers/_form.haml +++ b/app/views/suppliers/_form.haml @@ -1,7 +1,7 @@ = simple_form_for @supplier do |f| - if @supplier.shared_supplier - .alert.alert-success - = t 'suppliers.shared_supplier_note' + .alert.alert-info + = t 'suppliers.shared_supplier_note' = f.hidden_field :shared_supplier_id = f.input :name = f.input :address diff --git a/app/views/suppliers/show.haml b/app/views/suppliers/show.haml index 0a9417fe..f07b09c9 100644 --- a/app/views/suppliers/show.haml +++ b/app/views/suppliers/show.haml @@ -4,7 +4,7 @@ .span6 - if shared_supplier = @supplier.shared_supplier .alert.alert-info - = t 'suppliers.shared_supplier_note' + = t 'suppliers.shared_supplier_note' %dl.dl-horizontal %dt= t('simple_form.labels.supplier.address') + ':' From e1eb6031c83f9d5a64bc5693972556bc71f73fc2 Mon Sep 17 00:00:00 2001 From: wvengen Date: Thu, 17 Oct 2013 16:48:34 +0200 Subject: [PATCH 17/18] load fr translation for datepicker --- app/assets/javascripts/application.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index b8dc87e8..b8902ac3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -7,6 +7,7 @@ //= require bootstrap-datepicker/core //= require bootstrap-datepicker/locales/bootstrap-datepicker.de //= require bootstrap-datepicker/locales/bootstrap-datepicker.nl +//= require bootstrap-datepicker/locales/bootstrap-datepicker.fr //= require jquery.observe_field //= require list //= require list.unlist From bf0dc4af09190ef527e3e2bf382cf4b11483c569 Mon Sep 17 00:00:00 2001 From: wvengen Date: Fri, 18 Oct 2013 00:21:45 +0200 Subject: [PATCH 18/18] remove disfunctional dispatch cgis --- public/dispatch.cgi | 10 ---------- public/dispatch.fcgi | 26 -------------------------- public/dispatch.rb | 10 ---------- 3 files changed, 46 deletions(-) delete mode 100755 public/dispatch.cgi delete mode 100755 public/dispatch.fcgi delete mode 100755 public/dispatch.rb diff --git a/public/dispatch.cgi b/public/dispatch.cgi deleted file mode 100755 index 3848806d..00000000 --- a/public/dispatch.cgi +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/ruby1.8 - -require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) - -# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: -# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired -require "dispatcher" - -ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun) -Dispatcher.dispatch \ No newline at end of file diff --git a/public/dispatch.fcgi b/public/dispatch.fcgi deleted file mode 100755 index 91c4ed57..00000000 --- a/public/dispatch.fcgi +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/ruby1.8 -# -# You may specify the path to the FastCGI crash log (a log of unhandled -# exceptions which forced the FastCGI instance to exit, great for debugging) -# and the number of requests to process before running garbage collection. -# -# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log -# and the GC period is nil (turned off). A reasonable number of requests -# could range from 10-100 depending on the memory footprint of your app. -# -# Example: -# # Default log path, normal GC behavior. -# RailsFCGIHandler.process! -# -# # Default log path, 50 requests between GC. -# RailsFCGIHandler.process! nil, 50 -# -# # Custom log path, normal GC behavior. -# RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log' -# -RAILS_ENV = "production" - -require File.dirname(__FILE__) + "/../config/environment" -require 'fcgi_handler' - -RailsFCGIHandler.process! diff --git a/public/dispatch.rb b/public/dispatch.rb deleted file mode 100755 index 3848806d..00000000 --- a/public/dispatch.rb +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/ruby1.8 - -require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT) - -# If you're using RubyGems and mod_ruby, this require should be changed to an absolute path one, like: -# "/usr/local/lib/ruby/gems/1.8/gems/rails-0.8.0/lib/dispatcher" -- otherwise performance is severely impaired -require "dispatcher" - -ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun) -Dispatcher.dispatch \ No newline at end of file