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

Kiosk improvements

parent a14e95c0
Branches
Tags
No related merge requests found
Pipeline #
......@@ -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
......
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
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
......
......@@ -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="" -->
......
......@@ -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
......@@ -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}" %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment