index.html.erb 2.09 KB
Newer Older
Zac Wood's avatar
Zac Wood committed
1
2
3
4
5
6
<% if @courses.any? %>
    <%= render partial: 'shared/course', collection: @courses %>
<% else %>
    <h1>Sorry, we couldn't find anything matching your search.</h1>
    <p>Please try again!</p>
<% end %>
Zac Wood's avatar
Zac Wood committed
7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!-- Export Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
	<div class="modal-content">
	    <div class="modal-header">
		<h5 class="modal-title" id="exampleModalLabel">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">
		<button type="button" class="btn btn-secondary" onclick="downloadIcs()">Download calendar file</button>
		<button type="button" class="btn btn-primary" onclick="addToSystemCalendar()">Add to system calendar</button>
Zac Wood's avatar
Zac Wood committed
42
43
44
45
	    </div>
	</div>
    </div>
</div>
Zac Wood's avatar
Zac Wood committed
46
47
48
49
50
51
52

<%= javascript_tag do %>
    document.addEventListener('DOMContentLoaded', () => {
	this.schedule = new Schedule();
	this.search = new Search();
    });
<% end %>