Skip to content
Snippets Groups Projects
Commit ed7f8277 authored by Kevin Lin's avatar Kevin Lin :sparkles:
Browse files

Remove schedules

parent ffa440f1
No related branches found
No related tags found
No related merge requests found
......@@ -40,7 +40,6 @@ footer_content: 'Kevin Lin &copy; 2020 <a rel="license" href="http://creativecom
collections:
staffers:
modules:
schedules:
# Default layouts for each collection type
defaults:
- scope:
......@@ -56,11 +55,6 @@ defaults:
type: modules
values:
layout: module
- scope:
path: ''
type: schedules
values:
layout: schedule
compress_html:
clippings: all
......
{% capture _minutes_workspace %}
{% comment %}
Return the number of minutes between midnight and the given time string (e.g. '9:30 AM').
Parameters:
`time` (string): the time to convert.
{% endcomment %}
{% assign _time = include.time %}
{% assign _hhmm = _time | split: ' ' | first | split: ':' %}
{% assign _hours = _hhmm | first | to_integer %}
{% assign _minutes = _hhmm | last | to_integer %}
{% assign _ampm = _time | split: ' ' | last | upcase %}
{% if _ampm == 'AM' and _hours == 12 %}
{% assign _hours = _hours | minus: 12 %}
{% elsif _ampm == 'PM' and _hours != 12 %}
{% assign _hours = _hours | plus: 12 %}
{% endif %}
{% endcapture %}{% assign _minutes_workspace = '' %}{{ _hours | times: 60 | plus: _minutes }}
{% assign start_time = page.timeline | first %}
{% capture offset %}{% include minutes.liquid time=start_time %}{% endcapture %}
<div class="schedule">
<ul class="schedule-timeline" style="min-width: {{ page.schedule | size | times: 130 }}px">
{% for time in page.timeline %}
<li class="schedule-time">{{ time }} </li>
{% endfor %}
</ul>
<ul class="schedule-group">
{% for day in page.schedule %}
<li class="schedule-day">
<h2 class="schedule-header">{{ day.name }}</h2>
{% if day.events %}
<ul class="schedule-events" style="height: {{ page.timeline | size | times: 40 }}px">
{% for event in day.events %}
{% capture start %}{% include minutes.liquid time=event.start %}{% endcapture %}
{% capture end %}{% include minutes.liquid time=event.end %}{% endcapture %}
{% assign top = start | minus: offset | times: 40 | divided_by: 30 %}
{% assign height = end | minus: start | times: 40 | divided_by: 30 %}
<li class="schedule-event {% if event.class %}{{ event.class }}{% else %}{{ event.name | slugify }}{% endif %}"
style="top: {{ top }}px; height: {{ height }}px;">
<div class="name">{{ event.name }}</div>
<div class="time">{{ event.start }}–{{ event.end }}</div>
{% if event.location %}
<div class="location">{{ event.location }}</div>
{% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</li>
{% endfor %}
</ul>
</div>
......@@ -3,7 +3,6 @@
// Just the Class styles
@import 'module';
@import 'schedule';
@import 'staffer';
// Overrides
......
.schedule {
@include abstract-card();
overflow-x: scroll;
position: relative;
li::before {
display: none;
}
ul.schedule-timeline,
ul.schedule-group,
ul.schedule-events {
margin-top: 0;
padding-left: 0;
}
ul.schedule-timeline {
margin: 40px auto 0;
position: absolute;
width: 100%;
}
.schedule-time {
@extend .fs-2;
color: $grey-dk-000;
height: 40px;
margin: 0;
padding: $sp-2;
position: relative;
&::after {
background-color: $border-color;
content: '';
height: 1px;
left: 0;
position: absolute;
top: 0;
width: 100%;
}
}
.schedule-group {
display: flex;
margin-bottom: 0;
position: relative;
}
.schedule-day {
border-left: $border $border-color;
flex: 1 0 0;
margin: 0;
min-width: 130px;
&:first-of-type {
border-left: 0;
}
}
h2.schedule-header {
align-items: center;
display: flex;
font-size: 18px !important;
height: 40px;
justify-content: center;
margin: 0;
}
.schedule-events {
display: flex;
padding: 0;
position: relative;
}
.schedule-event {
background-color: $grey-dk-000;
border-radius: $border-radius;
box-shadow: 0 10px 20px rgba(0, 0, 0, .1), inset 0 -3px 0 rgba(0, 0, 0, .2);
color: $white;
float: left;
height: 100%;
margin: 0;
padding: $sp-1 $sp-2;
position: absolute;
width: 100%;
.name {
@extend .fs-3, .fw-700;
}
.time,
.location {
@extend .fs-2;
}
&.lecture {
background-color: $grey-dk-000;
}
&.section {
background-color: $purple-000;
}
&.office-hours {
background-color: $blue-000;
}
}
}
---
timeline:
- '9:00 AM'
- '9:30 AM'
- '10:00 AM'
- '10:30 AM'
- '11:00 AM'
- '11:30 AM'
- '12:00 PM'
- '12:30 PM'
- '1:00 PM'
- '1:30 PM'
- '2:00 PM'
- '2:30 PM'
- '3:00 PM'
- '3:30 PM'
- '4:00 PM'
- '4:30 PM'
- '5:00 PM'
- '5:30 PM'
schedule:
- name: Monday
events:
- name: Lecture
start: 9:30 AM
end: 10:30 AM
location: 150 Wheeler
- name: Section
start: 11:30 AM
end: 12:30 PM
location: 310 Soda
- name: Office Hours
start: 12:30 PM
end: 2:00 PM
location: 271 Soda
- name: Tuesday
- name: Wednesday
events:
- name: Lecture
start: 9:30 AM
end: 10:30 AM
location: 150 Wheeler
- name: Section
start: 11:30 AM
end: 12:30 PM
location: 310 Soda
- name: Office Hours
start: 12:30 PM
end: 2:00 PM
location: 271 Soda
- name: Thursday
- name: Friday
events:
- name: Lecture
start: 9:30 AM
end: 10:30 AM
location: 150 Wheeler
- name: Section
start: 11:30 AM
end: 12:30 PM
location: 310 Soda
- name: Office Hours
start: 12:30 PM
end: 2:00 PM
location: 271 Soda
---
---
layout: page
title: Schedule
description: The weekly event schedule.
---
# Weekly Schedule
{% for schedule in site.schedules %}
{{ schedule }}
{% endfor %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment