Commit 72f898e9 authored by Florian Moser's avatar Florian Moser
Browse files

Announce REPLICATE

parent 66df8e9b
......@@ -34,7 +34,7 @@ include "../templates/head.html"
<section>
<div class="container">
<div class="alert alert-danger">
Sorry, we could not find what you were looking for!
Sorry, we could not find what you were looking for at <?= $_SERVER["REQUEST_URI"] ?>!
Contact us and we'll find it for you :)
</div>
</div>
......@@ -54,7 +54,7 @@ include "../templates/head.html"
<div class="logo-wrapper">
<img class="img-fluid logo" src="/images/logo.svg" alt="the alternative logo">
</div>
<div class="spacer"></div>
<p>
We are students of ETH who help you with linux<br/>
......@@ -66,6 +66,11 @@ include "../templates/head.html"
Because we love Open Source and Free Software<br/>
and want to help you to get started (<a class="smooth-scroll" href="#philosophy">here's why</a>).
</p>
<p>
This semester, we organize <a href="https://events.thealternative.ch" target="_blank">REPLICATE</a>: Events<br/>
to help you use and produce Free and Open<br/>
Science, Hardware, Software and File Formats.
</p>
<div class="resources">
<p>
......@@ -83,12 +88,22 @@ include "../templates/head.html"
</div>
</section>
<?php
<section id="events">
<div class="container">
<div class="events">
<p class="event">
Some of our events part of REPLICATE need a sufficient number of registrations before they are officially announced.
Register and promote your favorite events at <a href="https://events.thealternative.ch" target="_blank">events.thealternative.ch</a> to help make them happen!
</p>
<?php
$eventFiles = getFutureEventFiles();
printEventsSection($eventFiles, true);
$eventFiles = getFutureEventFiles();
printEventsList($eventFiles, true);
?>
?>
</div>
</div>
</section>
<section class="inverted" id="contact">
<div class="container">
......
......@@ -23,14 +23,20 @@ include "../templates/header.html"
</div>
</section>
<?php
<section id="events">
<div class="container">
<div class="events">
<?php
$eventFiles = getPastEventFiles();
$reversedEventFiles = array_reverse($eventFiles);
$eventFiles = getPastEventFiles();
$reversedEventFiles = array_reverse($eventFiles);
printEventsSection($reversedEventFiles);
printEventsList($reversedEventFiles);
?>
?>
</div>
</div>
</section>
<?php
include "../templates/scripts.html"
......
......@@ -63,107 +63,104 @@ function getEvent(string $filePath)
return $event;
}
function printEventsSection(array $relevantEventFiles, bool $areFutureEvents = false)
{ ?>
<section id="events">
<div class="container">
<div class="events">
<?php
// restrict list of future of events to 5, then show a "show more" link
$maxEventsShown = $areFutureEvents ? 5 : 200;
foreach ($relevantEventFiles as $relevantEventFile) {
$event = getEvent($relevantEventFile);
?>
<div class="event<?= --$maxEventsShown < 0 ? ' d-none' : '' ?><?= $event['name'] == 'Stammtisch' ? ' stammtisch' : '' ?>">
<?php if (isset($event["cancelled"]) && $event["cancelled"]) { ?>
<span class="badge badge-danger">cancelled</span>
<?php } ?>
<?php if (isset($event["tentative"]) && $event["tentative"]) { ?>
<span class="badge badge-warning">tentative</span>
<?php } ?>
<?php if (isset($event["online"]) && $event["online"]) { ?>
<span class="badge badge-success">online</span>
<?php } ?>
<?php if (isset($event["confirmed"]) && $event["confirmed"]) { ?>
<span class="badge badge-success">confirmed</span>
<?php } ?>
<h2><?= $event["name"] ?></h2>
<p class="subtitle">
<?= $event["date"] ?> |
<?php if (filter_var($event["location"], FILTER_VALIDATE_URL)) { ?>
<a href="<?= $event["location"] ?>" target="_blank"><?= $event["location"] ?></a>
<?php } else { ?>
<?= $event["location"] ?>
<?php } ?>
<?php if (isset($event["signup"])) { ?>
| <a target="_blank" href="<?= $event["signup"] ?>">register</a>
<?php } ?>
</p>
<div class="description">
<?php if (isset($event["cancelled"]["reason"])) { ?>
<p class="alert alert-danger"><?= $event["cancelled"]["reason"] ?></p>
<?php } ?>
<?php if (isset($event["tentative"]["reason"])) { ?>
<p class="alert alert-warning"><?= $event["tentative"]["reason"] ?></p>
<?php } ?>
<?php if (isset($event["confirmed"]["reason"])) { ?>
<p class="alert alert-success"><?= $event["confirmed"]["reason"] ?></p>
<?php } ?>
<p>
<?= nl2br($event["description"]) ?>
<?php
if (isset($event["files"])) { ?>
<br/>
<span class="links">
<?php foreach ($event["files"] as $file) {
$path = $file["path"];
$target = filter_var($path, FILTER_VALIDATE_URL) ? $path : "/files/" . $path;
?>
<span class="link">
<a target="_blank" href="<?= $target ?>"><?= $file["name"] ?></a>
</span>
<?php } ?>
</span>
<?php } ?>
</p>
<?php
if (isset($event["sponsor"])) { ?>
<p class="mb-2"><em>Generously supported by</em></p>
<a target="_blank" href="<?= $event["sponsor"]["href"] ?>">
<img class="img-fluid sponsor-image"
src="images/sponsors/<?= $event["sponsor"]["image_src"] ?>"
alt="<?= substr($event["sponsor_image"]["image_src"], 0, -4) ?>">
</a>
<?php } ?>
</div>
</div>
function printEventsList(array $relevantEventFiles, bool $areFutureEvents = false)
{
// restrict list of future of events to 5, then show a "show more" link
$maxEventsShown = $areFutureEvents ? 5 : 200;
foreach ($relevantEventFiles as $relevantEventFile) {
$event = getEvent($relevantEventFile);
?>
<div class="event<?= --$maxEventsShown < 0 ? ' d-none' : '' ?><?= $event['name'] == 'Stammtisch' ? ' stammtisch' : '' ?>">
<?php
/** hide badges, as all events are going to happen (although online)
<?php if (isset($event["cancelled"]) && $event["cancelled"]) { ?>
<span class="badge badge-danger">cancelled</span>
<?php } ?>
<?php if (isset($event["tentative"]) && $event["tentative"]) { ?>
<span class="badge badge-warning">tentative</span>
<?php } ?>
<?php if (isset($event["online"]) && $event["online"]) { ?>
<span class="badge badge-success">online</span>
<?php } ?>
<?php if (isset($event["confirmed"]) && $event["confirmed"]) { ?>
<span class="badge badge-success">confirmed</span>
<?php } ?>
**/ ?>
<h2><?= $event["name"] ?></h2>
<p class="subtitle">
<?= $event["date"] ?> |
<?php if (filter_var($event["location"], FILTER_VALIDATE_URL)) { ?>
<a href="<?= $event["location"] ?>" target="_blank"><?= $event["location"] ?></a>
<?php } else { ?>
<?= $event["location"] ?>
<?php } ?>
<?php if (isset($event["signup"])) { ?>
| <a target="_blank" href="<?= $event["signup"] ?>">register</a>
<?php } ?>
</p>
<div class="description">
<?php if (isset($event["cancelled"]["reason"])) { ?>
<p class="alert alert-danger"><?= $event["cancelled"]["reason"] ?></p>
<?php } ?>
<?php if (isset($event["tentative"]["reason"])) { ?>
<p class="alert alert-warning"><?= $event["tentative"]["reason"] ?></p>
<?php } ?>
<?php if (isset($event["confirmed"]["reason"])) { ?>
<p class="alert alert-success"><?= $event["confirmed"]["reason"] ?></p>
<?php } ?>
<p>
<?= nl2br($event["description"]) ?>
<?php
if (isset($event["files"])) { ?>
<br/>
<span class="links">
<?php foreach ($event["files"] as $file) {
$path = $file["path"];
$target = filter_var($path, FILTER_VALIDATE_URL) ? $path : "/files/" . $path;
?>
<span class="link">
<a target="_blank" href="<?= $target ?>"><?= $file["name"] ?></a>
</span>
<?php } ?>
</span>
<?php } ?>
</p>
<?php if ($areFutureEvents) { ?>
<div class="history">
<div class="row">
<div class="col">
<?php if ($maxEventsShown < 0) { ?>
<p>
<a id="view-all-events" href="#">
view all upcoming events
</a>
</p>
<?php } ?>
</div>
<div class="col">
<p class="text-right">
<a href="/past">view past events</a>
</p>
</div>
</div>
</div>
<?php
if (isset($event["sponsor"])) { ?>
<p class="mb-2"><em>Generously supported by</em></p>
<a target="_blank" href="<?= $event["sponsor"]["href"] ?>">
<img class="img-fluid sponsor-image"
src="images/sponsors/<?= $event["sponsor"]["image_src"] ?>"
alt="<?= substr($event["sponsor_image"]["image_src"], 0, -4) ?>">
</a>
<?php } ?>
</div>
</div>
</section>
<?php } ?>
<?php
}
if ($areFutureEvents) { ?>
<div class="history">
<div class="row">
<div class="col">
<?php if ($maxEventsShown < 0) { ?>
<p>
<a id="view-all-events" href="#">
view all upcoming events
</a>
</p>
<?php } ?>
</div>
<div class="col">
<p class="text-right">
<a href="/past">view past events</a>
</p>
</div>
</div>
</div>
<?php
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment