This commit is contained in:
John N. Milner
2013-04-04 22:27:54 -04:00
parent a7b8651314
commit 55fbd06305
9 changed files with 15 additions and 9 deletions
+1
View File
@@ -4,6 +4,7 @@ class Bikes < Netzke::Basepack::Grid
c.model = "Bike"
c.columns = [
{ :name => :shop_id, :text => 'Shop ID'},
:serial_number,
{ :name => :bike_brand__brand, :text => 'Brand' },
{ :name => :bike_model__model, :text => 'Model',
+2 -2
View File
@@ -10,7 +10,7 @@ class Transactions < Netzke::Basepack::Grid
c.columns = [
:amount,
:item,
{ :name => :bike__serial_number},
{ :name => :bike__shop_id},
{ :name => :vendor, :getter => lambda { |rec|
user = rec.vendor
user.nil? ? "" : "#{user.first_name} #{user.last_name}"
@@ -27,7 +27,7 @@ class Transactions < Netzke::Basepack::Grid
end
def default_fields_for_forms
bike_store = Bike.all.map { |b| [b.id, b.serial_number] }
bike_store = Bike.all.map { |b| [b.id, b.shop_id] }
user_store = User.all.map { |u| [u.id, u.to_s] }
customer = nil
if session[:selected_customer_type] == "User"
+1 -1
View File
@@ -50,7 +50,7 @@ class UserLogs < Netzke::Basepack::Grid
def default_fields_for_forms
#figure out a better way to do this
bike_store = Bike.all.map { |b| [b.id, b.serial_number] }
bike_store = Bike.all.map { |b| [b.id, b.shop_id] }
current_user ||= User.find_by_id(session[:selected_user_id]) || controller.current_user
bike_id = current_user.bike.nil? ? nil : current_user.bike.id
action_id = current_user.user_role.id
+1 -1
View File
@@ -6,7 +6,7 @@ class UserStats < Netzke::Base
<div id="user_stats_page">
<p>Total Hours Worked: #{user.total_hours}</p>
<p>Hours worked in #{Time.now.strftime('%B')}: #{user.current_month_hours}</p>
<p>Current bike ID: #{bike.id if bike}</p>
<p>Current bike Shop ID: #{bike.shop_id if bike}</p>
<p>Current bike S/N: #{bike.serial_number if bike}</p>
</div>
)
+1 -1
View File
@@ -10,7 +10,7 @@ class UserTransactions < Netzke::Basepack::Grid
c.columns = [
:amount,
:item,
{ :name => :bike__serial_number},
{ :name => :bike__shop_id},
{ :name => :vendor, :getter => lambda { |rec|
user = rec.vendor
user.nil? ? "" : "#{user.first_name} #{user.last_name}"
+1 -1
View File
@@ -10,7 +10,7 @@ class Users < Netzke::Basepack::Grid
:nickname,
:email,
:user_role__role,
:bike__serial_number
:bike__shop_id
]
end