From bbba67d7d5484e2eb05d59526ba5364362cc86cd Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 19 Oct 2013 00:31:36 -0400 Subject: [PATCH 1/2] remove trailing whitespace --- app/components/bike_brands.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/bike_brands.rb b/app/components/bike_brands.rb index 58c9341..a83e4c2 100644 --- a/app/components/bike_brands.rb +++ b/app/components/bike_brands.rb @@ -6,7 +6,7 @@ class BikeBrands < Netzke::Basepack::Grid c.prohibit_update = true if cannot? :update, BikeBrand c.prohibit_create = true if cannot? :create, BikeBrand - c.prohibit_delete = true if cannot? :delete, BikeBrand + c.prohibit_delete = true if cannot? :delete, BikeBrand end #override with nil to remove actions From 3faa19bc0cb696ddad17c70b6b599491de4abb83 Mon Sep 17 00:00:00 2001 From: Jason Denney Date: Sat, 19 Oct 2013 00:32:08 -0400 Subject: [PATCH 2/2] Adding min chars to forms --- app/components/bike_logs.rb | 2 +- app/components/bikes.rb | 8 ++++---- app/components/transaction_logs.rb | 2 +- app/components/user_logs.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/components/bike_logs.rb b/app/components/bike_logs.rb index e1aff13..1ebf97e 100644 --- a/app/components/bike_logs.rb +++ b/app/components/bike_logs.rb @@ -47,7 +47,7 @@ class BikeLogs < Netzke::Basepack::Grid { :name => :start_date}, { :name => :description}, #had to hack acts_as_loggable/log.rb to get this to work - { :name => :bike_action__action, :field_label => 'Action'} + { :name => :bike_action__action, :field_label => 'Action', :min_chars => 1 } ] end diff --git a/app/components/bikes.rb b/app/components/bikes.rb index 918fc0f..4199b5b 100644 --- a/app/components/bikes.rb +++ b/app/components/bikes.rb @@ -41,18 +41,18 @@ class Bikes < Netzke::Basepack::Grid def default_fields_for_forms # :field_label MUST be defined in order for search to work [ - { :name => :bike_brand__brand, :field_label => 'Brand' }, + { :name => :bike_brand__brand, :field_label => 'Brand', :min_chars => 1 }, { :name => :model, :field_label => 'Model'}, { :name => :shop_id, :field_label => 'Shop ID'}, { :name => :serial_number, :field_label => 'Serial Number'}, { :name => "color", :xtype => "xcolorcombo"}, - { :name => :bike_style__style, :field_label => 'Style' }, + { :name => :bike_style__style, :field_label => 'Style', :min_chars => 1}, { :name => :seat_tube_height, :field_label => 'Seat Tube (in)'}, { :name => :top_tube_length, :field_label => 'Top Tube (in)'}, { :name => :wheel_size, :field_label => 'Wheel Size (in)'}, { :name => :value, :field_label => 'Value'}, - { :name => :bike_condition__condition, :field_label => 'Condition'}, - { :name => :bike_purpose__purpose, :field_label => 'Purpose'} + { :name => :bike_condition__condition, :field_label => 'Condition', :min_chars => 1}, + { :name => :bike_purpose__purpose, :field_label => 'Purpose', :min_chars => 1} ] end #override with nil to remove actions diff --git a/app/components/transaction_logs.rb b/app/components/transaction_logs.rb index b0e07d3..076004d 100644 --- a/app/components/transaction_logs.rb +++ b/app/components/transaction_logs.rb @@ -49,7 +49,7 @@ class TransactionLogs < Netzke::Basepack::Grid { :no_binding => true, :xtype => 'displayfield', :fieldLabel => "Payment for:", :value => "#{item.to_s}"}, { :name => :description, :xtype => 'numberfield', :field_label => 'Amount'}, #had to hack acts_as_loggable/log.rb to get this to work - { :name => :transaction_action__action, :field_label => 'Payment Method'} + { :name => :transaction_action__action, :field_label => 'Payment Method', :min_chars => 1} ] end diff --git a/app/components/user_logs.rb b/app/components/user_logs.rb index 78a882a..7bfe16e 100644 --- a/app/components/user_logs.rb +++ b/app/components/user_logs.rb @@ -63,7 +63,7 @@ class UserLogs < Netzke::Basepack::Grid { :name => :end_date}, { :name => :description}, #had to hack acts_as_loggable/log.rb to get this to work - { :name => :user_action__action, :field_label => 'Action'}, + { :name => :user_action__action, :field_label => 'Action', :min_chars => 1}, { :name => :for_bike, :checkboxName => :copy_log, :inputValue => true, :title => "Copy description to a Bike's History?", :xtype => 'fieldset', :checkboxToggle => true, :collapsed => true, :items => [ {:xtype => 'combo', :no_binding => true, :name => :copy_id, :title => 'Bike', :fieldLabel => 'Bike', :store => bike_store, :value => bike_id} ]