Merge pull request #2 from halworsen/redesign

New design
This commit is contained in:
Markus Wang Halvorsen 2018-02-24 17:15:31 +01:00 committed by GitHub
commit ec69d5f724
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
32 changed files with 1277 additions and 953 deletions

View File

@ -40,11 +40,10 @@ function loginBar($sp = null, $pdo = null) {
$attr = $as->getAttributes(); $attr = $as->getAttributes();
if($attr) { if($attr) {
$uname = $attr['uid'][0]; $uname = $attr['uid'][0];
$isAdmin = false;
if (isset($pdo)) { if (isset($pdo)) {
$userManager = new \pvv\admin\UserManager($pdo); $userManager = new \pvv\admin\UserManager($pdo);
$isAdmin = $userManager->isAdmin($uname); $isAdmin = $userManager->isAdmin($uname);
} else {
$isAdmin = false;
} }
$result .= "\n\t<ul id=\"usermenu\">\n"; $result .= "\n\t<ul id=\"usermenu\">\n";
$result .= "\n\t\t<li><a id=\"login\" href=\"#\">${svg}" . htmlspecialchars($uname) . "</a></li>\n"; $result .= "\n\t\t<li><a id=\"login\" href=\"#\">${svg}" . htmlspecialchars($uname) . "</a></li>\n";

28
pvv.sql Normal file
View File

@ -0,0 +1,28 @@
CREATE TABLE "events" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"start" TEXT,
"stop" TEXT,
"organiser" TEXT,
"location" TEXT,
"description" TEXT
);
CREATE TABLE "projects" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"name" TEXT,
"owner" TEXT,
"owneruname" TEXT,
"description" TEXT,
"active" BOOLEAN
);
CREATE TABLE "users" (
"uname" TEXT,
"groups" INT DEFAULT 0
);
CREATE TABLE "motd" (
"title" TEXT,
"content" TEXT
);

23
src/pvv/side/motd.php Normal file
View File

@ -0,0 +1,23 @@
<?php
namespace pvv\side;
use \PDO;
class MOTD{
private $pdo;
public function __construct($pdo){
$this->pdo = $pdo;
}
public function getMOTD(){
$query = 'SELECT * FROM motd LIMIT 1';
$statement = $this->pdo->prepare($query);
$statement->execute();
$data = $statement->fetch();
$motd = array("title" => $data[0], "content" => explode("\n", $data[1]));
return $motd;
}
}

View File

@ -7,7 +7,7 @@ class Project{
public function __construct($id, $name, $descr, $owner, $owneruname, $active){ public function __construct($id, $name, $descr, $owner, $owneruname, $active){
$this->id = $id; $this->id = $id;
$this->name = $name; $this->name = $name;
$this->descr = $descr; $this->descr = explode("\n", $descr);
$this->owner = $owner; $this->owner = $owner;
$this->owneruname = $owneruname; $this->owneruname = $owneruname;
$this->active = $active; $this->active = $active;

View File

@ -54,17 +54,25 @@ if($new == 0){
} }
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../../css/nav.css">
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<header class="admin">Aktivitets&shy;administrasjon</header> <body>
<nav>
<?php echo navbar(3, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Aktivietsadministrasjon</h2>
<hr class="ruler">
<article>
<h2><?= ($new == 1 ? "Ny hendelse" : "Rediger hendelse"); ?></h2> <h2><?= ($new == 1 ? "Ny hendelse" : "Rediger hendelse"); ?></h2>
<form action="update.php", method="post" class="gridsplit5050"> <form action="update.php", method="post" class="gridsplit5050">
@ -83,10 +91,10 @@ if($new == 0){
<p class="subtitle">Sluttid (YYYY-MM-DD HH:MM:SS)</p> <p class="subtitle">Sluttid (YYYY-MM-DD HH:MM:SS)</p>
<?= '<input name="end" type="text" class="boxinput" value="' . $event->getStop()->format('Y-m-d H:00:00') . '"><br>' ?> <?= '<input name="end" type="text" class="boxinput" value="' . $event->getStop()->format('Y-m-d H:00:00') . '"><br>' ?>
<p class="subtitle">Organisert av</p> <p class="subtitle">Arrangør</p>
<?= '<input type="text" name="organiser" value="' . $event->getOrganiser(). '" class="boxinput">' ?><br> <?= '<input type="text" name="organiser" value="' . $event->getOrganiser(). '" class="boxinput">' ?><br>
<p class="subtitle">Hvor?</p> <p class="subtitle">Sted</p>
<?= '<input type="text" name="location" value="' . $event->getLocation(). '" class="boxinput">' ?><br> <?= '<input type="text" name="location" value="' . $event->getLocation(). '" class="boxinput">' ?><br>
</div> </div>
@ -102,11 +110,5 @@ if($new == 0){
<p> <p>
</article> </main>
</body>
</main>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -47,17 +47,26 @@ $events = array_values(array_filter(
)); ));
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../../css/nav.css">
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<header class="admin">Aktivitets&shy;administrasjon</header> <body>
<nav>
<?php echo navbar(2, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Aktivitetsadministrasjon</h2>
<hr class="ruler">
<article class="gridsplit"> <div class="gridsplit">
<div class="gridl"> <div class="gridl">
<h2 class="no-chin">Aktive aktiviteter</h2> <h2 class="no-chin">Aktive aktiviteter</h2>
<p class="subnote">Gjentagende aktiviteter vises ikke</p> <p class="subnote">Gjentagende aktiviteter vises ikke</p>
@ -83,7 +92,7 @@ $events = array_values(array_filter(
<p class="subnote"> <p class="subnote">
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?> <?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
</p> </p>
<p><?= implode($event->getDescription(), "</p>\n<p>"); ?></p> <p><?= implode($event->getDescription(), "<br>"); ?></p>
</div> </div>
<div class="event-actions"> <div class="event-actions">
@ -126,11 +135,6 @@ $events = array_values(array_filter(
</div> </div>
</form> </form>
</div> </div>
</article> </div>
</main>
</main> </body>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -28,24 +28,26 @@ if(!$userManager->isAdmin($uname)){
$users = $userManager->getAllUserData(); $users = $userManager->getAllUserData();
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<nav> <body>
<?php echo navbar(2, ''); ?> <nav>
<?php echo loginbar(); ?> <?php echo navbar(2, 'admin'); ?>
</nav> <?php echo loginbar(null, $pdo); ?>
</nav>
<header class="admin">Bruker&shy;administrasjon</header> <main>
<h2>Brukeradministrasjon</h2>
<hr class="ruler">
<main> <form action="./update.php" method="post">
<article> <table class="userlist">
<form action="./update.php" method="post">
<table class="userlist">
<tr><th>Brukernavn</th><th>Brukergrupper</th></tr> <tr><th>Brukernavn</th><th>Brukergrupper</th></tr>
<?php <?php
@ -83,9 +85,8 @@ $users = $userManager->getAllUserData();
} }
?> ?>
</tr> </tr>
</table> </table>
<input type="submit" class="btn" value="Lagre"> <input type="submit" class="btn" value="Lagre">
</form> </form>
</main>
</article> </body>
</main>

View File

@ -1,6 +1,11 @@
<?php <?php
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']); require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$userManager = new \pvv\admin\UserManager($pdo);
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth(); $as->requireAuth();
$attrs = $as->getAttributes(); $attrs = $as->getAttributes();
$uname = $attrs['uid'][0]; $uname = $attrs['uid'][0];
@ -16,36 +21,40 @@ if(!($isAdmin | $projectGroup | $activityGroup)){
} }
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/events.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/admin.css"> <link rel="stylesheet" href="../css/events.css">
<link rel="stylesheet" href="../css/admin.css">
</head>
<header class="admin">Stor-&shy;gutt-&shy;leketøy</header> <body>
<nav id="navbar">
<?php echo navbar(1, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Voksenleketøy</h2>
<article> <ul class="tools">
<h2>Verktøy</h2>
<?php <?php
if($isAdmin | $activityGroup){ if($isAdmin | $activityGroup){
echo '<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>'; echo '<li><a class="btn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a></li>';
} }
if($isAdmin | $projectGroup){ if($isAdmin | $projectGroup){
echo '<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>'; echo '<li><a class="btn" href="prosjekter/">Prosjekter</a></li>';
}
if($isAdmin) {
echo '<li><a class="btn" href="motd/">Dagens melding</a></li>';
} }
if($isAdmin){ if($isAdmin){
echo '<a class="btn adminbtn" href="brukere/">Brukere</a>'; echo '<li><a class="btn" href="brukere/">Brukere</a></li>';
} }
?> ?>
</article> <ul>
</main>
</main> </body>
<nav>
<?= navbar(1); ?>
<?= loginbar(null, $pdo); ?>
</nav>

66
www/admin/motd/index.php Normal file
View File

@ -0,0 +1,66 @@
<?php
ini_set('display_errors', '1');
date_default_timezone_set('Europe/Oslo');
setlocale(LC_ALL, 'no_NO');
error_reporting(E_ALL);
require __DIR__ . '/../../../inc/navbar.php';
require __DIR__ . '/../../../src/_autoload.php';
require __DIR__ . '/../../../sql_config.php';
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$attrs = $as->getAttributes();
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$userManager = new \pvv\admin\UserManager($pdo);
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth();
$attrs = $as->getAttributes();
$uname = $attrs['uid'][0];
if(!$userManager->isAdmin($uname)){
echo 'Her har du ikke lov\'t\'å\'værra!!!';
exit();
}
$motdfetcher = new \pvv\side\MOTD($pdo);
$motd = $motdfetcher->getMOTD();
?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/nav.css">
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<body>
<nav>
<?php echo navbar(2, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main>
<h2>Dagens melding</h2>
<hr class="ruler">
<form action="update.php", method="post">
<p class="subtitle no-chin">Tittel</p>
<p class="subnote">Ikke nødvendig</p>
<input type="text" name="title" value="<?= $motd['title'] ?>" class="boxinput" style="width:66%;"><br>
<p class="subtitle no-chin">Innhold</p>
<textarea name="content" style="width:100%" rows="8" class="boxinput"><?= implode($motd["content"], "\n") ?></textarea>
<div style="margin-top: 2em;">
<hr class="ruler">
<?= '<input type="submit" class="btn" value="Lagre endringer"></a>'; ?>
</div>
</form>
</main>
</body>

39
www/admin/motd/update.php Normal file
View File

@ -0,0 +1,39 @@
<?php
ini_set('display_errors', '1');
date_default_timezone_set('Europe/Oslo');
setlocale(LC_ALL, 'no_NO');
error_reporting(E_ALL);
require __DIR__ . '/../../../src/_autoload.php';
require __DIR__ . '/../../../sql_config.php';
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$userManager = new \pvv\admin\UserManager($pdo);
require_once(__DIR__ . '/../../../vendor/simplesamlphp/simplesamlphp/lib/_autoload.php');
$as = new SimpleSAML_Auth_Simple('default-sp');
$as->requireAuth();
$attrs = $as->getAttributes();
$uname = $attrs['uid'][0];
if(!isset($_POST['title']) or !isset($_POST['content'])){
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit();
}
if(!$userManager->isAdmin($uname)){
echo 'Her har du ikke lov\'t\'å\'værra!!!';
exit();
}
$query = 'UPDATE motd SET title=:title, content=:content';
$statement = $pdo->prepare($query);
$statement->bindParam(':title', $_POST['title'], PDO::PARAM_STR);
$statement->bindParam(':content', $_POST['content'], PDO::PARAM_STR);
$statement->execute();
header('Location: .');
?>
<a href=".">Om du ikke ble automatisk omdirigert tilbake klikk her</a>

View File

@ -49,17 +49,25 @@ if($new == 0){
} }
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../../css/nav.css">
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<header class="admin">Prosjekt&shy;administrasjon</header> <body>
<nav>
<?php echo navbar(3, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Prosjektadministrasjon</h2>
<hr class="ruler">
<article>
<h2><?= ($new == 1 ? "Nytt prosjekt" : "Rediger prosjekt"); ?></h2> <h2><?= ($new == 1 ? "Nytt prosjekt" : "Rediger prosjekt"); ?></h2>
<form action="update.php", method="post" class="gridsplit5050"> <form action="update.php", method="post" class="gridsplit5050">
@ -68,14 +76,14 @@ if($new == 0){
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br> <?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
<p class="subtitle">Beskrivelse</p> <p class="subtitle">Beskrivelse</p>
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= $project->getDescription(); ?></textarea> <textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
</div> </div>
<div class="gridr noborder"> <div class="gridr noborder">
<p class="subtitle">Prosjekteier (Brukernavn)</p> <p class="subtitle">Prosjektleder (Brukernavn)</p>
<?= '<input type="text" name="organiser" value="' . $project->getOwnerUName(). '" class="boxinput">' ?><br> <?= '<input type="text" name="organiser" value="' . $project->getOwnerUName(). '" class="boxinput">' ?><br>
<p class="subtitle">Prosjekteier (Navn)</p> <p class="subtitle">Prosjektleder (Navn)</p>
<?= '<input type="text" name="organisername" value="' . $project->getOwner(). '" class="boxinput">' ?> <?= '<input type="text" name="organisername" value="' . $project->getOwner(). '" class="boxinput">' ?>
<p class="subtitle">Aktiv</p> <p class="subtitle">Aktiv</p>
@ -91,11 +99,5 @@ if($new == 0){
</div> </div>
</form> </form>
<p> <p>
</article> </main>
</body>
</main>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -47,17 +47,26 @@ $projects = array_values(array_filter(
)); ));
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../../css/nav.css">
<link rel="stylesheet" href="../../css/events.css">
<link rel="stylesheet" href="../../css/admin.css">
</head>
<header class="admin">Prosjekt&shy;administrasjon</header> <body>
<nav>
<?php echo navbar(2, 'admin'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Prosjektadministrasjon</h2>
<hr class="ruler">
<article class="gridsplit"> <div class="gridsplit">
<div class="gridl"> <div class="gridl">
<h2 class="no-chin">Prosjekter</h2> <h2 class="no-chin">Prosjekter</h2>
@ -80,7 +89,7 @@ $projects = array_values(array_filter(
<div class="event-info"> <div class="event-info">
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3> <h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
<p class="subnote"><?= 'Organisert av: ' . $project->getOwner(); ?></p> <p class="subnote"><?= 'Organisert av: ' . $project->getOwner(); ?></p>
<p><?= $project->getDescription(); ?></p> <p><?= implode($project->getDescription(), "<br>"); ?></p>
</div> </div>
<div class="event-actions"> <div class="event-actions">
@ -112,9 +121,9 @@ $projects = array_values(array_filter(
<a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a> <a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a>
<h2>Filter</h2> <h2>Filter</h2>
<form action="." method="post"> <form action="." method="post">
<p class="no-chin">Navn</p> <p class="no-chin">Prosjektnavn</p>
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br> <?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
<p class="no-chin">Organisator</p> <p class="no-chin">Leders brukernavn</p>
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br> <?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
<div style="margin-top: 2em;"> <div style="margin-top: 2em;">
@ -122,11 +131,7 @@ $projects = array_values(array_filter(
</div> </div>
</form> </form>
</div> </div>
</article> </div>
</main>
</main> </body>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -14,36 +14,42 @@ $day = (isset($_GET['day']))
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="no"> <html lang="no">
<title>Aktivitetsverkstedet</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> <head>
<title>Aktivitetsverkstedet</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">
</head>
<main> <body>
<nav>
<?php echo navbar(1, 'aktiviteter'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<?php <main>
use \DateTimeImmutable; <?php
$events = ($day==-1) use \DateTimeImmutable;
$events = ($day==-1)
? $agenda->getNextOfEach(new \DateTimeImmutable) ? $agenda->getNextOfEach(new \DateTimeImmutable)
: $agenda->getEventsBetween( : $agenda->getEventsBetween(
new DateTimeImmutable("$year-$month-$day 00:00:00"), new DateTimeImmutable("$year-$month-$day 00:00:00"),
new DateTimeImmutable("$year-$month-$day 23:59:59")); new DateTimeImmutable("$year-$month-$day 23:59:59"));
$limit = 0; $limit = 0;
foreach($events as $event) { foreach($events as $event) {
?> ?>
<article> <div>
<h2> <h2>
<?php if ($event->getImageURL()) { ?> <?php if ($event->getImageURL()) { ?>
<img src="<?= $event->getImageURL() ?>"> <img src="<?= $event->getImageURL() ?>">
<?php } ?> <?php } ?>
<?php if (Agenda::isToday($event->getStart())) { ?><strong><?php } ?> <?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
<em><?= $event->getRelativeDate() ?></em> <em><?= $event->getRelativeDate() ?></em>
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?> <?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
<?php if ($event->getURL()) { ?> <?php if ($event->getURL()) { ?>
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a> <a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
<?php } else { ?> <?php } else { ?>
@ -51,22 +57,18 @@ foreach($events as $event) {
<?php } ?> <?php } ?>
</h2> </h2>
<ul class="subtext"> <ul class="subtext">
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong> <li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong></li>
<li>Sted: <strong><?= $event->getLocation() ?></strong> <li>Sted: <strong><?= $event->getLocation() ?></strong></li>
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong> <li>Arrangør: <strong><?= $event->getOrganiser() ?></strong></li>
</ul> </ul>
<?php $description = $event->getDescription(); ?> <?php $description = $event->getDescription(); ?>
<?php if ($limit) array_splice($description, $limit); ?> <?php if ($limit) array_splice($description, $limit); ?>
<?= implode($description, "</p>\n<p>") ?> <?= implode($description, "<br>") ?>
</article> </div>
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?> <?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
<?php } ?> <?php } ?>
</main>
</main> </body>
<nav>
<?= navbar(1, 'aktiviteter'); ?>
<?= loginbar($sp, $pdo); ?>
</nav>

View File

@ -9,6 +9,7 @@ use \pvv\side\Agenda;
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <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/normalize.css">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/nav.css">
<link rel="stylesheet" href="../css/events.css"> <link rel="stylesheet" href="../css/events.css">
<header>Sosial&shy;verk&shy;stedet</header> <header>Sosial&shy;verk&shy;stedet</header>

View File

@ -12,6 +12,7 @@ use \pvv\side\Agenda;
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <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/normalize.css">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/nav.css">
<link rel="stylesheet" href="../css/events.css"> <link rel="stylesheet" href="../css/events.css">
<header>Sosial&shy;verk&shy;stedet</header> <header>Sosial&shy;verk&shy;stedet</header>

View File

@ -1,14 +1,12 @@
header.admin { .tools {
margin-top: 3rem; width: 100%;
height: 16rem; margin: 0;
overflow: hidden; padding: 0;
text-align: right; list-style: none;
color: #fff; }
font-family: monospace;
padding: 1rem; .tools li {
font-size: 4em; margin: 1.5em 0;
background: url('ja.png') no-repeat 1% 50% #024;
background-size: contain;
} }
.event-list { .event-list {
@ -56,39 +54,6 @@ header.admin {
text-decoration: none; text-decoration: none;
} }
.gridsplit {
padding-top: 1.3em;
display: grid;
grid-template-columns: 3fr 1fr;
}
.gridsplit5050 {
display: grid;
grid-template-columns: 1fr 1fr;
}
.gridl {
height: 100%;
grid-column: 1;
}
.gridr {
height: 100%;
padding: 0 1em;
margin-left: 1em;
border-left: 1px dotted rgba(0,0,0,0.5);
grid-column: 2;
}
.gridsplit h1:first-child,
.gridsplit h2:first-child,
.gridsplit h3:first-child,
.gridsplit h4:first-child,
.gridsplit h5:first-child,
.gridsplit h6:first-child {
margin-top: 0;
}
.allgrids { .allgrids {
grid-column: 1 / -1; grid-column: 1 / -1;
} }
@ -101,27 +66,6 @@ header.admin {
float: left; float: left;
} }
.btn {
text-decoration: none;
border: 1px solid #048;
color: #048;
padding: .2em 1em;
border-radius: .2em;
white-space: nowrap;
display: inline-block;
margin-bottom: .25em;
}
.btn:hover {
border-color: #084;
background: #eee;
color: #084;
}
.btn:active {
border-color: #084;
background: #084;
color: white;
}
.userlist { .userlist {
table-layout: fixed; table-layout: fixed;
width: 100%; width: 100%;

142
www/css/landing.css Normal file
View File

@ -0,0 +1,142 @@
header {
margin: 0;
margin-top: 3em;
padding: 3vh 15vw;
width: 70vw;
background-color: #002244;
color: #fff;
}
header .logo {
display: block;
width: 24vh;
height: 24vh;
margin: auto;
}
main {
margin-top: 0;
}
.info {
text-align: center;
width: 100%;
padding: 0;
margin: 0;
overflow-y: hidden;
}
.essentials {
width: 100%;
margin: 1.8em 0;
padding: 0;
list-style: none;
display: flex;
align-items: center;
justify-content: center;
}
.essentials li {
display: inline-block;
}
.essentials a {
margin: 0 2em;
height: 100%;
}
.essentials .join {
padding: 1em;
font-size: 1.2em;
}
img.float-right {
float: right;
max-width: 12em;
max-height: 12em;
vertical-align: baseline;
}
.calendar-events {
padding: 0;
margin-bottom: 1.5em;
list-style: none;
}
.calendar-events ul .date {
color: rgba(0,0,0,.5);
font-size: 0.8em;
margin-top: .2em;
}
.calendar-events > li > p {
border-bottom: .1em dotted rgba(0,0,0,.2);
}
.calendar-events ul {
list-style: none;
padding: 0;
}
.calendar-events a, #ticker a {
text-decoration: none;
font-weight: bold;
color: black;
}
.calendar-events a:hover, #ticker a:hover {
text-decoration: underline;
}
.calendar-events ul .time {
color: rgba(0,0,0,.5);
float: right;
}
.calendar-events ul .icon, .calendar-events ul .date {
float: right;
margin-right: .5em;
}
.contentsplit {
display: grid;
grid-template-columns: 2.5fr 1.5fr;
}
.gridr {
border-left: 0;
}
@media screen and (max-width: 50rem) {
.essentials {
flex-direction: column;
}
.essentials a {
margin: .2em 0;
}
}
@media screen and (max-width: 65rem) {
.contentsplit {
display: block;
}
.gridr {
height: auto;
padding: 0;
margin-left: 0;
margin-bottom: 3em;
}
.gridr br {
margin: 0;
height: 0px;
}
.gridl {
margin-top: 0;
padding: 0;
}
}

BIN
www/css/logo-disk-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
www/css/logo-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

59
www/css/projects.css Normal file
View File

@ -0,0 +1,59 @@
.project-card {
position: relative;
display: inline-block;
vertical-align: top;
border-radius: 4px;
width: 18em;
height: 8em;
padding: 0;
margin: 0 1em 1em 0;
border: 1px solid #002244;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
}
.project-title {
padding-bottom: .1em;
margin: 0;
text-overflow: ellipsis;
}
.card-content {
display: block;
overflow: hidden;
margin: 0;
padding: .6em;
height: 4.3em;
}
.card-content p {
height: 2.5em;
overflow: hidden;
line-height: 1.25em;
}
.project-organizer {
position: absolute;
bottom: 0;
left: 0;
right: 0;
margin: 0;
padding: .3em .6em;
border-top: 1px solid #002244;
font-size: .8em;
}
.card-content * {
margin-top: 0;
}
.projects-divider {
border: 0;
margin-bottom: 2em;
}
@media screen and (max-width: 50rem) {
.projects {
display: inline-block;
}
}

View File

@ -1,70 +0,0 @@
img.float-right {
float: right;
max-width: 12em;
max-height: 12em;
vertical-align: baseline;
}
.calendar-events {
padding: 0;
list-style: none;
}
.calendar-events ul .date {
color: rgba(0,0,0,.5);
font-size: 0.8em;
margin-top: .2em;
}
.calendar-events > li > p {
border-bottom: .1em dotted rgba(0,0,0,.2);
}
.calendar-events ul {
list-style: none;
padding: 0 .5em;
}
.calendar-events a, #ticker a {
text-decoration: none;
font-weight: bold;
color: black;
}
.calendar-events a:hover, #ticker a:hover {
text-decoration: underline;
}
.calendar-events ul .time {
color: rgba(0,0,0,.5);
float: right;
}
.calendar-events ul .icon, .calendar-events ul .date {
float: right;
margin-right: .5em;
}
#ticker {
position: absolute;
max-width: 60rem;
margin: 0 auto;
top: 11rem;
left: 0;
right: 0;
padding: 0;
list-style: none;
}
#ticker li {
margin: 0 1rem;
padding: .5em 1em;
background: linear-gradient(to bottom, #fff 75%,#fafafa 100%);
border-radius: .5rem;
box-shadow: 0 .1rem .15rem rgba(0,0,0,.3);
}
@media screen and (max-width: 50rem) {
#ticker {
top: 7rem;
}
#ticker li {
margin: 0 .5rem;
}
main {
margin: -11rem auto 0 auto;
}
}

View File

@ -190,107 +190,90 @@ nav #usermenu li:first-child:hover {
top: 0; top: 0;
} }
} }
header {
margin-top: 3rem; body {
height: 16rem; overflow-y: scroll;
overflow: hidden; overflow-x: hidden;
text-align: right;
color: #fff;
font-family: monospace;
padding: 1rem;
font-size: 4em;
background: url('pvv-background.png') no-repeat 1% 50% #024;
background-size: contain;
} }
* {
font-style: -apple-system, 'avenir next', avenir, roboto, noto, ubuntu, 'helvetica neue', helvetica, arial, sans-serif;
}
main { main {
max-width: 60rem; padding: 1em 15vw;
margin: -7rem auto 0 auto; height: 100vh;
padding: 0; margin-top: 7vh;
background-color: #fff;
} }
article {
padding: .1rem 1rem 1rem 1rem; main h2 {
margin: 0 1rem 0 1rem; color: #002244;
background: white;
z-index: 2; /* Make appear under #menu */ z-index: 2; /* Make appear under #menu */
position: relative; position: relative;
} }
article p {
text-align: justify; article {
hyphens: auto; margin-bottom: 7vh;
}
article:first-child {
border-radius: .5rem .5rem 0 0;
}
main:before {
content: " ";
display: block;
position: absolute;
top: 16rem;
left: 1rem;
right: 1rem;
margin: 0 auto;
height: 8em;
z-index: 1; /* Make appear under article */
max-width: 58rem;
box-shadow: 0 -.2rem .15rem rgba(0,0,0,.3);
border-radius: 0 0 .3em .3em;
background: white;
} }
.split { .gridsplit {
display: table; padding-top: 1.3em;
width: 100%; display: grid;
table-layout: fixed; grid-template-columns: 3fr 1fr;
border-spacing: 1em;
}
.split > * {
display: table-cell;
} }
.subtitle { .gridsplit5050 {
font-weight: bold; display: grid;
grid-template-columns: 1fr 1fr;
} }
.ruler { .gridsplitthirds {
border: none; display: grid;
border-bottom: 1px dotted rgba(0,0,0,.5); grid-column-gap: 2em;
column-rule-style: dotted;
grid-template-columns: 1fr 1fr 1fr;
} }
a.btn { .gridl {
height: 100%;
grid-column: 1;
grid-row: 1;
}
.gridr {
height: 100%;
padding: 0 1em;
margin-left: 1em;
border-left: 1px dotted rgba(0,0,0,0.5);
grid-column: 2;
}
.gridsplit h1:first-child,
.gridsplit h2:first-child,
.gridsplit h3:first-child,
.gridsplit h4:first-child,
.gridsplit h5:first-child,
.gridsplit h6:first-child {
margin-top: 0;
}
.btn {
padding: .5em;
border-radius: 4px;
text-decoration: none; text-decoration: none;
border: 1px solid #048; color: #fff;
color: #048; background-color: #002244;
padding: .2em 1em;
border-radius: .2em; transition: background-color .2s ease;
white-space: nowrap;
display: inline-block;
margin-bottom: .25em;
}
a.btn:hover {
border-color: #084;
background: #eee;
color: #084;
}
a.btn:active {
border-color: #084;
background: #084;
color: white;
} }
.boxinput { .btn:hover {
text-decoration: none; background-color: #00407F;
border: 1px solid #048;
color: #048;
padding: .2em .4em;
border-radius: .2em;
display: inline-block;
margin-bottom: .25em;
resize: none;
}
.noborder { transition: background-color .2s ease;
border: none !important;
} }
.subnote { .subnote {
@ -304,72 +287,7 @@ a.btn:active {
margin-bottom: 0; margin-bottom: 0;
} }
.icon.subscribe { .ruler {
color: white; border: none;
background: #082; border-bottom: 1px dotted rgba(0,0,0,.5);
border-radius: 1em;
width: 1em;
line-height: 1em;
text-align: center;
}
@media screen and (max-width: 50rem) {
.split, .split > * {
display: block;
}
img.float-right {
display: none;
}
nav li {
margin: auto .5em;
}
header {
font-size: 2em;
}
main {
margin: -13rem auto 0 auto;
}
article {
margin: 0 .5rem 0 .5rem;
}
main:before {
left: .5rem;
right: .5rem;
}
}
@media screen and (max-width: 23rem) {
body {
font-size: 0.8em;
}
header {
margin-top: 2.4rem;
}
main:before {
top: 13rem;
height: 13em;
}
}
.collapsable {
display: none;
}
.collapsable:target {
display: block;
}
.noselect {
/* iOS Safari */
-webkit-touch-callout: none;
/* Safari */
-webkit-user-select: none;
/* Konqueror HTML */
-khtml-user-select: none;
/* Firefox */
-moz-user-select: none;
/* Internet Explorer/Edge */
-ms-user-select: none;
/* Non-prefixed version, currently supported by Chrome and Opera */
user-select: none;
} }

View File

@ -2,91 +2,98 @@
require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']); require_once dirname(__DIR__) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
$translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned']; $translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden', 'neste måned'];
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$motdfetcher = new \pvv\side\MOTD($pdo);
$motd = $motdfetcher->getMOTD();
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="no"> <html lang="no">
<title>Programvareverkstedet</title> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Programvareverkstedet</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="css/normalize.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="css/style.css"> <link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/splash.css"> <link rel="stylesheet" href="css/style.css">
<link rel="shortcut icon" href="favicon.ico"> <link rel="stylesheet" href="css/splash.css">
<link rel="stylesheet" href="css/landing.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<header>Program&shy;vare&shy;verk&shy;stedet</header> <body>
<nav id="navbar" class="">
<?php echo navbar(0, ''); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <header>
<img class="logo" src="css/logo-white.png"/>
<div class="info">
<h2>Velkommen til Programvare&shy;verkstedet</h2>
<p>Programvareverkstedet (PVV) er en studentorganisasjon ved NTNU som vil skape et miljø for datainteresserte personer tilknyttet universitetet.</p>
<p>Nåværende og tidligere studenter ved NTNU, samt ansatte ved NTNU og tilstøtende miljø, kan bli medlemmer.</p>
<ul class="essentials">
<a class="btn" href="om/"><li>Om PVV</li></a>
<a class="btn join" href="paamelding/"><li>Bli medlem</li></a>
<a class="btn" href="https://use.mazemap.com/?v=1&amp;left=10.4032&amp;right=10.4044&amp;top=63.4178&amp;bottom=63.4172&amp;campusid=1&amp;zlevel=2&amp;sharepoitype=point&amp;sharepoi=10.40355%2C63.41755%2C2&amp;utm_medium=longurl"><li>Veibeskrivelse</li></a>
</ul>
</div>
</header>
<article class="threed"> <main class="contentsplit">
<img src="pvv-logo.png" class="float-right"> <div class="gridr">
<h2>Velkommen til Program&shy;vare&shy;verk&shy;stedet</h2> <h2>Kommende aktiviteter</h2>
<p>Programvareverkstedet (PVV) vil skape et miljø for datainteresserte personer tilknyttet universitetet. Nåværende og tidligere studenter ved NTNU, samt ansatte ved NTNU og tilstøtende miljø, kan bli medlemmer. </p> <div class="calendar-events">
<p> <?php $counter1 = 0; ?>
<a class="btn" href="om/">Om PVV</a> <?php $counter2 = 0; ?>
<a class="btn" href="paamelding/">Bli medlem</a> <?php foreach($agenda->getNextDays() as $period => $events) if ($events && $counter1 < 3 && $counter2 < 10) { $counter1++ ?>
<a class="btn" href="https://use.mazemap.com/?v=1&amp;left=10.4032&amp;right=10.4044&amp;top=63.4178&amp;bottom=63.4172&amp;campusid=1&amp;zlevel=2&amp;sharepoitype=point&amp;sharepoi=10.40355%2C63.41755%2C2&amp;utm_medium=longurl">Veibeskrivelse</a> <p class="no-chin"><?= $translation[$period] ?></p>
</p> <hr>
</article> <ul>
<?php foreach($events as $event) { $counter2++ ?>
<div class="split"> <li>
<article> <?php if ($event->getURL()) { ?>
<h2>Kommende arrangement</h2>
<ul class="calendar-events">
<?php $counter1 = 0; ?>
<?php $counter2 = 0; ?>
<?php foreach($agenda->getNextDays() as $period => $events) if ($events && $counter1 < 2 && $counter2 < 10) { $counter1++ ?>
<li>
<p><?= $translation[$period] ?></p>
<ul>
<?php foreach($events as $event) { $counter2++ ?>
<li>
<?php if ($event->getURL()) { ?>
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a> <a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a>
<?php } else { ?> <?php } else { ?>
<strong><?= $event->getName(); ?></strong> <strong><?= $event->getName(); ?></strong>
<?php } ?> <?php } ?>
<?php /* <a class="icon subscribe">+</a> */ ?> <?php /* <a class="icon subscribe">+</a> */ ?>
<?php if ($period !== \pvv\side\Agenda::TODAY) { <?php if ($period !== \pvv\side\Agenda::TODAY) {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>'; echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) { if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>'; echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} else { } else {
echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>'; echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
} }
} else { } else {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>'; echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
} }
?> ?>
</li> </li>
<?php } ?> <?php } ?>
</ul> </ul>
<?php } ?> <?php } ?>
</ul> </div>
<p><a class="btn" href="kalender/">Flere aktiviteter</a></p> <p><a class="btn" href="kalender/">Flere aktiviteter</a></p>
</article> </div>
<article>
<h2>Opptak</h2>
<p>
Alle med tilknytning til NTNU kan bli medlem hos oss
og benytte seg av våre ressurser.
<!--
For å bli med i våre prosjekter og komitéer du søke.
-->
</p>
<p>
<a class="btn" href="paamelding/">Bli medlem</a>
<!--
<a class="btn" href="prosjekt/">Søk prosjekt</a>
<a class="btn" href="prosjekt/">Søk komité</a>
-->
</p>
</article>
</div>
</main> <div class="gridl">
<?php
$title = $motd["title"];
<nav> echo "<h2>";
<?php echo navbar(0, ''); ?> if($title == ""){
<?php echo loginbar($sp, $pdo); ?> echo "Dagens melding";
</nav> }else{
echo $title;
}
echo "</h2>";
echo "<p>" . implode($motd["content"], "<br>") . "</p>";
?>
</div>
</main>
</body>
</html>

View File

@ -16,19 +16,24 @@ $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
?><!DOCTYPE html> ?><!DOCTYPE html>
<html lang="no"> <html lang="no">
<title>Kalenderverkstedet</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">
<link rel="stylesheet" href="../css/calendar.css">
<header>Kalender&shy;verk&shy;stedet</header> <head>
<title>Kalenderverkstedet</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">
<link rel="stylesheet" href="../css/calendar.css">
</head>
<main> <body>
<nav>
<?php echo navbar(1, 'kalender'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<article> <main>
<h2 style="text-align:center;">Aktiviteter for <?=$months_translations[$month-1]?> <?=$year?></h2> <h2 style="text-align:center;">Aktiviteter for <?=$months_translations[$month-1]?> <?=$year?></h2>
<p><?php <p><?php
@ -81,12 +86,5 @@ $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
</ul> </ul>
</figure> </figure>
</main>
</article> <body>
</main>
<nav>
<?= navbar(1, 'kalender'); ?>
<?= loginbar($sp, $pdo); ?>
</nav>

View File

@ -1,38 +1,37 @@
<?php <?php
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']); require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
?><!DOCTYPE html> ?>
<!DOCTYPE html>
<html lang="no"> <html lang="no">
<title>Kommunikasjonsverkstedet</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>Kommunikasjons&shy;verk&shy;stedet</header> <head>
<title>Kommunikasjonsverkstedet</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">
</head>
<main> <body>
<nav>
<?php echo navbar(1, 'kontakt'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<article> <main>
<h2>Kommunikasjon</h2>
<h2>Kommunikasjon</h2> <p>
<p> Det er ulike måter å kommunisere med PVV-medlemmer .
Det er ulike måter å kommunisere med PVV-medlemmer . </p>
</p> <p>
<p> Vi har en IRC-kanal <a href="http://webchat.ircnet.net/">IRCnet</a> kalt #pvv.
Vi har en IRC-kanal <a href="http://webchat.ircnet.net/">IRCnet</a> kalt #pvv. </p>
</p> <p>
<p> Vi har også en Discord-kanal. Denne kanalen er satt opp slik at man i Discord-kanalen ser hva som skrives i IRC-kanalen, og vice versa. For å bli med i Discord-kanalen, <a href="https://discord.gg/8VTBr6Q">klikk her</a>.
Vi har også en Discord-kanal. Denne kanalen er satt opp slik at man i Discord-kanalen ser hva som skrives i IRC-kanalen, og vice versa. For å bli med i Discord-kanalen, <a href="https://discord.gg/8VTBr6Q">klikk her</a>. </p>
</p> <p>
<p> Det er også mulig å ta i bruk analog kontakt ved å møte opp <a href="https://use.mazemap.com/?v=1&left=10.4032&right=10.4044&top=63.4178&bottom=63.4172&campusid=1&zlevel=2&sharepoitype=point&sharepoi=10.40355%2C63.41755%2C2&utm_medium=longurl"> stripa</a>.
Det er også mulig å ta i bruk analog kontakt ved å møte opp <a href="https://use.mazemap.com/?v=1&left=10.4032&right=10.4044&top=63.4178&bottom=63.4172&campusid=1&zlevel=2&sharepoitype=point&sharepoi=10.40355%2C63.41755%2C2&utm_medium=longurl"> stripa</a>. </p>
</p> </main>
</article> </body>
</main>
<nav>
<?= navbar(1, 'kontakt'); ?>
<?= loginbar($sp, $pdo); ?>
</nav>

63
www/kurs/index.php Normal file
View File

@ -0,0 +1,63 @@
<?php
date_default_timezone_set('Europe/Oslo');
setlocale(LC_ALL, 'no_NO');
require __DIR__ . '/../../src/_autoload.php';
require __DIR__ . '/../../sql_config.php';
$pdo = new \PDO($dbDsn, $dbUser, $dbPass);
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$agenda = new \pvv\side\Agenda([
new \pvv\side\DBActivity($pdo),
]);
?><!DOCTYPE html>
<html lang="no">
<title>Kursverkstedet</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/nav.css">
<link rel="stylesheet" href="../css/events.css">
<header>Kurs&shy;verk&shy;stedet</header>
<main>
<?php $limit = 0; ?>
<?php foreach($agenda->getEventsBetween(new \DateTimeImmutable, (new \DateTimeImmutable)->add(new \DateInterval('P1M'))) as $event) { ?>
<article>
<h2>
<?php if ($event->getImageURL()) { ?>
<img src="<?= $event->getImageURL() ?>">
<?php } ?>
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
<em><?= $event->getRelativeDate() ?></em>
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
</h2>
<ul class="subtext">
<li>Tid: <strong><?= trim(strftime('%e. %b %H.%M', $event->getStart()->getTimeStamp())) ?></strong>
<li>Sted: <strong><?= $event->getLocation() ?></strong>
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong>
</ul>
<?php $description = $event->getDescription(); ?>
<?php if ($limit) array_splice($description, $limit); ?>
<?= implode($description, "<br>") ?>
</article>
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
<?php } ?>
</main>
<nav><ul>
<li><a href="../">hjem</a></li>
<li class="active"><a href="../kurs/">kurs</a></li>
<li><a href="../kalender/">kalender</a></li>
<li><a href="../aktiviteter/">aktiviteter</a></li>
<li><a href="../prosjekt/">prosjekter</a></li>
<li><a href="../sosiale/">sosiale</a></li>
<li><a href="../kontakt/">kontakt</a></li>
<li><a href="../pvv/">wiki</a></li>
</nav>

View File

@ -9,6 +9,7 @@ use \pvv\side\Agenda;
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <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/normalize.css">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/nav.css">
<link rel="stylesheet" href="../css/events.css"> <link rel="stylesheet" href="../css/events.css">
<header>Sosial&shy;verk&shy;stedet</header> <header>Sosial&shy;verk&shy;stedet</header>

67
www/om/index.html Normal file
View File

@ -0,0 +1,67 @@
<!DOCTYPE html>
<html lang=no>
<style>
p {hyphens: auto;}
</style>
<title>Programvareverkstedet</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/nav.css">
<link rel="stylesheet" href="../css/events.css">
<header>Programvareverkstedet</header>
<main>
<article>
<h2>Om Programvareverkstedet</h2>
<p>Beskrivelse av PVV her</p>
</article>
<article>
<h2>Hva betyr det å være et medlem av PVV?</h2>
<p>Alle medlemmer av PVV f&aring;r brukerkonto p&aring; PVV sine maskiner, epostadresse (<code lang="">brukernavn@pvv.ntnu.no</code> og <code lang="">brukernavn@pvv.org</code>) og 757 MB diskplass, som blant annet kan brukes til hjemmesider. Dersom du g&aring;r tom for diskplass er det mulig &aring; kj&oslash;pe utvidet diskkvote. For &aring; aktivere brukerkonto p&aring; PVV, m&aring; man m&oslash;te opp p&aring; lokalene slik at man f&aring;r satt passord.
<p>I tillegg f&aring;r man tilgang til PVVs to oppholdsrom, rom 226 og 229 i Sentralbygg 2 (se kart over andre etasje i SBII). P&aring; rom 229 er det seks arbeidsstasjoner som kj&oslash;rer Linux, macOS, FreeBSD, samt bordplass, nettverksuttak og egen Wifi AP for laptoper. P&aring; rom 226 er det sofakrok med TV og diverse spillkonsoller.
<p>Dersom du &oslash;nsker &aring; lære Unix er det god anledning til det p&aring; PVV. Vi har et sterkt faglig milj&oslash;, med mange svært kunnskapsrike personer, som stort sett ikke har noe imot &aring; hjelpe nybegynnere. Man kan f&aring; st&oslash;rre privilegier her enn p&aring; stud-maskinene, for eksempel gjennom &aring; bli med i PVV-drift.
<p>PVV har gratis kaffe for medlemmer. Vi organiserer kurs og andre arrangementer. De aller fleste arrangementene er gratis.
<p>PVV har ogs&aring; ei relativt innholdsrik boksamling til disposisjon for medlemmene, samt ei bokhylle full av blad og tegneserier. (For tiden abonnerer vi p&aring; Lunch tegneserie). Vi har i tillegg et romslig bokbudsjett, s&aring; dersom du har forslag til b&oslash;ker/blad vi burde kj&oslash;pe inn er det bare &aring; sende en mail til styret (<code lang="">pvv@pvv.ntnu.no</code>). Ta en titt p&aring; hva som st&aring;r i bokhyllen.
<p>PVV har ogs&aring; en del brettspill du kan pr&oslash;ve.
</article>
<article>
<h2>Hvordan bli medlem</h2>
<p>F&oslash;rste steg for &aring; bli medlem i PVV er &aring; betale medlemskontingent.
<p>Medlemskontingenten er kr 50,00 per &aring;r. Det er ogs&aring; mulig &aring; bli livstidsmedlem ved &aring; betale kr 1024,00 én gang. Kontingent betales til konto <code lang="">8601.11.16916</code>. Betalingen M&aring; merkes med NTNU brukernavn.
<p>Det er mulig &aring; betale for flere &aring;r samtidig ved &aring; betale et helt multiplum av kr 50.
<p>Kontingentinnbetalinger blir registrert i medlemsdatabasen, og det er lurt &aring; sjekke at betalingen din dukker opp her (merk at det kan ta litt tid fra du betaler til kasserer f&aring;r beskjed om det, og deretter litt tid f&oslash;r kasserer f&oslash;rer betalingen inn i regnskap og medlemsdatabase).
<p>
<a class="btn" href="../paamelding/">Registrer deg som bruker</a>
</p>
</article>
</main>
<nav><ul>
<li><a href="../">hjem</a></li>
<!--<li><a href="../prosjekt/">prosjekter</a></li>-->
<li><a href="../kalender/">kalender</a></li>
<li><a href="../aktiviteter/">aktiviteter</a></li>
<li><a href="../prosjekt/">prosjekter</a></li>
<li><a href="../kontakt/">kontakt</a></li>
<li><a href="../pvv/">wiki</a></li>
</nav>

View File

@ -45,29 +45,31 @@ if (isset($_SESSION['userdata'])) { // if logged in with feide
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<title>PVV registrering</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../css/normalize.css"> <title>PVV registrering</title>
<link rel="stylesheet" href="../css/style.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/nav.css">
</head>
<header>Registrerings&shy;verks&shy;stedet</header> <body>
<nav>
<?php echo navbar(1); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<article>
<h2>Registrer deg som bruker</h2> <h2>Registrer deg som bruker</h2>
<p> <p>
PVV har for øyeblikket et manuelt system for å legge til nye brukere. PVV har for øyeblikket et manuelt system for å legge til nye brukere.
Det koster 50kr året for medlemskap. For mer informasjon, les <a href="/pvv/Medlem"> her</a>.
</p>
<p>
Vi foretrekker at du kommer inn besøk <a href="https://use.mazemap.com/?v=1&left=10.4032&right=10.4044&top=63.4178&bottom=63.4172&campusid=1&zlevel=2&sharepoitype=point&sharepoi=10.40355%2C63.41755%2C2&utm_medium=longurl">våre lokaler stripa</a> Vi foretrekker at du kommer inn besøk <a href="https://use.mazemap.com/?v=1&left=10.4032&right=10.4044&top=63.4178&bottom=63.4172&campusid=1&zlevel=2&sharepoitype=point&sharepoi=10.40355%2C63.41755%2C2&utm_medium=longurl">våre lokaler stripa</a>
for å sette sette opp din PVV bruker. Hvis du vil, kan du også sende oss for å sette sette opp din PVV bruker. Hvis du vil, kan du også sende oss
en melding fra denne siden med ditt navn, epost og NTNU brukernavn. en melding fra denne siden med ditt navn, epost og NTNU brukernavn.
For å aktivere din brukerkonto PVV, du møte opp For å aktivere din brukerkonto PVV, du møte opp
lokalene våre slik at du kan satt ditt passord. lokalene våre slik at vi kan satt et passord.
</p> </p>
<?php if($attrs) { //logged in with pvv account?> <?php if($attrs) { //logged in with pvv account?>
@ -96,11 +98,25 @@ if (isset($_SESSION['userdata'])) { // if logged in with feide
<a class="btn" href=".?login">Hent navn og epost fra Feide</a> <a class="btn" href=".?login">Hent navn og epost fra Feide</a>
<?php }?> <?php }?>
</article> <h3>Meldingen du kan sende:</h3>
</main>
<nav> <?php if($attrs) { //logged in with pvv account?>
<?= navbar(1); ?> <p>
<?= loginbar(); ?> Du er logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>,
</nav> du trenger ikke sende melding om ny bruker fordi du helt klart har en.
</p>
<?php } elseif (isset($_SESSION['userdata'])) { //logged in with feide ?>
<code>
Til: drift@pvv.ntnu.no<br>
Fra: nettsiden<br>
<br/>
<?= nl2br($mailBody) ?>
</code><br>
<br>
Todo: Legg til en "send mail" knapp
<?php } else { // not logged in?>
<a class="btn" href=".?login">æ kanj itj lææv uten piær!</a>
<?php }?>
</main>
</body>

View File

@ -46,17 +46,21 @@ if($new == 0){
} }
?> ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <head>
<link rel="stylesheet" href="../../css/normalize.css"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../../css/style.css"> <link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../../css/events.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../../css/admin.css"> <link rel="stylesheet" href="../css/nav.css">
<link rel="stylesheet" href="../css/splash.css">
</head>
<header>Prosjekt&shy;verk&shy;stedet</header> <body>
<nav>
<?php echo navbar(1, 'prosjekt'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<article>
<h2>Nytt prosjekt</h2> <h2>Nytt prosjekt</h2>
<form action="update.php", method="post"> <form action="update.php", method="post">
@ -65,8 +69,9 @@ if($new == 0){
<input type="text" name="title" value="<?= $project->getName() ?>" class="boxinput" style="width:66%;"><br> <input type="text" name="title" value="<?= $project->getName() ?>" class="boxinput" style="width:66%;"><br>
<p class="subtitle no-chin">Beskrivelse</p> <p class="subtitle no-chin">Beskrivelse</p>
<p class="subnote">Hva går prosjektet ditt ut ?</p> <p class="subnote no-chin">Hva går prosjektet ditt ut ?</p>
<textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= $project->getDescription() ?></textarea> <p class="subnote">Den første linjen blir vist prosjektkortet, prøv å holde den kort!</p>
<textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?> <?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
@ -76,11 +81,5 @@ if($new == 0){
<?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?> <?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?>
</div> </div>
</form> </form>
</article> </main>
</body>
</main>
<nav>
<?= navbar(1, 'prosjekt'); ?>
<?= loginbar(); ?>
</nav>

View File

@ -5,38 +5,45 @@ $translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden',
$projectManager = new \pvv\side\ProjectManager($pdo); $projectManager = new \pvv\side\ProjectManager($pdo);
$projects = $projectManager->getAll(); $projects = $projectManager->getAll();
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="no"> <html lang="no">
<title>Prosjektverkstedet</title> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Prosjektverkstedet</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="../css/normalize.css"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" href="../css/style.css"> <link rel="stylesheet" href="../css/normalize.css">
<link rel="stylesheet" href="../css/splash.css"> <link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/nav.css">
<link rel="stylesheet" href="../css/splash.css">
<link rel="stylesheet" href="../css/projects.css">
</head>
<header>Prosjekt&shy;verk&shy;stedet</header> <body>
<nav>
<?php echo navbar(1, 'prosjekt'); ?>
<?php echo loginbar(null, $pdo); ?>
</nav>
<main> <main>
<h2>Prosjekter</h2>
<article class="threed"> <?php
<h2>Prosjekter</h2>
<?php
if(count($projects) == 0){ if(count($projects) == 0){
?> ?>
<p>PVV har for øyeblikket ingen aktive prosjekter. Tenker du at noe bør gjøres? Har du en kul ide for noe PVV kan samarbeide om? Sett opp et prosjekt!</p> <p>PVV har for øyeblikket ingen aktive prosjekter. Tenker du at noe bør gjøres? Har du en kul ide for noe PVV kan samarbeide om? Sett opp et prosjekt!</p>
<br> <br>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a> <a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a> <a class="btn" href="mine.php">Mine prosjekter</a>
<?php <?php
}else{ }else{
?> ?>
<p>Lyst til å gjøre noe kult? Her er et utvalg av de prosjektene som PVVere har laget. Mangler det noe, eller brenner du for noe annet? Sett opp et eget prosjekt!</p> <p>Lyst til å gjøre noe kult? Her er et utvalg av de prosjektene som PVVere har laget. Mangler det noe, eller brenner du for noe annet? Sett opp et eget prosjekt!</p>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a> <a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a> <a class="btn" href="mine.php">Mine prosjekter</a>
<hr class="projects-divider">
<ul class="calendar-events">
<?php <?php
$randProjects = array_rand($projects, min(3, count($projects))); $randProjects = array_rand($projects, min(6, count($projects)));
if (!is_array($randProjects)) { if (!is_array($randProjects)) {
$randProjects = [$randProjects]; $randProjects = [$randProjects];
}; };
@ -44,24 +51,16 @@ $projects = $projectManager->getAll();
$project = $projects[$i]; $project = $projects[$i];
?> ?>
<li> <div class="project-card">
<p class="noborder no-chin"><?= "<a href=\"project/?id=" . $project->getID() . "\">" . $project->getName() . "</a>"; ?></p> <div class="card-content">
<p class="subnote"><?= "Organisert av: " . $project->getOwner(); ?></p> <h4 class="project-title"><?= $project->getName(); ?></h4>
<span> <p><?= $project->getDescription()[0]; ?></p>
<p><?= $project->getDescription(); ?></p> </div>
</span> <p class="project-organizer">Organisert av<br><?= $project->getOwner(); ?></p>
</li> </div>
<?php } ?> <?php } ?>
</ul> <?php
<?php
} }
?> ?>
</article> </main>
</body>
</main>
<nav>
<?= navbar(1, 'prosjekt'); ?>
<?= loginbar($sp, $pdo); ?>
</nav>

View File

@ -71,7 +71,7 @@ $projects = array_values(array_filter(
<div class="event"> <div class="event">
<div class="event-info"> <div class="event-info">
<h3 class="no-chin"><?= '<a href="edit.php?id=' . $project->getID() . '">' . $project->getName() . '</a>'; ?></h3> <h3 class="no-chin"><?= '<a href="edit.php?id=' . $project->getID() . '">' . $project->getName() . '</a>'; ?></h3>
<p><?= $project->getDescription(); ?></p> <p><?= implode($project->getDescription()); ?></p>
</div> </div>
</div> </div>
</li> </li>