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

Merge branch 'redesign' into 'master'

Redesign

See merge request !53
parents 80db8a9e 197c3aee
Pipeline #5030 passed with stages
in 27 minutes and 17 seconds
<!DOCTYPE html>
<html>
<html lang="en-us">
<head>
<title>Schedules</title>
<%= csrf_meta_tags %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<%= Gon::Base.render_data %>
<%= javascript_include_tag 'masonstrap.min' %>
<%= stylesheet_link_tag 'masonstrap.min' %>
<%= stylesheet_link_tag 'application' %>
<!-- Bootstrap -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!-- FontAwesome icons -->
<script src="https://kit.fontawesome.com/ea45f7e94d.js" crossorigin="anonymous"></script>
<%= javascript_pack_tag 'application' %>
<!-- Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Roboto:400,700&display=swap" rel="stylesheet">
<!-- FB/Opengraph tags -->
<meta property="og:url" content="https://schedules.gmu.edu/">
......@@ -34,28 +37,36 @@
<!-- favicons -->
<%= favicon_link_tag %>
<link href="<%= asset_path 'favicon-32x32.png' %>" sizes="32x32" rel="shortcut icon" type="image/png" />
<!-- Custom styles and code -->
<%= stylesheet_link_tag('application') %>
<%= javascript_pack_tag('application') %>
</head>
<body>
<%= render partial: 'shared/navbar' %>
<%= render 'shared/page' do %>
<%= yield %>
<% end %>
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.srct.gmu.edu/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '3']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->
<% if @render_page %>
<%= render 'shared/page' do %>
<%= yield %>
<% end %>
<% else %>
<div class="page">
<%= yield %>
</div>
<% end %>
<!-- Matomo -->
<script type="text/javascript">
var _paq = _paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//matomo.srct.gmu.edu/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '3']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
</body>
</html>
<%= javascript_pack_tag 'schedules' %>
<%= stylesheet_link_tag 'schedules' %>
<%= render(partial: 'shared/navbar') %>
<h2 style="margin-bottom: 0.5em">Your Schedule</h2>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#exportModal">
Export Schedule to Calendar
</button>
<div id="root"></div>
<%= javascript_pack_tag('schedules') %>
<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! <br /> (Click on the options below to see further
instructions)
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#apple-info">
<h5> Apple Calendar </h5>
</button>
<div id="apple-info" class="collapse">
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.
</div>
<hr />
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#google-info">
<h5>Google Calendar</h5>
</button>
<div id="google-info" class="collapse">
<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.
<br />
</div>
<hr />
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#outlook-info">
<h5>Outlook Calendar</h5>
</button>
<div id="outlook-info" class="collapse">
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#outlook-desktop">
<strong>On desktop (Windows):</strong>
</button>
<br />
<div id="outlook-desktop" class="collapse">
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.”
</div>
<br />
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#outlook-mac">
<strong>On desktop (Mac):</strong>
</button>
<br />
<div id="outlook-mac" class="collapse">
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.
</div>
<br />
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#outlook-classic">
<strong>Outlook Online (classic Layout)</strong>
</button>
<br />
<div id="outlook-classic" class="collapse">
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.
</div>
<br />
<button
type="button"
class="btn-variant"
data-toggle="collapse"
data-target="#outlook-new">
<strong>Outlook Online (New Outlook Layout)</strong>
</button>
<br />
<div id="outlook-new" class="collapse">
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.
</div>
</div>
<br />
<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>
\ No newline at end of file
<div id="root"></div>
<%= render(partial: 'shared/navbar') %>
<%= javascript_pack_tag 'search' %>
<%= stylesheet_link_tag 'search' %>
<div class="search-results">
<% (@instructors || []).each do |inst| %>
<section class="instructor">
<h5><a href="/instructors/<%= inst.id %>"> <%= inst.name %></a></h5>
</section>
<% end %>
<% (@courses || []).each do |course| %>
<section class="course">
<h4><a href="/courses/<%= course['id'] %>"><%= course['subject'] %> <%= course['course_number'] %></a></h4>
<h5><em><%= course['title'] %>. <%= course['credits'] %> <%= 'credit'.pluralize(course['credits'].to_i) %>.</em></h5>
<span class="description"><%= course['description'] %></span>
<a href="/courses/<%= course['id'] %>" class="see-more">View Sections</a>
</section>
<% end %>
<% if @courses&.empty? && @instructors&.empty? %>
<span>No results found. Please try again with another search term.</span>
<% end %>
</div>
<nav class="navbar navbar-expand-lg navbar-dark" style="background-color: #006633">
<div class="container">
<a class="navbar-brand mb-0 h1" href="/">
<i class="fas fa-calendar-alt"></i>
Schedules
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
<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">
<% Semester.all.each do |semester| %>
<option
value="<%= semester.id %>"
<% if @semester == semester %> selected <% end %>
>
<%= "#{semester.season} #{semester.year}" %>
</option>
<% end %>
</select>
<input
id="searchbar"
value="<%= params[:query] %>"
name="query"
type="text"
class="form-control"
placeholder="Search course or professor..."
aria-describedby="basic-addon2"
autocomplete="off"
>
<button class="btn btn-secondary my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</div>
</nav>
<nav>
<span><a href="/"><i class="fas fa-calendar-alt"></i> Schedules</a></span>
<form id="search-container" action="/search" method="GET">
<input id="search-input" aria-label="Search" name="query" placeholder="PSYC, CS 112, 71926, Jonathan Bell, ..." value="<%= params[:query] %>"/>
<button aria-label="Submit" type="submit">
<i class="fas fa-search"></i>
</button>
</form>
</nav>
\ No newline at end of file
<div class="container">
<!-- The main screen consists of a row with two columns: the search results, and the cart -->
<div id="page" class="row">
<!-- Search result, List of Courses -->
<div class="col-lg-12 col-12 col-sm-12 mx-auto order-2 order-lg-0" id="search-list">
<%= yield %>
</div>
<main class="container">
<%# <div id="page" class="row"> %>
<!-- Search result, List of Courses -->
<div class="col-lg-12 col-12 col-sm-12 mx-auto order-2 order-lg-0" id="search-list">
<%= yield %>
</div>
<%# </div> %>
<!-- List of sections in the cart -->
</div>
<a class="cart" href="/schedule" data-turbolinks="false">
<span id="count">0</span>
<i class="fas fa-shopping-cart"></i>
</a>
<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/>
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>
<template id="cart-data" data-cart="<%= @cart.to_json %>"></template>
</main>
\ No newline at end of file
<% unless defined?(editable) %>
<% editable = true %>
<% end %>
<li id="section-<%= section.id %>" data-crn="<%= "#{section.crn}" %>" class="list-group-item card section-item">
<p><strong class="subj"><%= "#{section.name}" %></strong>: <%= section.title %> <em><%= "(##{section.crn})"%></em></p>
<% unless defined?(show_instr) %>
<% show_instr = true %>
<% end %>
<li id="section-<%= section.id %>"
class="list-group-item section-item"
data-crn="<%= section.crn %>"
data-id="<%= section.id %>"
data-cid="<%= course.id if defined?(course) %>"
data-type="<%= section.section_type %>"
>
<p><b class="subj"><%= "#{section.name}" %></b>: <%= section.title %> <em><%= "(##{section.crn})"%></em></p>
<% if editable %>
<span class="float-right text-center add-remove-btn"><i id="icon" class="fas fa-ellipsis-h"></i><br/><span class="text">Add</span></span>
<% end %>
<i class="fas fa-chalkboard-teacher"></i>
<% if section.instructor.name == "TBA" %>
TBA
<% else %>
<%= link_to section.instructor.name, section.instructor %>
<% unless section.instructor.rating.nil? || !show_instr %>
<%= render partial: 'shared/stars', locals: { percent: (section.instructor.rating[0] / 5 * 100).to_i }%>
<% end %>
<% end %>
<br/>
<i class="fas fa-map-marker-alt"></i> <%= section.location %> <br/>
<i class="fas fa-clock"></i> <%= "#{section.days}, #{section.start_time}-#{section.end_time}" %> <br/>
<div class="stats">
<i class="fas fa-chalkboard-teacher"></i>
<% if section.instructor.name == "TBA" %>
TBA
<% else %>
<%= link_to section.instructor.name, section.instructor %>
<% unless section.instructor.rating.nil? %>
<%= render partial: 'shared/stars', locals: { percent: (section.instructor.rating[0] / 5 * 100).to_i }%>
<% end %>
<% end %>
<br/>
<i class="fas fa-map-marker-alt"></i> <%= section.location %> <br/>
<i class="fas fa-clock"></i> <%= "#{section.days}, #{section.start_time}-#{section.end_time}" %>
</div>
<% unless section.rating_questions.empty? %>
<br/>
<b>Rating Info</b> (<%= link_to("See all ratings", course_section_url(section))%>)
<ul>
<li>Instructor rating: <%= section.teaching_rating %></li>
<li>Course rating: <%= section.course_rating %></li>
</ul>
<div class="ratings">
<b>Rating Info</b> (<%= link_to("See all ratings", course_section_url(section))%>)
<ul>
<li>Instructor rating: <%= section.teaching_rating %></li>
<li>Course rating: <%= section.course_rating %></li>
</ul>
</div>
<% end %>
<div class="add-remove-link">
<a data-crn="<%= "#{section.crn}" %>" class="underline add-section">
<i class="fas fa-plus add-remove-icon"></i>
<span>Add Section to Cart</span>
</a>
</div>
</li>
......@@ -9,7 +9,7 @@ Rails.application.routes.draw do
get 'sessions/add_bulk'
resources :courses, only: [:show]
resources :course_sections, only: [:show]
resources :course_sections, only: [:index, :show]
resources :instructors, only: [:index, :show]
get 'schedule', to: 'schedules#show', as: 'schedule'
get 'schedule/events', to: 'schedules#events'
......
"Spring 2019":
- "2019-3-11"
- "2019-3-12"
- "2019-3-13"
- "2019-3-14"
- "2019-3-15"
- "2019-3-16"
- "2019-3-17"
'Spring 2020':
- '2020-1-20'
- '2020-3-09'
- '2020-3-10'
- '2020-3-11'
- '2020-3-12'
- '2020-3-13'
- '2020-3-14'
- '2020-3-15'
- '2020-5-05'
- '2020-5-06'
- '2020-5-07'
- '2020-5-08'
- '2020-5-09'
- '2020-5-10'
- '2020-5-11'
- '2020-5-12'
- '2020-5-13'
"Fall 2019":
- "2019-09-02"
- "2019-10-14"
- "2019-11-27"
- "2019-11-28"
- "2019-11-29"
- "2019-12-08"
- "2019-12-09"
- "2019-12-10"
- "2019-12-11"
- "2019-12-12"
- "2019-12-13"
- "2019-12-14"
- "2019-12-15"
- "2019-12-16"
- "2019-12-17"
- "2019-12-18"
'Spring 2019':
- '2019-3-11'
- '2019-3-12'
- '2019-3-13'
- '2019-3-14'
- '2019-3-15'
- '2019-3-16'
- '2019-3-17'
'Fall 2019':
- '2019-09-02'
- '2019-10-14'
- '2019-11-27'
- '2019-11-28'
- '2019-11-29'
- '2019-12-08'
- '2019-12-09'
- '2019-12-10'
- '2019-12-11'
- '2019-12-12'
- '2019-12-13'
- '2019-12-14'
- '2019-12-15'
- '2019-12-16'
- '2019-12-17'
- '2019-12-18'
......@@ -3,6 +3,7 @@
"private": true,
"dependencies": {
"@babel/polyfill": "^7.0.0",
"@prettier/plugin-ruby": "^0.15.0",
"@rails/webpacker": "3.5",
"babel-preset-react": "^6.24.1",
"file-saver": "^2.0.0",
......@@ -11,13 +12,15 @@
"jquery": "^3.3.1",
"moment": "^2.23.0",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react": "^16.10.2",
"react-big-calendar": "^0.20.4",
"react-dom": "^16.8.6",
"react-dom": "^16.10.2",
"react-sizes": "^2.0.0",
"turbolinks": "^5.2.0",
"url-polyfill": "^1.1.3"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.6.2",
"webpack-dev-server": "2.11.2"
}
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment