Skip to content

Commit

Permalink
Add per room, per day schedules
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Bark committed Apr 9, 2024
1 parent 90a5e87 commit 49a0466
Show file tree
Hide file tree
Showing 15 changed files with 163 additions and 1 deletion.
11 changes: 10 additions & 1 deletion assets/css/schedule.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,23 @@ html {
padding: 5px;
}

.grid-schedule-day {
display: grid;
grid-template-columns: 1fr 18fr;
grid-template-rows: 50px repeat(120, 10px);
border: solid grey;
border-radius: 5px;
padding: 5px;
}

.hour {
grid-column: 1/8;
border-top-color: grey;
border-top-style: dotted;
border-top-width: 1px;
}

.grid-schedule header {
.grid-schedule header, .grid-schedule-day header {
margin-left: auto;
margin-right: auto;
font-size: medium;
Expand Down
7 changes: 7 additions & 0 deletions content/exhibit-hall-2-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Exhibit Hall 2 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Exhibit Hall 2"
---
7 changes: 7 additions & 0 deletions content/exhibit-hall-2-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Exhibit Hall 2 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 1
venue: "Exhibit Hall 2"
---
7 changes: 7 additions & 0 deletions content/room-1-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 1 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Room 1"
---
7 changes: 7 additions & 0 deletions content/room-1-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 1 Schedule Day 2 - Texas Linux Fest 2024"
tabnum: 1
venue: "Room 1"
---
7 changes: 7 additions & 0 deletions content/room-2-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 2 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Room 2"
---
7 changes: 7 additions & 0 deletions content/room-2-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 2 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 1
venue: "Room 2"
---
7 changes: 7 additions & 0 deletions content/room-3-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 3 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Room 3"
---
7 changes: 7 additions & 0 deletions content/room-3-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 3 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 1
venue: "Room 3"
---
7 changes: 7 additions & 0 deletions content/room-4-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 4 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Room 4"
---
7 changes: 7 additions & 0 deletions content/room-4-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 4 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 1
venue: "Room 4"
---
7 changes: 7 additions & 0 deletions content/room-5-schedule-day-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 5 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 0
venue: "Room 5"
---
7 changes: 7 additions & 0 deletions content/room-5-schedule-day-2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: "schedule"
layout: "room-schedule"
title: "Room 5 Schedule Day 1 - Texas Linux Fest 2024"
tabnum: 1
venue: "Room 5"
---
55 changes: 55 additions & 0 deletions layouts/partials/room-schedule.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{{ if site.Data.homepage.tab.enable }}
{{ $tabnum := .Params.tabnum }}
{{ $venue := .Params.venue }}
{{ with site.Data.homepage.tab }}
<section class="section schedule">
<div class="schedule-contents">
{{ range $i,$p:= .tablist }}
{{ if eq $i $tabnum }}
<div class="grid-schedule-day">
<header id="time-header">Time</header>
<header>{{ $venue }}</header>

<div class="hour" style="grid-row: 2/14">9:00</div>
<div class="hour" style="grid-row: 14/26">10:00</div>
<div class="hour" style="grid-row: 26/38">11:00</div>
<div class="hour" style="grid-row: 38/50">12:00</div>
<div class="hour" style="grid-row: 50/62">13:00</div>
<div class="hour" style="grid-row: 62/74">14:00</div>
<div class="hour" style="grid-row: 74/86">15:00</div>
<div class="hour" style="grid-row: 86/98">16:00</div>
<div class="hour" style="grid-row: 98/110">17:00</div>
<div class="hour" style="grid-row: 110/122">18:00</div>

{{ $rows_per_hour := 12 }}
{{ $start_hour := 9 }}
{{ $end_hour := 18 }}

{{ range .tablist_items }}
{{ if eq .venue $venue }}
{{ $times := findRESubmatch `((\d+):(\d+))[^\d]*((\d+):(\d+))` .time }}
{{ $start_row := index (findRE `^\d+` .time) 0 | int}}
{{ $start_row := cond (lt $start_row $start_hour ) (add $start_row 12) $start_row }}
{{ $start_row := sub $start_row $start_hour }}
{{ $start_row := add $start_row (div (index (findRE `:(\d+)` .time) 0 | last 2 | float) 60) }}

{{ $start_row := add (mul $start_row $rows_per_hour) 2 | math.Round }}

{{ $start_row := add (mul (add (sub .start_hour $start_hour) (div .start_minute 60.0)) $rows_per_hour) 2 }}
{{ $end_row := add (mul (add (sub .end_hour $start_hour) (div .end_minute 60.0)) $rows_per_hour) 2 }}

<div class="schedule-entry" style="grid-row: {{ $start_row }}/{{ $end_row }}; grid-column: 2">
<div class="speaker-name"><a href="/{{ .speaker_link }}">{{ .speaker }}</a></div>
<div class="talk-subject"><a href="/{{ .talk_link }}">{{ .subject }}</a></div>
<div class="talk-time">{{ .time }}</div>
</div>
{{ end }}
{{ end }}
</div>

{{ end }}
{{ end }}
</div>
</section>
{{ end }}
{{ end }}
14 changes: 14 additions & 0 deletions layouts/schedule/room-schedule.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Texas Linux Fest Schedule</title>
{{ $schedule_style := resources.Get "css/schedule.css" }}
<link rel="stylesheet" href="{{ $schedule_style.Permalink }}" >
<link rel="shortcut icon" href="{{ `images/favicon.png` | absURL }}" type="image/x-icon">
<link rel="icon" href="{{ `images/favicon.png` | absURL }}" type="image/x-icon">
</head>
<body>
{{ template "partials/room-schedule.html" . }}
</body>
</html>

0 comments on commit 49a0466

Please sign in to comment.