Skip to content
Snippets Groups Projects
Commit a5b3a3d5 authored by Michael Fairchild's avatar Michael Fairchild
Browse files

Default to the saved reservation length when editing

parent 9c0ccd0f
Branches
No related tags found
No related merge requests found
......@@ -179,11 +179,12 @@ EIGHT_PM_MINUTES = 1200 # end time of calendar
<% else resource.minutes_per_reservation.nil? %>
<select id="reservation-length" name="length">
<% (1..3).each do |i| %>
<option value="<%=i*15%>"><%=i*15%> minutes</option>
<% min = i*15 %>
<option value="<%=min%>" <%= (!reservation.nil? && reservation.length == min)? "selected" : "" %>><%=min%> minutes</option>
<% end %>
<option value="60" selected>1 hour</option>
<option value="90">1.5 hours</option>
<option value="120">2 hours</option>
<option value="60" <%= (reservation.nil? || reservation.length == 60)? "selected" : "" %>>1 hour</option>
<option value="90" <%= (!reservation.nil? && reservation.length == 90)? "selected" : "" %>>1.5 hours</option>
<option value="120" <%= (!reservation.nil? && reservation.length == 120)? "selected" : "" %>>2 hours</option>
</select>
<% end %>
<label for="title">Name of Reservation: (e.g. "Group Meeting")</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment