From 0febf3f43f598214e01f4987d120f54217e78e0a Mon Sep 17 00:00:00 2001
From: Martin Mares <mj@ucw.cz>
Date: Tue, 14 Apr 2020 13:43:37 +0200
Subject: [PATCH] App: Separate static CSS

---
 app/Makefile            |  2 +-
 app/static/mffzoom.css  | 70 +++++++++++++++++++++++++++++++++++++++++
 app/templates/main.html | 62 ++----------------------------------
 3 files changed, 73 insertions(+), 61 deletions(-)
 create mode 100644 app/static/mffzoom.css

diff --git a/app/Makefile b/app/Makefile
index 468b70f..4a544f7 100644
--- a/app/Makefile
+++ b/app/Makefile
@@ -1,5 +1,5 @@
 DEST=/srv/mffzoom/app
 
 install:
-	rsync -av --delete zoom.py templates $(DEST)/
+	rsync -av --delete zoom.py static templates $(DEST)/
 	touch $(DEST)/force-reload
diff --git a/app/static/mffzoom.css b/app/static/mffzoom.css
new file mode 100644
index 0000000..16a8bf6
--- /dev/null
+++ b/app/static/mffzoom.css
@@ -0,0 +1,70 @@
+body {
+	background-color: white;
+	color: black;
+}
+
+#intro {
+	max-width: 50em;
+}
+
+#heading {
+	position: relative;
+	height: 2.5ex;
+}
+
+#schedule {
+	position: relative;
+}
+
+.room {
+	border: 1px solid green;
+}
+
+.slot {
+	border-bottom: 1px solid green;
+}
+
+.slotlabel {
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	margin: 0;
+	font-weight: bold;
+}
+
+.roomhead p {
+	text-align: center;
+	font-weight: bold;
+	margin: 0;
+}
+
+.meeting {
+	border: 1px solid blue;
+	background-color: #ccccff;
+	overflow: hidden;
+}
+
+.meeting:hover {
+	background-color: #aaaaff;
+	z-index: 1;
+}
+
+.collision {
+	border: 1px solid red;
+	background-color: #ffcccc;
+}
+
+.collision:hover {
+	background-color: #ffaaaa;
+}
+
+.mtime {
+	margin: 0;
+	font-size: 11px;
+}
+
+.mdesc {
+	margin: 0;
+	margin-top: 0.5ex;
+	font-size: 9px;
+}
diff --git a/app/templates/main.html b/app/templates/main.html
index 205b788..ddbadc6 100644
--- a/app/templates/main.html
+++ b/app/templates/main.html
@@ -1,66 +1,8 @@
 <!DOCTYPE html>
 <html>
 <head>
-	<style>
-		body {
-			background-color: white;
-			color: black;
-		}
-		#intro {
-			max-width: 50em;
-		}
-		#heading {
-			position: relative;
-			height: 2.5ex;
-		}
-		#schedule {
-			position: relative;
-		}
-		.room {
-			border: 1px solid green;
-		}
-		.slot {
-			border-bottom: 1px solid green;
-		}
-		.slotlabel {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			margin: 0;
-			font-weight: bold;
-		}
-		.roomhead p {
-			text-align: center;
-			font-weight: bold;
-			margin: 0;
-		}
-		.meeting {
-			border: 1px solid blue;
-			background-color: #ccccff;
-			overflow: hidden;
-		}
-		.meeting:hover {
-			background-color: #aaaaff;
-			z-index: 1;
-		}
-		.collision {
-			border: 1px solid red;
-			background-color: #ffcccc;
-		}
-		.collision:hover {
-			background-color: #ffaaaa;
-		}
-		.mtime {
-			margin: 0;
-			font-size: 11px;
-		}
-		.mdesc {
-			margin: 0;
-			margin-top: 0.5ex;
-			font-size: 9px;
-		}
-
-	</style>
+	<title>MFF Zoom Schedule</title>
+	<link rel=stylesheet href="{{ url_for('static', filename='mffzoom.css') }}?v=1" type='text/css' media=all>
 </head>
 <body>
 	<h1>MFF Zoom</h1>
-- 
GitLab