1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-04-04 05:33:22 -04:00
BikeShed-1/app/components/user_profiles.rb
Jason Denney 189137ba9d Almost usable, still a lot of work left
-Moved bikes to User model instead of profile
-User can copy user log to a bike log with new actsasloggable
-Added user stats
-some css was messing up checkboxes, need to figure out which stylesheet was doing that
2012-12-31 15:38:34 -05:00

32 lines
809 B
Ruby

class UserProfiles < Netzke::Basepack::Grid
def configure(c)
super
if controller.current_user.user?
user_profiles_scope = lambda { |rel| rel.where(:user_id => controller.current_user.id);}
user_profiles_data_store = { auto_load: true }
else
user_profiles_scope = lambda { |rel| puts session.inspect; rel.where(:user_id => session[:selected_user_id]);}
user_profiles_data_store = { auto_load: false}
end
c.model = "UserProfile"
c.title = "Profile"
c.data_store = user_profiles_data_store
c.scope = user_profiles_scope
c.columns = [
:addrStreet1,
:addrStreet2,
:addrCity,
:addrState,
:addrZip,
:phone
]
end
#override with nil to remove actions
def default_bbar
[ :apply, :add_in_form ]
end
end