mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-02-28 16:53:23 -05:00
Allow user select bike worked when adding time
This commit is contained in:
parent
3e56f2eb19
commit
b30203b750
@ -1,7 +1,11 @@
|
|||||||
class TimeEntriesController < AuthenticatedController
|
class TimeEntriesController < AuthenticatedController
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@bikes = Bike.all.map{ |b| [b.to_s , b.id] }
|
||||||
|
if bike = current_user.bike
|
||||||
|
@bikes.unshift( [bike.to_s, bike.id] )
|
||||||
|
end
|
||||||
|
@bikes.unshift( ["Non-bike work", -1] )
|
||||||
end
|
end
|
||||||
|
|
||||||
def index
|
def index
|
||||||
|
@ -31,8 +31,7 @@
|
|||||||
.control-group
|
.control-group
|
||||||
.controls
|
.controls
|
||||||
%label
|
%label
|
||||||
Worked on a bike?
|
= select_tag(:bike_brand_id, options_for_select(@bikes))
|
||||||
%input{ type: "checkbox"}
|
|
||||||
.control-group
|
.control-group
|
||||||
.controls
|
.controls
|
||||||
%textarea{id: "work_description", placeholder: "Work description", class: "input-lg" }
|
%textarea{id: "work_description", placeholder: "Work description", class: "input-lg" }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user