Skip to content
Snippets Groups Projects
Commit 7fa4223d authored by Tyler Lemburg's avatar Tyler Lemburg
Browse files

Kiosk improvements

parent a14e95c0
No related branches found
No related tags found
No related merge requests found
...@@ -143,13 +143,9 @@ get '/' do ...@@ -143,13 +143,9 @@ get '/' do
end end
get '/kiosk-logout/' do 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 => { erb :kiosk_logout, :layout => :fixed, :locals => {
url_redirect: params[:url_redirect] url_redirect: params[:url_redirect],
kiosk_mode: 'true'
} }
end end
......
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
...@@ -60,14 +60,13 @@ get '/:service_space_url_name/resources/:resource_id/calendar/?' do ...@@ -60,14 +60,13 @@ get '/:service_space_url_name/resources/:resource_id/calendar/?' do
end end
end end
puts session.inspect
erb :resource_calendar, :layout => :fixed, :locals => { erb :resource_calendar, :layout => :fixed, :locals => {
:date => date, :date => date,
:sunday => sunday, :sunday => sunday,
:reservations => reservations, :reservations => reservations,
:resource => resource, :resource => resource,
:week_hours => week_hours :week_hours => week_hours,
:kiosk_mode => params[:kiosk_mode]
} }
end end
...@@ -127,7 +126,8 @@ get '/:service_space_url_name/resources/:resource_id/reserve/?' do ...@@ -127,7 +126,8 @@ get '/:service_space_url_name/resources/:resource_id/reserve/?' do
:available_start_times => available_start_times, :available_start_times => available_start_times,
:space_hour => space_hour, :space_hour => space_hour,
:day => date, :day => date,
:reservation => nil :reservation => nil,
:kiosk_mode => params[:kiosk_mode]
} }
end end
...@@ -229,7 +229,7 @@ post '/:service_space_url_name/resources/:resource_id/reserve/?' do ...@@ -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')}") 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 end
......
...@@ -16,6 +16,9 @@ ...@@ -16,6 +16,9 @@
<!-- InstanceBeginEditable name="head" --> <!-- InstanceBeginEditable name="head" -->
<!-- Place optional header elements here --> <!-- Place optional header elements here -->
<link rel="stylesheet" href="/css/resource_scheduler.css"> <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> <script type="text/javascript">WDN.initializePlugin("notice");</script>
<!-- InstanceEndEditable --> <!-- InstanceEndEditable -->
<!-- InstanceParam name="class" type="text" value="" --> <!-- InstanceParam name="class" type="text" value="" -->
......
...@@ -187,9 +187,12 @@ WDN.initializePlugin('jqueryui', [function() { ...@@ -187,9 +187,12 @@ WDN.initializePlugin('jqueryui', [function() {
$('.datepicker').datepicker(); $('.datepicker').datepicker();
$("LINK[href^='//unlcms.unl.edu/wdn/templates_4.0/scripts/plugins/ui/css/jquery-ui.min.css']").remove(); $("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 () { $('#date').change(function () {
var date = $('#date').val().split('/'); 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> </script>
\ No newline at end of file
...@@ -2,19 +2,21 @@ ...@@ -2,19 +2,21 @@
reservation.start_time.in_time_zone.strftime("%Y/%m/%d") reservation.start_time.in_time_zone.strftime("%Y/%m/%d")
end %> 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"> <div id="pagetitle">
<h3> <h3>
<%= resource.name %> Calendar <%= resource.name %><span class="wdn-subhead">Calendar</span>
</h3> </h3>
</div> </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;"> <div style="margin-bottom: 16px;">
<h4 style="text-align: center; margin: 0;"> <h4 style="text-align: center; margin: 0;">
<%= month = sunday.strftime('%B %Y') %><%= (month2 = (sunday+6.days).strftime('%B %Y')) == month ? '' : " - #{month2}" %> <%= month = sunday.strftime('%B %Y') %><%= (month2 = (sunday+6.days).strftime('%B %Y')) == month ? '' : " - #{month2}" %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment