Commit d213fe83 authored by Zac Wood's avatar Zac Wood
Browse files

Merge branch 'dev-v3' into 'master'

Version 3

See merge request !51
parents b6309e4e 80cf9394
Pipeline #4473 passed with stage
in 2 minutes and 47 seconds
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
<div class="col-12 col-lg"> <div class="col-12 col-lg">
<h1><%= @course.full_name %></h1> <h1><%= @course.full_name %></h1>
<h4><%= @course.title %></h4> <h4><%= @course.title %></h4>
<% unless @rating.nil? %>
<%= render partial: 'shared/stars', locals: { percent: @course.rating[0]/5*100 } %>
Average course rating: <%= @course.rating[0] %> / <%= @course.rating[1] %> responses
<% end %>
<div class="d-flex"> <div class="d-flex mt-2">
<div class="attr-list justify-content-start"> <div class="attr-list justify-content-start">
<div class="attr"> <div class="attr">
<div class="icon"> <div class="icon">
...@@ -20,7 +24,7 @@ ...@@ -20,7 +24,7 @@
</div> </div>
</div> </div>
</div> </div>
<p><%= @course.description %></p> <p class="mt-3"><%= @course.description %></p>
</div> </div>
<div class="col-12 col-lg"> <div class="col-12 col-lg">
...@@ -29,5 +33,5 @@ ...@@ -29,5 +33,5 @@
</div> </div>
<%= javascript_pack_tag 'search' %> <%= javascript_pack_tag 'instructor' %>
<%= stylesheet_link_tag 'search' %> <%= stylesheet_link_tag 'search' %>
<div class="jumbotron text-center"> <div class="jumbotron text-center">
<h1>SRCT Schedules</h1> <h1><i class="fas fa-calendar-alt"></i>&nbsp;SRCT Schedules</h1>
<p class="lead">Build, share, and export your schedule. Search for classes and professors.</p> <p class="lead">Build, share, and export your schedule. Search for classes and professors.</p>
<hr> <hr>
<p> <p>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
</p> </p>
</div> </div>
<div class="row"> <div class="row ">
<div class="col-md-4"> <div class="col-md-4">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
...@@ -36,24 +36,6 @@ ...@@ -36,24 +36,6 @@
</div> </div>
</div> </div>
<div id="quick-add" />
<h3 class="quick-add-header">Quick add</h3> <%= javascript_pack_tag 'home' %>
<p>Want to quickly generate a calendar populated with your semester's classes? Enter the CRNs in a comma separated list below.</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>
<div class="row"> <div class="row">
<div class="col-lg-4 col-12"> <div class="col-lg-4 col-12 mb-4">
<h1><%= @instructor.name %></h1> <h1><%= @instructor.name %></h1>
<% if @past.count.positive? %>
<strong>Previously taught: </strong> <% unless @rating[:teaching].nil? %>
<ul> <%= render partial: 'shared/stars', locals: { percent: @rating[:teaching][0]/5*100 } %><br>
<% @past.each do |c| %> Average teaching rating: <%= @rating[:teaching][0] %> / <%= @rating[:teaching][1] %> responses
<li><%= link_to(c.full_name, course_path(c)) %></li>
<% end %>
</ul>
<% end %> <% end %>
</div> </div>
<div class ="col-lg-8 col-12"> <div class="col-lg-8 col-12">
<h3><%= @semester.to_s %></h3> <% @semesters.each do |semester, sections| %>
<% if @courses.any? %> <h2><%= semester %></h2>
<%= render(partial: 'shared/course', collection: @courses, locals: { expanded: true }) %> <%= render(partial: 'shared/section', collection: sections, locals: { show_instr: false }) %>
<% else %> <br/>
<p><%= @instructor.name %> is not teaching any courses this semester...</p>
<% end %> <% end %>
</div> </div>
</div> </div>
<%= javascript_pack_tag 'search' %> <%= javascript_pack_tag 'instructor' %>
<%= stylesheet_link_tag 'search' %> <%= stylesheet_link_tag 'search' %>
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<%= csrf_meta_tags %> <%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= Gon::Base.render_data %>
<%= javascript_include_tag 'masonstrap.min' %> <%= javascript_include_tag 'masonstrap.min' %>
<%= stylesheet_link_tag 'masonstrap.min' %> <%= stylesheet_link_tag 'masonstrap.min' %>
...@@ -16,7 +18,7 @@ ...@@ -16,7 +18,7 @@
<meta property="og:url" content="https://schedules.gmu.edu/"> <meta property="og:url" content="https://schedules.gmu.edu/">
<meta property="og:type" content="website"> <meta property="og:type" content="website">
<meta property="og:title" content="SRCT Schedules"> <meta property="og:title" content="SRCT Schedules">
<meta property="og:description" content="Easily generate a calendar with your class schedule."> <meta property="og:description" content="Browse the GMU catalog, see course reviews, build and share your schedule.">
<meta property="og:site_name" content="SRCT Schedules"> <meta property="og:site_name" content="SRCT Schedules">
<meta property="og:locale" content="en_US"> <meta property="og:locale" content="en_US">
<meta property="article:author" content="SRCT"> <meta property="article:author" content="SRCT">
...@@ -27,7 +29,11 @@ ...@@ -27,7 +29,11 @@
<meta name="twitter:creator" content="@MasonSRCT"> <meta name="twitter:creator" content="@MasonSRCT">
<meta name="twitter:url" content="https://schedules.gmu.edu/"> <meta name="twitter:url" content="https://schedules.gmu.edu/">
<meta name="twitter:title" content="SRCT Schedules"> <meta name="twitter:title" content="SRCT Schedules">
<meta name="twitter:description" content="Easily generate a calendar with your class schedule."> <meta name="twitter:description" content="Browse the GMU catalog, see course reviews, build and share your schedule.">
<!-- favicons -->
<%= favicon_link_tag %>
<link href="<%= asset_path 'favicon-32x32.png' %>" sizes="32x32" rel="shortcut icon" type="image/png" />
</head> </head>
<body> <body>
......
<%= javascript_pack_tag 'schedules' %> <%= javascript_pack_tag 'schedules' %>
<%= stylesheet_link_tag 'schedules' %> <%= stylesheet_link_tag 'schedules' %>
<%= javascript_include_tag 'moment.min' %> <div id="root"></div>
<%= stylesheet_link_tag 'fullcalendar.min' %>
<button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
Export Schedule
</button>
<button id="save-image" class="btn btn-secondary">Save Image</button>
<div id="calendar"></div>
<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>
<h3 id="share-header">Share</h3>
Want to share your schedule with your friends? Send them this link:<br/>
<a id="share-url"></a>
<template id="events" data-events="<%= @events.to_json %>"></template>
<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 />
First, download the calendar file using the "Download calendar file" below. Open your <a href="https://calendar.google.com/" target="_blank">Google Calendar</a>. Click the "Settings" button in the top
right, and then click the Settings tab. In the menu on the left, click "Import & export" and "Import". Now, upload the calendar file you downloaded and click "Import".
<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>Outlook Calendar</h5>
<strong>On desktop (Windows):</strong>
<br>
First, download the calendar file using the “Download calendar file” button below. In Outlook, choose File, then Open and Export, and then Import/Export. In the Import and Export Wizard Box, choose “Import and iCalendar (.ics) or vCalendar file (.vcs)” and the “next” button. Search for the button you downloaded in the beginning. Click “Okay” and then “Import.”
<br>
<strong>On desktop (Mac):</strong>
First, download the calendar file using the “Download calendar file” button below. Open Outlook and make sure the calendar in which you want to import the file into has a checkmark next to it. Alternatively, you can add it into a new calendar by clicking the “Organize” tab and then the “New Calendar” button. Double click the new Calendar to rename it. Open the Finder application and search for the file you downloaded in the beginning. Then, drag and drop the file into the desired Calendar area.
<br>
<strong>Outlook Online (Classic Layout)</strong>
To check if you are using the Classic Layout, look in the top right and see if “The new Outlook” bar is slid to the left. If it is not, you may consider reading “The New Outlook Layout” instructions or clicking the bar to slide it to the left. First, download the calendar file using the “Download calendar file” button below. Login onto your <a href=https://outlook.live.com/owa/ target="blank">Outlook</a> and click the calendar icon on the bottom left. On the menu bar, located above the Calendar, choose the “Add Calendar” menu. From the drop down menu, click import from file and browse for the calendar file you downloaded in the beginning. Click the save icon, then the calendar will be imported.
<br>
<strong>Outlook Online (New Outlook Layout)</strong>
To check if you are using the New Outlook Layout, look in the top right and see if “The new Outlook” bar is slid to the right. If it is not, you may consider reading the “Classic Layout” instructions or clicking the bar to slide it to the right. First download the calendar file using the “Download calendar file” button below. Login onto your <a href=https://outlook.live.com/owa/ target="blank">Outlook</a> and click the calendar icon on the bottom left. On the left side bar, under “Calendars”, click the “Discover calendars” button. Choose on the “From File” menu under the “Import” Section. Then click the browse button and search for the file you downloaded in the beginning. Lastly, choose “Import” and your calendar will be displayed.
<h5>.ics file</h5>
To download a .ics file containing your schedule, click the "Download calendar file" button below.
</div>
<div class="modal-footer flex">
<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>
</div>
</div>
</div>
</div>
<%= javascript_pack_tag 'schedules_view' %> <%= javascript_pack_tag 'schedules_view' %>
<%= stylesheet_link_tag 'schedules' %> <%= stylesheet_link_tag 'schedules' %>
<%= stylesheet_link_tag 'fullcalendar.min' %>
<div id="root"></div>
<button id="open-modal-btn" type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
Export Schedule
</button>
<button id="save-image" class="btn btn-secondary" onclick="saveImage()">Save Image</button>
<div id="calendar"></div>
<template id="events" data-events="<%= @events.to_json %>"></template>
<hr />
<h2>Selected Courses</h2>
<%= render partial: 'shared/section', collection: @all, locals: { editable: false } %>
<!-- 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 />
First, download the calendar file using the "Download calendar file" below. Open your <a href="https://calendar.google.com/" target="_blank">Google Calendar</a>. Click the "Settings" button in the top
right, and then click the Settings tab. In the menu on the left, click "Import & export" and "Import". Now, upload the calendar file you downloaded and click "Import".
<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 flex">
<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>
</div>
</div>
</div>
</div>
<% unless @instructors.nil? %> <div id="root"></div>
<h2>Instructors</h2>
<div class="row">
<% @instructors.each do |instructor| %>
<div class="col"><%= render partial: 'shared/instructor', object: instructor %></div>
<% end %>
</div>
<hr />
<% end %>
<% unless @courses.nil? %>
<h2>Courses</h2>
<% @courses.each do |course| %>
<div class="col"><%= render partial: 'shared/course', object: course %></div>
<% end %>
<% end %>
<% if @courses.nil? && @instructors.nil? %>
<h1>Sorry, we couldn't find anything matching your search.</h1>
<p>Please try again!</p>
<% end %>
<%= javascript_pack_tag 'search' %> <%= javascript_pack_tag 'search' %>
<%= stylesheet_link_tag 'search' %> <%= stylesheet_link_tag 'search' %>
...@@ -15,32 +15,29 @@ ...@@ -15,32 +15,29 @@
<% end %> <% end %>
</div> </div>
</div> </div>
<h5><em><%= course.title %></em></h5> <div class="d-md-flex justify-content-between">
</div> <h5><em><%= course.title %></em></h5>
<div class="card-body"> <div class="attr-list justify-content-start">
<div class="attr-list justify-content-start"> <div class="attr">
<div class="attr"> <div class="icon">
<div class="icon"> <i class="fa fa-book"></i>
<i class="fa fa-book"></i> </div>
</div> <%= course.credits %> credits
<%= course.credits %> credits
</div>
&nbsp;&nbsp;&nbsp;
<div class="attr">
<div class="icon">
<i class="fa fa-bars"></i>
</div> </div>
<%= sections.count %> sections &nbsp;&nbsp;&nbsp;
</div> </div>
</div> </div>
<p class="description"><%= course.description %></p> </div>
<div class="card-body">
<p class="description"><%= course.description %></p>
<% unless course.prereqs.nil? || course.prereqs.empty? %> <% unless course.prereqs.nil? || course.prereqs.empty? %>
<% first, rest = course.prereqs.split(':') %> <% first, rest = course.prereqs.split(':') %>
<% prereqs, note = rest.split('.') %> <% prereqs, note = rest.split('.') %>
<p><strong><%= first %>:</strong> <%= prereqs %> <sub><%= note %></sub></p> <p><strong><%= first %>:</strong> <%= prereqs %> <sub><%= note %></sub></p>
<% end %> <% end %>
<% if expanded %> <% if expanded %>
<div class="d-block" style="text-align: center"> <div class="d-block" style="text-align: center">
<p id="chevron-label" style="margin-bottom:-4px; font-size: 10px;">Minimize</p> <p id="chevron-label" style="margin-bottom:-4px; font-size: 10px;">Minimize</p>
...@@ -52,10 +49,14 @@ ...@@ -52,10 +49,14 @@
<i id="course-chevron" class="fas fa-chevron-down"></i> <i id="course-chevron" class="fas fa-chevron-down"></i>
</div> </div>
<% end %> <% end %>
<!-- List of Course Sections --> <!-- List of Course Sections -->
<div class="list-group list-group-flush sections" style="display: <%= expanded ? "flex" : "none" %>"> <div class="list-group list-group-flush sections" style="display: <%= expanded ? "flex" : "none" %>">
<%= render partial: 'shared/section', collection: sections, locals: { course: course } %>
</div> </div>
</div> </div>
</div> </div>
...@@ -7,13 +7,6 @@ ...@@ -7,13 +7,6 @@
</div> </div>
<%= link_to instructor.name, instructor_path(instructor) %> <%= link_to instructor.name, instructor_path(instructor) %>
</div> </div>
&nbsp;&nbsp;&nbsp;
<div class="attr">
<div class="icon">
<i class="fa fa-bars"></i>
</div>
<%= "#{instructor.section_count}" %> sections
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="navbar" class="container-fluid"> <nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #006633">
<div class="row align-left align-sm-center align-md-right" id="navbar"> <div class="container">
<div class="col align-center"> <a class="navbar-brand mb-0 h1" href="/">
<div class="center-vert"> <i class="fas fa-calendar-alt"></i>
<a href="/" id="logo"> Schedules
<i class="fas fa-calendar-alt"></i> </a>
Schedules <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
</a> <span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarTogglerDemo02">
<ul class="navbar-nav mr-auto mt-2 mt-lg-0">
<li class="nav-item">
<a href="/schedule" class="nav-link">Your Schedule (<span id="cart-counter"></span>)</a>
</li>
<li class="nav-item">
<a href="/about" class="nav-link">About Schedules</a>
</li>
</ul>
<form action="/search" class="form-inline">
<select id="semester-select" class="custom-select"> <select id="semester-select" class="custom-select">
<% Semester.all.each do |semester| %> <% Semester.all.each do |semester| %>
<option <option
...@@ -16,30 +29,9 @@ ...@@ -16,30 +29,9 @@
</option> </option>
<% end %> <% end %>
</select> </select>
</div>
</div>
<div class="col-sm align-center order-0 order-sm-1">
<a id="cart-button" href="<%= schedule_path %>">
<h1>
<span class="fa-layers fa-fw" id="schedule-icon">
<i class="fas fa-shopping-cart"></i>
<span class="fa-layers fa-fw">
<i class="fas fa-circle" data-fa-transform="shrink-3 up-12 right-12" style="color:gray"></i>
<span id="course-counter" class="fa-layers-text fa-inverse" data-fa-transform="shrink-10 up-12 right-12" style="font-weight:600">
<%= @cart.length %>
</span>
</span>
</span>
</h1>
</a>
</div>
<div class="col order-1 order-sm-0"> <input
<form action="/search" class="form"> id="searchbar"
<div class="input-group" style="width:100%;">
<input
id="searchbar"
value="<%= params[:query] %>" value="<%= params[:query] %>"
name="query" name="query"
type="text" type="text"
...@@ -47,14 +39,11 @@ ...@@ -47,14 +39,11 @@
placeholder="Search course or professor..." placeholder="Search course or professor..."
aria-describedby="basic-addon2" aria-describedby="basic-addon2"
autocomplete="off" autocomplete="off"
> >
<div class="input-group-append">
<button type="submit" class="btn btn-secondary" type="button"> <button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
<i class="fas fa-search"></i>
</button>
</div>
</div>
</form> </form>
</div> </div>
</div> </div>
</div> </nav>
<div class="container-fluid"> <div class="container">
<!-- The main screen consists of a row with two columns: the search results, and the cart --> <!-- The main screen consists of a row with two columns: the search results, and the cart -->
<div class="row"> <div id="page" class="row">
<!-- Search result, List of Courses --> <!-- Search result, List of Courses -->
<div class="col-lg-8 col-12 col-sm-10 mx-auto order-2 order-lg-0" id="search-list"> <div class="col-lg-12 col-12 col-sm-12 mx-auto order-2 order-lg-0" id="search-list">
<%= yield %> <%= yield %>
</div> </div>
<!-- List of sections in the cart --> <!-- List of sections in the cart -->
</div> </div>
<footer class="footer">
Schedules was built by <a href="https://srct.gmu.edu">Mason SRCT</a> and is completely open source. <br/>
Want to contribute? View the code on the <a href="https://git.gmu.edu/srct/schedules">SRCT GitLab</a>.<br/>
</footer>
</div> </div>
<template id="cart-data" data-cart="<%= @cart.to_json %>"></template> <template id="cart-data" data-cart="<%= @cart.to_json %>"></template>