diff --git a/app.rb b/app.rb index 3836dc6301efde4037345177f0ca298805f50b31..13e525bf3956fe7abe340da3a29aee3d8132405c 100644 --- a/app.rb +++ b/app.rb @@ -143,13 +143,9 @@ get '/' do end get '/kiosk-logout/' do - ticket = session['cas'] ? session['cas']['ticket'] : nil - - Session.delete_all(cas_ticket: ticket) - - session.send (session.respond_to?(:destroy) ? :destroy : :clear) erb :kiosk_logout, :layout => :fixed, :locals => { - url_redirect: params[:url_redirect] + url_redirect: params[:url_redirect], + kiosk_mode: 'true' } end diff --git a/public/css/kiosk.css b/public/css/kiosk.css new file mode 100644 index 0000000000000000000000000000000000000000..e04028aef3b3031063c7d309196e0cc193a7714e --- /dev/null +++ b/public/css/kiosk.css @@ -0,0 +1,23 @@ +header { + display: none; +} + +#wdn_navigation_bar { + display: none; +} + +.wdn-menu-trigger.wdn-content-slide { + display: none; +} + +#wdn_content_wrapper { + padding-top: 0px; +} + +#wdn_optional_footer, #wdn_local_footer, #wdn_global_footer { + display: none; +} + +#visitorChat { + display: none; +} \ No newline at end of file diff --git a/routes/resources.rb b/routes/resources.rb index bf682f06d355941d91458a4891678e5d04217409..5dc56fb2d85002936c9dad2b771ca40f33ef98d2 100644 --- a/routes/resources.rb +++ b/routes/resources.rb @@ -60,14 +60,13 @@ get '/:service_space_url_name/resources/:resource_id/calendar/?' do end end - puts session.inspect - erb :resource_calendar, :layout => :fixed, :locals => { :date => date, :sunday => sunday, :reservations => reservations, :resource => resource, - :week_hours => week_hours + :week_hours => week_hours, + :kiosk_mode => params[:kiosk_mode] } end @@ -127,7 +126,8 @@ get '/:service_space_url_name/resources/:resource_id/reserve/?' do :available_start_times => available_start_times, :space_hour => space_hour, :day => date, - :reservation => nil + :reservation => nil, + :kiosk_mode => params[:kiosk_mode] } end @@ -229,7 +229,7 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do ) flash(:success, 'Reservation Created', "You have successfully reserved #{resource.name} for #{params[:length]} minutes at #{start_time.in_time_zone.strftime('%A, %B %d at %l:%M %P')}") - redirect "/#{@space.url_name}/resources/#{resource.id}/calendar/" + redirect "/#{@space.url_name}/resources/#{resource.id}/calendar/#{params[:kiosk_mode] ? '?kiosk_mode=true' : ''}" end diff --git a/views/fixed.erb b/views/fixed.erb index 9d7893df4badc281e4e67fb6880c432cce2e9b4f..92f39998d5c40ced4704ed865835b21f1b43548e 100644 --- a/views/fixed.erb +++ b/views/fixed.erb @@ -16,6 +16,9 @@ <!-- InstanceBeginEditable name="head" --> <!-- Place optional header elements here --> <link rel="stylesheet" href="/css/resource_scheduler.css"> +<% if defined?(kiosk_mode) && kiosk_mode == 'true' %> +<link rel="stylesheet" href="/css/kiosk.css"> +<% end %> <script type="text/javascript">WDN.initializePlugin("notice");</script> <!-- InstanceEndEditable --> <!-- InstanceParam name="class" type="text" value="" --> diff --git a/views/reserve.erb b/views/reserve.erb index b791fe303e57bc24a1bf21229c84ae5b68c7c8df..5d4c883b160a9223f1b1fbb99983e57fafb586e8 100644 --- a/views/reserve.erb +++ b/views/reserve.erb @@ -187,9 +187,12 @@ WDN.initializePlugin('jqueryui', [function() { $('.datepicker').datepicker(); $("LINK[href^='//unlcms.unl.edu/wdn/templates_4.0/scripts/plugins/ui/css/jquery-ui.min.css']").remove(); + // kiosk mode? + var kiosk_mode = <%= defined?(kiosk_mode) && kiosk_mode == 'true' ? 'true' : 'false' %> + $('#date').change(function () { var date = $('#date').val().split('/'); - window.location = window.location.href.split('?')[0] + '?date=' + date[2] + '-' + date[0] + '-' + date[1]; + window.location = window.location.href.split('?')[0] + '?date=' + date[2] + '-' + date[0] + '-' + date[1] + (kiosk_mode ? '&kiosk_mode=true' : ''); }); }]); </script> \ No newline at end of file diff --git a/views/resource_calendar.erb b/views/resource_calendar.erb index dd9f514170d919323e495bebaea385295cc18618..4ba6dd4b9ac19efe36641e6b56e74c8be131cad5 100644 --- a/views/resource_calendar.erb +++ b/views/resource_calendar.erb @@ -2,19 +2,21 @@ reservation.start_time.in_time_zone.strftime("%Y/%m/%d") end %> +<% if kiosk_mode %> +<div style="margin-bottom: 1em; text-align: right;"> + <% if @user %> + <a style="font-size: 1.5em;" class="wdn-button wdn-button-triad" href="/kiosk-logout/?url_redirect=<%= url_encode("/#{@space.url_name}/resources/#{resource.id}/calendar/?kiosk_mode=true") %>">Log Out</a> + <% end %> + <a style="font-size: 1.5em;" class="wdn-button wdn-button-brand" href="/<%= @space.url_name %>/resources/<%= resource.id %>/reserve/?kiosk_mode=true">Reserve Me!</a> +</div> +<% end %> + <div id="pagetitle"> <h3> - <%= resource.name %> Calendar + <%= resource.name %><span class="wdn-subhead">Calendar</span> </h3> </div> -<div style="position: absolute; top: 1em; right: 1em; text-align: right;"> - <% if @user %> - <a style="font-size: 1.5em;" class="wdn-button wdn-button-triad" href="/kiosk-logout/?url_redirect=<%= url_encode("/#{@space.url_name}/resources/#{resource.id}/calendar/") %>">Log Out</a> - <% end %> - <a style="font-size: 1.5em;" class="wdn-button wdn-button-brand" href="/<%= @space.url_name %>/resources/<%= resource.id %>/reserve/">Reserve Me!</a> -</div> - <div style="margin-bottom: 16px;"> <h4 style="text-align: center; margin: 0;"> <%= month = sunday.strftime('%B %Y') %><%= (month2 = (sunday+6.days).strftime('%B %Y')) == month ? '' : " - #{month2}" %>