show.html.erb 2.79 KB
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2
<%= javascript_include_tag 'schedules' %>
<%= stylesheet_link_tag 'schedules' %>
3

Zac Wood's avatar
Zac Wood committed
4 5 6 7 8 9
<%= javascript_include_tag 'moment.min' %>
<%= javascript_include_tag 'FileSaver' %>

<%= javascript_include_tag 'fullcalendar.min'%>
<%= stylesheet_link_tag 'fullcalendar.min' %>

Zac Wood's avatar
Zac Wood committed
10 11


Zac Wood's avatar
Zac Wood committed
12
<button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
13 14
    Generate Schedule
</button>
Zac Wood's avatar
Zac Wood committed
15
<div id="calendar"></div>
Zac Wood's avatar
Zac Wood committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<h3>Quick add</h3>
<p>Populate your calendar quickly by entering a comma separated list of CRNs.</p>
<form action="/sessions/add_bulk" class="form">
    <div class="input-group">
	<input
	    id="crns"
		name="crns"
		type="text"
		class="form-control"
		placeholder="12345,54321,..."
		aria-describedby="basic-addon2"
		autocomplete="off"
	>
	<div class="input-group-append">
	    <button type="submit" class="btn btn-primary" type="button">
		Populate Calendar
	    </button>
	</div>
    </div>
</form>
Zac Wood's avatar
Zac Wood committed
36 37 38

<template id="events" data-events="<%= @events.to_json %>"></template>

39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
<hr />
<h2>Selected Courses</h2>
<%= render partial: 'shared/section', collection: @all %>


<!-- Export Modal -->
<div class="modal fade" id="exportModal" tabindex="-1" role="dialog" aria-labelledby="exportModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
	<div class="modal-content">
	    <div class="modal-header">
		<h5 class="modal-title" id="exportModalLabel">Your calendar has been generated!</h5>
		<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		    <span aria-hidden="true">&times;</span>
		</button>
	    </div>
	    <div class="modal-body">
		<h5>Apple Calendar</h5>
		To add your schedule to Apple Calendar, click the "Add to calendar" button below. If you are on a device
		running macOS or iOS, this will open a dialogue which will walk you through adding the calendar.
		<hr />
		<h5>Google Calendar</h5>
		<strong>On desktop:</strong>
		<br />
		Open your <a href="https://calendar.google.com/">Google Calendar</a>. Click the "Settings" button in the top
		right, and then click the Settings tab. In the menu on the left, click "Add calendar" and "From URL". Now,
		paste the following link inside the text box: <br />
		<code id="calendar-link"></code>
		<br />
		<strong>On mobile (Android only):</strong>
		<br />
		Click the "Download calendar file" button. This will download the calendar file which you may then open and
		add to your calendar.
		<hr />
		<h5>.ics file</h5>
		To download a .ics file containing your schedule, click the "Download calendar file" button below.
	    </div>
	    <div class="modal-footer">
Zac Wood's avatar
Zac Wood committed
76 77
		<button id="download-ics" type="button" class="btn btn-secondary">Download calendar file</button>
		<button id="add-to-system" type="button" class="btn btn-primary">Add to system calendar</button>
78 79 80 81
	    </div>
	</div>
    </div>
</div>