bus_booking/app/views/admin/bus_bookings/reserve.html.erb

40 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-06-23 11:23:18 +00:00
<% if @already_reserved %>
<% booking = @already_booked.first %>
<div class="already-reserved">
<h4><%= t("bus_booking.already_reserved") %></h4>
<h3><%= @bus.bus_route %></h3>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td><%= t("bus_booking.registered_date") %></td>
<td><%= booking.created_at.strftime("%Y/%m/%d") %></td>
</tr>
<tr>
<td><%= t("bus_booking.name") %></td>
<td><%= booking.name %></td>
</tr>
<tr>
<td><%= t("bus_booking.email") %></td>
<td><%= booking.email %></td>
</tr>
<tr>
<td><%= t("bus_booking.department") %></td>
<td><%= booking.department %></td>
</tr>
<tr>
<td><%= t("bus_booking.dorm_number") %></td>
<td><%= booking.dorm_number %></td>
</tr>
</tbody>
</table>
<% if ((@bus.departure_time - 1.hour) > Time.now rescue true) %>
<a href="<%= admin_bus_booking_cancel_path(booking) %>" class="btn btn-danger" data-method="delete" data-confirm="Are you sure?"><%= t("bus_booking.cancel_reservation") %></a>
<% end %>
2016-06-23 11:23:18 +00:00
</div>
<% else %>
<%= form_for @bus_booking, url: "/admin/bus_bookings/bookbus", html: {class: "form-horizontal main-forms"} do |f|%>
<fieldset>
<%= render :partial => 'bus_booking_form', locals: {f: f} %>
</fieldset>
<% end %>
<% end %>