Add colors to each event in hendelse

This commit is contained in:
Peder Bergebakken Sundt 2018-02-20 19:36:06 +01:00
parent f6174706f8
commit 550161bba2
6 changed files with 21 additions and 4 deletions

View File

@ -49,4 +49,5 @@ abstract class Event {
public abstract function getDescription(); /* : string */
public abstract function getColor(); /* : string */
}

View File

@ -56,4 +56,8 @@ class SimpleEvent extends Event {
return $this->isDBEvent;
}
public function getColor() {
return "#3b7";
}
}

View File

@ -41,4 +41,8 @@ class AnimekveldEvent extends Event {
];
}
public function getColor() {
return "#35a";
}
}

View File

@ -60,4 +60,8 @@ class BrettspillEvent extends Event {
];
}
public function getColor() {
return "#000";
}
}

View File

@ -43,4 +43,8 @@ class NerdepitsaEvent extends Event {
];
}
public function getColor() {
return "#c35";
}
}

View File

@ -5,14 +5,14 @@ $translation = ['I dag', 'I morgen', 'Denne uka', 'Neste uke', 'Denne måneden',
?>
<!DOCTYPE html>
<html lang="no">
<title>Aktivitetsverkstedet</title>
<title>Hendelsesverkstedet</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/events.css">
<header>Aktivitets&shy;verk&shy;stedet</header>
<header>Hendelses&shy;verk&shy;stedet</header>
<main>
<article>
@ -24,7 +24,7 @@ foreach($agenda->getNextDays() as $period => $events) {
<h2><?= $translation[$period] ?></h2>
<ul class="events">
<?php foreach($events as $event) {?>
<li>
<li style="border-color: <?= $event->getColor() ?>">
<h4><strong>
<?php if ($event->getURL()) { ?>
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
@ -52,6 +52,6 @@ foreach($agenda->getNextDays() as $period => $events) {
</main>
<nav>
<?= navbar(1, 'aktiviteter'); ?>
<?= navbar(1, 'hendelser'); ?>
<?= loginbar($sp, $pdo); ?>
</nav>