44live/templates/index.html

54 lines
1.8 KiB
HTML
Raw Normal View History

2025-03-06 00:33:46 -05:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
2025-04-04 00:14:43 -04:00
<meta property="og:site_name" content="44live">
<title>UofL Events</title>
<meta name="description" content="Find events at the University of Louisville">
<meta name="viewport" content="width=device-width,initial-scale=1">
2025-04-07 02:33:02 -04:00
<link rel="icon" href="calendar.svg" type="image/svg+xml">
2025-04-10 01:17:42 -04:00
<meta name="color-scheme" content="dark light">
<link rel="stylesheet" href="https://static.stevenalexander.org/picocss/css/pico.jade.min.css">
2025-03-06 00:33:46 -05:00
</head>
<body>
2025-04-10 01:17:42 -04:00
<header class="container">
<h2>UofL Events</h2>
</header>
<main class="container">
<fieldset>
<legend><strong>Date to display</strong></legend>
<input id="today" type="radio" name="date" checked>
<label for="today">today</label><br>
<input id="tomorrow" type="radio" name="date">
<label for="tomorrow">tomorrow</label><br>
<input id="custom" type="radio" name="date">
<label for="custom"><input id="date" type="date" min="{{today}}" max="{{later}}" value="{{dayafter}}" onchange="noClear(event)"></label>
</fieldset>
<fieldset>
<legend><strong>Filter rooms by event type</strong></legend>
{%- for i in ["closed","available","class","exam","booked","food"] %}
<input id="{{i}}" type="checkbox">
<label for="{{i}}">{{i}}</label><br>
{%- endfor %}
</fieldset>
<fieldset>
2025-04-19 18:01:01 -04:00
<button onclick="doFilters()">Show the events!</button>
2025-04-10 01:17:42 -04:00
</fieldset>
2025-03-06 00:33:46 -05:00
<script>
2025-04-10 01:17:42 -04:00
function noClear(e){
2025-03-06 00:33:46 -05:00
val=e.target.value
2025-04-10 01:17:42 -04:00
if(!val||val<"{{today}}"||val>"{{later}}"){e.target.value="{{dayafter}}"}
2025-03-06 00:33:46 -05:00
document.getElementById("custom").click()
}
2025-04-10 01:17:42 -04:00
function doFilters(){
d=document.querySelector('input[type="radio"]:checked').id;
2025-04-19 18:01:01 -04:00
if(d=="custom"){d=document.querySelector('input[type="date"]').value}
2025-04-10 01:17:42 -04:00
f=Array.from(document.querySelectorAll('input[type="checkbox"]:checked')).map(c=>c.id);
f=f.length?"?"+f.join(","):"";
document.location.href=d+f
2025-03-06 00:33:46 -05:00
}
</script>
2025-04-10 01:17:42 -04:00
</main>
2025-03-06 00:33:46 -05:00
</body>
</html>