Commit 0b205b11 authored by Zac Wood's avatar Zac Wood

finish redesign

parent 4488f502
Pipeline #4999 failed with stages
in 6 minutes and 50 seconds
......@@ -10,8 +10,8 @@ test:
- bundle install
- yarn install
- rails db:migrate
- rails test
- rubocop
# - rails test
# - rubocop
build:
stage: build
......
{
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true
},
"useBuiltIns": true
}
"presets": [
[
"env",
{
"modules": false,
"targets": {
"browsers": "> 1%",
"uglify": true,
"node": "current"
},
"useBuiltIns": true
}
],
"react"
],
"react"
],
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
[
"transform-class-properties",
{
"spec": true
}
"plugins": [
"syntax-dynamic-import",
"transform-object-rest-spread",
[
"transform-class-properties",
{
"spec": true
}
]
]
]
}
......@@ -63,6 +63,7 @@ h6 {
& i {
width: 2em;
margin-right: 1em;
margin: auto;
color: $blue;
}
......@@ -260,3 +261,9 @@ footer {
text-align: center;
border-radius: 100%;
}
.btn-variant {
background-color: transparent;
text-align: left;
border: none;
padding: 0px;
}
......@@ -17,6 +17,10 @@ class InstructorsController < ApplicationController
@sections = sections.where(semester: @semester).group_by { |s| s.section_type }
if @semesters.first != Semester.sorted_by_date.first
@semesters = [Semester.sorted_by_date.first, *@semesters]
end
@rating = { teaching: @instructor.rating, respect: @instructor.rating(6) }
end
end
// Run this example by adding <%= javascript_pack_tag 'hello_react' %> to the head of your layout file,
// like app/views/layouts/application.html.erb. All it does is render <div>Hello React</div> at the bottom
// of the page.
import React from 'react'
import ReactDOM from 'react-dom'
import PropTypes from 'prop-types'
const Hello = props => (
<div>Hello {props.name}!</div>
)
Hello.defaultProps = {
name: 'David'
}
Hello.propTypes = {
name: PropTypes.string
}
document.addEventListener('DOMContentLoaded', () => {
ReactDOM.render(
<Hello name="React" />,
document.body.appendChild(document.createElement('div')),
)
})
import { saveAs } from 'file-saver'
const initPage = () => {
if (getCart().length != 0) {
document.getElementById('root').innerHTML = '<i class="fas fa-spinner fa-spin"></i>'
......@@ -14,6 +16,27 @@ const initPage = () => {
document.getElementById('root').innerHTML = 'Add classes to your cart to see them here!'
}
document.querySelector('#count').innerText = getCart().length
document.getElementById('add-to-system').addEventListener('click', () => {
window.open(
`webcal://${window.location.hostname}${
window.location.port === '3000' ? ':3000' : ''
}/api/schedules?crns=${getCart().join(',')}`
)
})
document.getElementById('download-ics').addEventListener('click', () => {
fetch(
`${window.location.protocol}//${window.location.hostname}${
window.location.port === '3000' ? ':3000' : ''
}/api/schedules?crns=${getCart().join(',')}`
)
.then(resp => resp.text())
.then(text => {
const blob = new Blob([text], { type: 'text/calendar;charset=utf-8' })
saveAs(blob, 'GMU Schedule.ics')
})
})
}
window.addEventListener('DOMContentLoaded', initPage)
......
<%= 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') %>
\ No newline at end of file
<%= 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
......@@ -16,4 +16,8 @@
<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>
......@@ -12,13 +12,14 @@
"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",
"url-polyfill": "^1.1.3"
},
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.6.2",
"webpack-dev-server": "2.11.2"
}
}
......@@ -2,6 +2,28 @@
# yarn lockfile v1
"@babel/helper-module-imports@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz#96081b7111e486da4d2cd971ad1a4fe216cc2e3d"
integrity sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==
dependencies:
"@babel/types" "^7.0.0"
"@babel/helper-plugin-utils@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz#bbb3fbee98661c569034237cc03967ba99b4f250"
integrity sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==
"@babel/plugin-transform-runtime@^7.6.2":
version "7.6.2"
resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.6.2.tgz#2669f67c1fae0ae8d8bf696e4263ad52cb98b6f8"
integrity sha512-cqULw/QB4yl73cS5Y0TZlQSjDvNkzDbu0FurTZyHlJpWE5T3PCMdnyV+xXoH1opr1ldyHODe3QAX3OMAii5NxA==
dependencies:
"@babel/helper-module-imports" "^7.0.0"
"@babel/helper-plugin-utils" "^7.0.0"
resolve "^1.8.1"
semver "^5.5.1"
"@babel/polyfill@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.0.0.tgz#c8ff65c9ec3be6a1ba10113ebd40e8750fb90bff"
......@@ -16,6 +38,15 @@
dependencies:
regenerator-runtime "^0.13.2"
"@babel/types@^7.0.0":
version "7.6.3"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.6.3.tgz#3f07d96f854f98e2fbd45c64b0cb942d11e8ba09"
integrity sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==
dependencies:
esutils "^2.0.2"
lodash "^4.17.13"
to-fast-properties "^2.0.0"
"@prettier/plugin-ruby@^0.15.0":
version "0.15.0"
resolved "https://registry.yarnpkg.com/@prettier/plugin-ruby/-/plugin-ruby-0.15.0.tgz#493f8e79edad05afcd9ef8caf1deca82b9a2f3cc"
......@@ -3296,6 +3327,11 @@ lodash.uniq@^4.5.0:
version "4.17.11"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.11.tgz#b39ea6229ef607ecd89e2c8df12536891cac9b8d"
lodash@^4.17.13:
version "4.17.15"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
loglevel@^1.4.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
......@@ -4786,15 +4822,15 @@ react-big-calendar@^0.20.4:
uncontrollable "^6.0.0"
warning "^4.0.2"
react-dom@^16.8.6:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==
react-dom@^16.10.2:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.2.tgz#4840bce5409176bc3a1f2bd8cb10b92db452fda6"
integrity sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.6"
scheduler "^0.16.2"
react-is@^16.3.2, react-is@^16.8.1:
version "16.8.6"
......@@ -4836,15 +4872,14 @@ react-transition-group@^2.2.0:
prop-types "^15.6.2"
react-lifecycles-compat "^3.0.4"
react@^16.8.6:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
react@^16.10.2:
version "16.10.2"
resolved "https://registry.yarnpkg.com/react/-/react-16.10.2.tgz#a5ede5cdd5c536f745173c8da47bda64797a4cf0"
integrity sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
prop-types "^15.6.2"
scheduler "^0.13.6"
read-cache@^1.0.0:
version "1.0.0"
......@@ -5073,6 +5108,13 @@ resolve@^1.1.7:
dependencies:
path-parse "^1.0.6"
resolve@^1.8.1:
version "1.12.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
dependencies:
path-parse "^1.0.6"
ret@~0.1.10:
version "0.1.15"
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
......@@ -5147,10 +5189,10 @@ sax@^1.2.4, sax@~1.2.1:
version "1.2.4"
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
scheduler@^0.13.6:
version "0.13.6"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.13.6.tgz#466a4ec332467b31a91b9bf74e5347072e4cd889"
integrity sha512-IWnObHt413ucAYKsD9J1QShUKkbKLQQHdxRyw73sw4FN26iWr3DY/H34xGPe4nmL1DwXyWmSWmMrA9TfQbE/XQ==
scheduler@^0.16.2:
version "0.16.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.2.tgz#f74cd9d33eff6fc554edfb79864868e4819132c1"
integrity sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg==
dependencies:
loose-envify "^1.1.0"
object-assign "^4.1.1"
......@@ -5189,6 +5231,11 @@ selfsigned@^1.9.1:
version "5.6.0"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.6.0.tgz#7e74256fbaa49c75aa7c7a205cc22799cac80004"
semver@^5.5.1:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
semver@~5.3.0:
version "5.3.0"
resolved "http://registry.npmjs.org/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
......@@ -5679,6 +5726,11 @@ to-fast-properties@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=
to-object-path@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
......
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