Add all resources, change paths

This commit is contained in:
Christoph Hagen 2022-02-10 16:18:50 +01:00
parent 7d49e8a7ed
commit 4e7e01f203
8 changed files with 85 additions and 21 deletions

View File

@ -47,7 +47,7 @@ function catchErrors(error) {
}
async function performRequest(name, path) {
let text = await fetch("festival/api/" + path, {
let text = await fetch("/festival/api/" + path, {
method: 'POST',
body: name
}).then(handleErrors).catch(catchErrors);
@ -59,6 +59,6 @@ async function performRequest(name, path) {
return false;
}
function downloadEvent(file) {
window.location= "files/" + file
}
function download(file) {
window.location = file
}

View File

@ -17,7 +17,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="assets/festival.css">
<script src="assets/festival.js?v=8"></script>
<script src="assets/festival.js?v=9"></script>
</head>
<body>
<div class="wrapper">
@ -54,10 +54,10 @@
<div class="error-text normal-text final-text" id="error-text">Registration failed</div>
<div class="registered-text normal-text final-text" id="registered-text">Registration successful</div>
<div class="declined-text normal-text final-text" id="declined-text">Invitation declined</div>
<div class="add-calender-event button normal-text" id="add-calender-event" onclick="downloadEvent('festival-en.ics')">Add to calendar</div>
<div class="add-calender-event button normal-text" id="add-calender-event" onclick="download('/festival/festival-en.ics')">Add to calendar</div>
</div>
<audio loop autoplay id="audio">
<source src="audio/since77.mp3" type="audio/mp3">
<source src="/festival/since77.mp3" type="audio/mp3">
</audio>
</div>
</body>

35
Public/festival-en.ics Normal file
View File

@ -0,0 +1,35 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//christophhagen.de
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20211002T121707Z
UID:20211002T121707Z-230813577@christophhagen.de
DTSTART;TZID=Europe/Berlin:20220730T140000
DTEND;TZID=Europe/Berlin:20220731T120000
SUMMARY:CC Festival
URL:https://christophhagen.de/festival-en
DESCRIPTION:A summer party
LOCATION:Scheinfelder Straße 10\, 96160 Geiselwind, Germany
END:VEVENT
END:VCALENDAR

View File

@ -17,7 +17,7 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="assets/festival.css">
<script src="assets/festival.js?v=8"></script>
<script src="assets/festival.js?v=9"></script>
</head>
<body>
<div class="wrapper">
@ -54,10 +54,10 @@
<div class="error-text normal-text final-text" id="error-text">Registrierung fehlgeschlagen</div>
<div class="registered-text normal-text final-text" id="registered-text">Registrierung erfolgreich</div>
<div class="declined-text normal-text final-text" id="declined-text">Einladung abgelehnt</div>
<div class="add-calender-event button normal-text" id="add-calender-event" onclick="downloadEvent('festival.ics')">Kalendereintrag</div>
<div class="add-calender-event button normal-text" id="add-calender-event" onclick="download('/festival/festival.ics')">Kalendereintrag</div>
</div>
<audio loop autoplay id="audio">
<source src="audio/since77.mp3" type="audio/mp3">
<source src="/festival/since77.mp3" type="audio/mp3">
</audio>
</div>
</body>

35
Public/festival.ics Normal file
View File

@ -0,0 +1,35 @@
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//christophhagen.de
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:Europe/Berlin
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/Europe/Berlin
X-LIC-LOCATION:Europe/Berlin
BEGIN:DAYLIGHT
TZNAME:CEST
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
DTSTART:19700329T020000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
END:DAYLIGHT
BEGIN:STANDARD
TZNAME:CET
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
DTSTART:19701025T030000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTAMP:20211002T121707Z
UID:20211002T121707Z-230813577@christophhagen.de
DTSTART;TZID=Europe/Berlin:20220730T140000
DTEND;TZID=Europe/Berlin:20220731T120000
SUMMARY:CC Festival
URL:https://christophhagen.de/festival
DESCRIPTION:A summer party
LOCATION:Scheinfelder Straße 10\, 96160 Geiselwind
END:VEVENT
END:VCALENDAR

BIN
Public/since77.mp3 Normal file

Binary file not shown.

View File

@ -1,3 +1 @@
/data/logs/festival/server.log
/data/public/festival/lists

View File

@ -96,15 +96,11 @@ public func configure(_ app: Application) throws {
let configFile = URL(fileURLWithPath: app.directory.resourcesDirectory)
.appendingPathComponent("paths.conf")
let configData = try String(contentsOf: configFile)
.components(separatedBy: "\n")
.map { $0.trimmingCharacters(in: .whitespaces) }
.filter { !$0.isEmpty }
guard configData.count == 2 else {
throw FestivalError.invalidConfiguration
}
let logFile = URL(fileURLWithPath: configData[0])
let listDirectory = URL(fileURLWithPath: configData[1])
let logPath = try String(contentsOf: configFile)
.trimmingCharacters(in: .whitespaces)
let logFile = URL(fileURLWithPath: logPath)
let listDirectory = URL(fileURLWithPath: app.directory.publicDirectory)
.appendingPathComponent("lists")
try Log.set(logFile: logFile.path)