/
depart.html.erb
31 lines (22 loc) · 1.13 KB
/
depart.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<div class="row offset2">
<h1>Depart Bike <%= link_to bike.number, bike %> </h1>
<br />
<!-- <%= render :partial=>"bike_table", :layout=>"bike_table_layout" %> -->
<% if !bike.departed? %>
<% if bike.project.nil? %>
<h3>Action required</h3>
<p>Bike <%= bike.number %> does not have a project assigned. A project assignment is required for all departing bikes.</p>
<%= form_for(project, :url => projects_path, :method => :post) do |f| %>
<%= hidden_field_tag(:bike_id, bike.id) %>
<%= label_tag(:program_id, "Depart bike as:") %>
<%= select_tag(:program_id, options_from_collection_for_select(Program.terminal, :id, :title)) %>
<%= f.submit "Assign to program", :class => "btn btn-primary" %>
<% end %>
</p>To assign this bike to a program not listed above, go <%= link_to "to the bike information page", bike %>.</p>
<% else # if bike.project.nil? %>
<h3>Action required</h3>
<p>The project must be finished to depart this bike.</p>
<p><%= link_to "Go to the project page to finish and close out the project", bike.project %></p>
<% end # bike.project.nil? %>
<% end #bike.departed? %>
</div>