mirror of https://github.com/fspc/BikeShed-1.git
Jason Denney
12 years ago
5 changed files with 37 additions and 4 deletions
@ -0,0 +1,10 @@ |
|||||
|
class BikeLogsAndTasksAccordian < Netzke::Basepack::Accordion |
||||
|
component :bike_logs |
||||
|
component :tasks |
||||
|
|
||||
|
def configure(c) |
||||
|
c.prevent_header = true |
||||
|
c.items = [ :bike_logs, :tasks ] |
||||
|
super |
||||
|
end |
||||
|
end |
@ -0,0 +1,19 @@ |
|||||
|
class Tasks < Netzke::Basepack::Grid |
||||
|
def configure(c) |
||||
|
super |
||||
|
c.model = "Task" |
||||
|
c.scope = lambda{ |rel| |
||||
|
if session[:selected_bike_id] |
||||
|
rel.where(:task_list_id => Bike.find_by_id(session[:selected_bike_id]).task_list.id) |
||||
|
else |
||||
|
#show nothing, whatever this works |
||||
|
rel.where(:task_list_id => 0) |
||||
|
end |
||||
|
} |
||||
|
end |
||||
|
|
||||
|
#override with nil to remove actions |
||||
|
def default_bbar |
||||
|
[ :apply, :add_in_form] |
||||
|
end |
||||
|
end |
Loading…
Reference in new issue