diff --git a/routes/resources.rb b/routes/resources.rb index 9759c3bd8590902e2335c46c193235e313695422..da71f78ac8c638bdc1edeaa7a9d462b704ae9a6d 100644 --- a/routes/resources.rb +++ b/routes/resources.rb @@ -233,9 +233,10 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do # use the recurring type to increment the date here starts = [] - if params[:recurring_type] == 'weekly' || params[:recurring_type] == 'biweeekly' + if %w(daily weekly biweekly).include?(params[:recurring_type]) inc = 7.days - inc = 14.days if params[:recurring_type] == 'biweeekly' + inc = 14.days if params[:recurring_type] == 'biweekly' + inc = 1.day if params[:recurring_type] == 'daily' new_start = start_time.dup while (new_start = new_start + inc) <= recurs_until_date + 1.day # reset in case we moved past DST change @@ -413,7 +414,12 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do flash :success, 'Recurring Reservations Created', "You have created #{successful+1} total reservations." end unless messages.empty? - flash :alert, 'Some recurring reservations were not created', "<ul><li>#{messages.join('</li><li>')}</li></ul>" + if params[:recurring_type] == 'daily' + flash :alert, 'Some recurring reservations were not created', "#{messages.count} recurring reservations were not made. This may be just because the space is closed for certain days." + puts messages + else + flash :alert, 'Some recurring reservations were not created', "<ul><li>#{messages.join('</li><li>')}</li></ul>" + end end end diff --git a/views/reserve.erb b/views/reserve.erb index 11a1af7e797264c1855879abe308b53504c97a15..e142df403db4aa1b5bb53587a052118a20f1f395 100644 --- a/views/reserve.erb +++ b/views/reserve.erb @@ -184,6 +184,7 @@ end %> <label for="recurring">Make this reservation recur</label> <div id="recurring-container" class="date-time-select" style="display: none;"> <select id="recurring-type" name="recurring_type"> + <option value="daily">Daily</option> <option value="weekly">Weekly</option> <option value="biweekly">Biweekly</option> <optgroup label="Monthly" id="monthly-group">