New design #2

Merged
halworsen merged 26 commits from redesign into master 2018-02-24 17:15:32 +01:00
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,59 +54,61 @@ 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">
<div class="gridl"> <div class="gridl">
<p class="subtitle">Tittel</p> <p class="subtitle">Tittel</p>
<?= '<input type="text" name="title" value="' . $event->getName(). '" class="boxinput">' ?><br> <?= '<input type="text" name="title" value="' . $event->getName(). '" class="boxinput">' ?><br>
<p class="subtitle">Beskrivelse</p> <p class="subtitle">Beskrivelse</p>
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($event->getDescription(), "\n"); ?></textarea> <textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($event->getDescription(), "\n"); ?></textarea>
</div> </div>
<div class="gridr noborder"> <div class="gridr noborder">
<p class="subtitle">Starttid (YYYY-MM-DD HH:MM:SS)</p> <p class="subtitle">Starttid (YYYY-MM-DD HH:MM:SS)</p>
<?= '<input name="start" type="text" class="boxinput" value="' . $event->getStart()->format('Y-m-d H:00:00') . '"><br>' ?> <?= '<input name="start" type="text" class="boxinput" value="' . $event->getStart()->format('Y-m-d H:00:00') . '"><br>' ?>
<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>
<?= '<input type="hidden" name="id" value="' . $event->getID() . '" />' ?> <?= '<input type="hidden" name="id" value="' . $event->getID() . '" />' ?>
<div class="allgrids" style="margin-top: 2em;"> <div class="allgrids" style="margin-top: 2em;">
<hr class="ruler"> <hr class="ruler">
<input type="submit" class="btn" value="Lagre"></a> <input type="submit" class="btn" value="Lagre"></a>
</div> </div>
</form> </form>
<p> <p>
</article> </main>
</body>
</main>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -47,90 +47,94 @@ $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>
<ul class="event-list"> <ul class="event-list">
<?php <?php
$counter = 0; $counter = 0;
$pageLimit = 4; $pageLimit = 4;
for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){ for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){
if($counter == $pageLimit){ if($counter == $pageLimit){
break; break;
}
$event = $events[$i];
$eventID = $event->getID();
?>
<li>
<div class="event admin">
<div class="event-info">
<h3 class="no-chin"><?= $event->getName() . " (ID: " . $eventID . ")"; ?></h3>
<p class="subnote">
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
</p>
<p><?= implode($event->getDescription(), "<br>"); ?></p>
</div>
<div class="event-actions">
<!-- emojis are for big boys -->
<?= '<a href="edit.php?id=' . $eventID . '">🖊</a>'; ?>
<?= '<a href="delete.php?id=' . $eventID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $eventID . ')\');">🗑</a>'; ?>
</div>
</div>
</li>
<?php
$counter++;
}
?>
</ul>
<?php
if($page != 1){
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
} }
$event = $events[$i]; if(($counter == $pageLimit) and (($pageLimit * $page) < count($events))){
$eventID = $event->getID(); echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
?> }
?>
<li>
<div class="event admin">
<div class="event-info">
<h3 class="no-chin"><?= $event->getName() . " (ID: " . $eventID . ")"; ?></h3>
<p class="subnote">
<?= $event->getStart()->format("(Y-m-d H:i:s)") . " - " . $event->getStop()->format("(Y-m-d H:i:s)"); ?>
</p>
<p><?= implode($event->getDescription(), "</p>\n<p>"); ?></p>
</div>
<div class="event-actions">
<!-- emojis are for big boys -->
<?= '<a href="edit.php?id=' . $eventID . '">🖊</a>'; ?>
<?= '<a href="delete.php?id=' . $eventID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $eventID . ')\');">🗑</a>'; ?>
</div>
</div>
</li>
<?php
$counter++;
}
?>
</ul>
<?php
if($page != 1){
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
}
if(($counter == $pageLimit) and (($pageLimit * $page) < count($events))){
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
}
?>
</div>
<div class="gridr">
<h2>Verktøy</h2>
<a class="btn adminbtn" href="edit.php?new=1">Legg inn ny aktivitet</a>
<h2>Filter</h2>
<form action="." method="post">
<p class="no-chin">Navn</p>
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
<p class="no-chin">Organisator</p>
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
<div style="margin-top: 2em;">
<input type="submit" class="btn" value="Filtrer"></input>
</div> </div>
</form>
</div>
</article>
</main> <div class="gridr">
<h2>Verktøy</h2>
<a class="btn adminbtn" href="edit.php?new=1">Legg inn ny aktivitet</a>
<h2>Filter</h2>
<form action="." method="post">
<p class="no-chin">Navn</p>
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
<p class="no-chin">Organisator</p>
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
<nav> <div style="margin-top: 2em;">
<?= navbar(2); ?> <input type="submit" class="btn" value="Filtrer"></input>
<?= loginbar(); ?> </div>
</nav> </form>
</div>
</div>
</main>
</body>

View File

@ -28,64 +28,65 @@ 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">
<tr><th>Brukernavn</th><th>Brukergrupper</th></tr>
<form action="./update.php" method="post">
<table class="userlist">
<tr><th>Brukernavn</th><th>Brukergrupper</th></tr>
<?php
$users_value = '';
foreach($users as $i => $data){
$uname = $data['name'];
$groupFlag = $userManager->getUsergroups($uname);
if(!$users_value){
$users_value = $uname;
}else{
$users_value = $users_value . '_' . $uname;
}
?>
<tr>
<td><?= $uname ?></td>
<?php <?php
foreach($userManager->usergroups as $name => $group){ $users_value = '';
echo '<td><input type="checkbox" ' . (($groupFlag & $group) ? 'checked' : '') . ' name="' . $uname . '_' . $name . '" class="usergroupcheckbox">' . $name . '</td>'; foreach($users as $i => $data){
} $uname = $data['name'];
$groupFlag = $userManager->getUsergroups($uname);
if(!$users_value){
$users_value = $uname;
}else{
$users_value = $users_value . '_' . $uname;
}
?> ?>
</tr>
<?php <tr>
} <td><?= $uname ?></td>
echo '<input type="hidden" name="users" value="' . $users_value . '" />'; <?php
?> foreach($userManager->usergroups as $name => $group){
echo '<td><input type="checkbox" ' . (($groupFlag & $group) ? 'checked' : '') . ' name="' . $uname . '_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
}
?>
</tr>
<tr class="newuserrow"> <?php
<td class="newuserelement"><input type="text" name="newuser" class="newuserinput"></td>
<?php
foreach($userManager->usergroups as $name => $group){
echo '<td><input type="checkbox" name="newuser_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
} }
?> echo '<input type="hidden" name="users" value="' . $users_value . '" />';
</tr> ?>
</table>
<input type="submit" class="btn" value="Lagre">
</form>
</article> <tr class="newuserrow">
</main> <td class="newuserelement"><input type="text" name="newuser" class="newuserinput"></td>
<?php
foreach($userManager->usergroups as $name => $group){
echo '<td><input type="checkbox" name="newuser_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
}
?>
</tr>
</table>
<input type="submit" class="btn" value="Lagre">
</form>
</main>
</body>

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>
<ul class="tools">
<?php
if($isAdmin | $activityGroup){
echo '<li><a class="btn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a></li>';
}
<article> if($isAdmin | $projectGroup){
<h2>Verktøy</h2> echo '<li><a class="btn" href="prosjekter/">Prosjekter</a></li>';
<?php }
if($isAdmin | $activityGroup){
echo '<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>';
}
if($isAdmin | $projectGroup){ if($isAdmin) {
echo '<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>'; 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,53 +49,55 @@ 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">
<div class="gridl"> <div class="gridl">
<p class="subtitle">Tittel</p> <p class="subtitle">Tittel</p>
<?= '<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>
<?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?> <?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?>
</div> </div>
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?> <?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
<div class="allgrids" style="margin-top: 2em;"> <div class="allgrids" style="margin-top: 2em;">
<hr class="ruler"> <hr class="ruler">
<input type="submit" class="btn" value="Lagre"> <input type="submit" class="btn" value="Lagre">
</div> </div>
</form> </form>
<p> <p>
</article> </main>
</body>
</main>
<nav>
<?= navbar(2); ?>
<?= loginbar(); ?>
</nav>

View File

@ -47,86 +47,91 @@ $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>
<ul class="event-list"> <ul class="event-list">
<?php <?php
$counter = 0; $counter = 0;
$pageLimit = 4; $pageLimit = 4;
for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){ for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){
if($counter == $pageLimit){ if($counter == $pageLimit){
break; break;
}
$project = $projects[$i];
$projectID = $project->getID();
?>
<li>
<div class="event admin">
<div class="event-info">
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
<p class="subnote"><?= 'Organisert av: ' . $project->getOwner(); ?></p>
<p><?= implode($project->getDescription(), "<br>"); ?></p>
</div>
<div class="event-actions">
<?= '<a href="edit.php?id=' . $projectID . '">🖊</a>'; ?>
<?= '<a href="delete.php?id=' . $projectID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $projectID . ')\');">🗑</a>'; ?>
</div>
</div>
</li>
<?php
$counter++;
}
?>
</ul>
<?php
if($page != 1){
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
} }
$project = $projects[$i]; if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
$projectID = $project->getID(); echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
?> }
?>
<li>
<div class="event admin">
<div class="event-info">
<h3 class="no-chin"><?= $project->getName() . " (ID: " . $projectID . ")"; ?></h3>
<p class="subnote"><?= 'Organisert av: ' . $project->getOwner(); ?></p>
<p><?= $project->getDescription(); ?></p>
</div>
<div class="event-actions">
<?= '<a href="edit.php?id=' . $projectID . '">🖊</a>'; ?>
<?= '<a href="delete.php?id=' . $projectID . '" onclick="return confirm(\'Knallsikker? (ID: ' . $projectID . ')\');">🗑</a>'; ?>
</div>
</div>
</li>
<?php
$counter++;
}
?>
</ul>
<?php
if($page != 1){
echo '<a class="btn float-left" href="?page=' . ($page - 1) . '">Forrige side</a>';
}
if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
}
?>
</div>
<div class="gridr">
<h2>Verktøy</h2>
<a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a>
<h2>Filter</h2>
<form action="." method="post">
<p class="no-chin">Navn</p>
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
<p class="no-chin">Organisator</p>
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
<div style="margin-top: 2em;">
<input type="submit" class="btn" value="Filtrer"></input>
</div> </div>
</form>
</div>
</article>
</main> <div class="gridr">
<h2>Verktøy</h2>
<a class="btn adminbtn" href="edit.php?new=1">Legg inn nytt prosjekt</a>
<h2>Filter</h2>
<form action="." method="post">
<p class="no-chin">Prosjektnavn</p>
<?= '<input type="text" name="title" class="boxinput" value="' . $filterTitle . '">' ?><br>
<p class="no-chin">Leders brukernavn</p>
<?= '<input type="text" name="organiser" class="boxinput" value="' . $filterOrganiser . '">' ?><br>
<nav> <div style="margin-top: 2em;">
<?= navbar(2); ?> <input type="submit" class="btn" value="Filtrer"></input>
<?= loginbar(); ?> </div>
</nav> </form>
</div>
</div>
</main>
</body>

View File

@ -14,59 +14,61 @@ $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;
? $agenda->getNextOfEach(new \DateTimeImmutable) $events = ($day==-1)
: $agenda->getEventsBetween( ? $agenda->getNextOfEach(new \DateTimeImmutable)
new DateTimeImmutable("$year-$month-$day 00:00:00"), : $agenda->getEventsBetween(
new DateTimeImmutable("$year-$month-$day 23:59:59")); new DateTimeImmutable("$year-$month-$day 00:00:00"),
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 if (\pvv\side\Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
<em><?= $event->getRelativeDate() ?></em>
<?php if (\pvv\side\Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
<?php if ($event->getURL()) { ?>
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
<?php } else { ?>
<?= $event->getName() ?>
<?php } ?>
</h2>
<ul class="subtext">
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong></li>
<li>Sted: <strong><?= $event->getLocation() ?></strong></li>
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong></li>
</ul>
<?php $description = $event->getDescription(); ?>
<?php if ($limit) array_splice($description, $limit); ?>
<?= implode($description, "<br>") ?>
</div>
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
<?php } ?> <?php } ?>
<?php if (Agenda::isToday($event->getStart())) { ?><strong><?php } ?> </main>
<em><?= $event->getRelativeDate() ?></em>
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
<?php if ($event->getURL()) { ?>
<a href="<?= $event->getURL() ?>"><?= $event->getName() ?></a>
<?php } else { ?>
<?= $event->getName() ?>
<?php } ?>
</h2>
<ul class="subtext">
<li>Tid: <strong><?= Agenda::getFormattedDate($event->getStart()) ?></strong>
<li>Sted: <strong><?= $event->getLocation() ?></strong>
<li>Arrangør: <strong><?= $event->getOrganiser() ?></strong>
</ul>
<?php $description = $event->getDescription(); ?> </body>
<?php if ($limit) array_splice($description, $limit); ?>
<?= implode($description, "</p>\n<p>") ?>
</article>
<?php if (!$limit || $limit > 4) {$limit = 4;} else $limit = 2; ?>
<?php } ?>
</main>
<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++ ?>
<li>
<?php if ($event->getURL()) { ?>
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a>
<?php } else { ?>
<strong><?= $event->getName(); ?></strong>
<?php } ?>
<?php /* <a class="icon subscribe">+</a> */ ?>
<?php if ($period !== \pvv\side\Agenda::TODAY) {
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()) {
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} else {
echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
}
} else {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
}
?>
</li>
<?php } ?>
</ul>
<?php } ?>
</div>
<p><a class="btn" href="kalender/">Flere aktiviteter</a></p>
</div>
<div class="split"> <div class="gridl">
<article> <?php
<h2>Kommende arrangement</h2> $title = $motd["title"];
<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()) { ?> echo "<h2>";
<a href="<?= htmlspecialchars($event->getURL()) ?>"><?= $event->getName(); ?></a> if($title == ""){
<?php } else { ?> echo "Dagens melding";
<strong><?= $event->getName(); ?></strong> }else{
<?php } ?> echo $title;
<?php /* <a class="icon subscribe">+</a> */ ?> }
<?php if ($period !== \pvv\side\Agenda::TODAY) { echo "</h2>";
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()) {
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
} else {
echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
}
} else {
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
}
?>
</li>
<?php } ?>
</ul>
<?php } ?>
</ul>
<p><a class="btn" href="kalender/">Flere aktiviteter</a></p>
</article>
<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> echo "<p>" . implode($motd["content"], "<br>") . "</p>";
?>
<nav> </div>
<?php echo navbar(0, ''); ?> </main>
<?php echo loginbar($sp, $pdo); ?> </body>
</nav> </html>

View File

@ -16,77 +16,75 @@ $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
$pmonth = $month-1; $pmonth = $month-1;
$nmonth = $month+1; $nmonth = $month+1;
$pyear=$year; $pyear=$year;
$nyear=$year; $nyear=$year;
if ($pmonth==0) {$pmonth=12; $pyear--;} if ($pmonth==0) {$pmonth=12; $pyear--;}
if ($nmonth==13) {$nmonth=1; $nyear++;} if ($nmonth==13) {$nmonth=1; $nyear++;}
?> ?>
<a class="btn noselect" href="../kalender?year=<?=$pyear?>&amp;month=<?=$pmonth?>">Forrige måned</a> <a class="btn noselect" href="../kalender?year=<?=$pyear?>&amp;month=<?=$pmonth?>">Forrige måned</a>
<a class="btn noselect" style="float:right;" href="../kalender?year=<?=$nyear?>&amp;month=<?=$nmonth?>">Neste måned</a> <a class="btn noselect" style="float:right;" href="../kalender?year=<?=$nyear?>&amp;month=<?=$nmonth?>">Neste måned</a>
</p> </p>
<figure class="calendar"> <figure class="calendar">
<ul> <ul>
<li class="header noselect">mandag <li class="header noselect">mandag
<li class="header noselect">tirsdag <li class="header noselect">tirsdag
<li class="header noselect">onsdag <li class="header noselect">onsdag
<li class="header noselect">torsdag <li class="header noselect">torsdag
<li class="header noselect">fredag <li class="header noselect">fredag
<li class="header noselect">lørdag <li class="header noselect">lørdag
<li class="header noselect">søndag <li class="header noselect">søndag
<?php if ($days_before_the_first != 0) { ?> <?php if ($days_before_the_first != 0) { ?>
<li class="outOfMonth" style="grid-column: 1/<?=$days_before_the_first+1?>;"> <li class="outOfMonth" style="grid-column: 1/<?=$days_before_the_first+1?>;">
<?php } ?>
<?php for ($day=1; $day <= $days_in_month; $day++) { ?>
<?php $events = $agenda->getEventsBetween(
new DateTimeImmutable("$year-$month-$day 00:00:00"),
new DateTimeImmutable("$year-$month-$day 23:59:59")); ?>
<?php if ($day==$day_of_month) { ?>
<li class="active">
<?php } else { ?>
<li>
<?php } ?>
<?php if (sizeof($events)!=0) { ?>
<a href="../aktiviteter/?<?="year=$year&amp;month=$month&amp;day=$day"?>"><div>
<span class="noselect day"><?= $day ?>.</span>
<?php foreach($events as $event) { ?>
<section style="background: <?=$event->getColor()?>"><?=$event->getName()?></section>
<?php } ?> <?php } ?>
</div></a>
<?php } else { ?>
<span class="noselect day"><?= $day ?>.</span>
<?php } ?>
<?php } ?>
</ul> <?php for ($day=1; $day <= $days_in_month; $day++) { ?>
</figure> <?php $events = $agenda->getEventsBetween(
new DateTimeImmutable("$year-$month-$day 00:00:00"),
new DateTimeImmutable("$year-$month-$day 23:59:59")); ?>
<?php if ($day==$day_of_month) { ?>
<li class="active">
<?php } else { ?>
<li>
<?php } ?>
<?php if (sizeof($events)!=0) { ?>
<a href="../aktiviteter/?<?="year=$year&amp;month=$month&amp;day=$day"?>"><div>
<span class="noselect day"><?= $day ?>.</span>
<?php foreach($events as $event) { ?>
<section style="background: <?=$event->getColor()?>"><?=$event->getName()?></section>
<?php } ?>
</div></a>
<?php } else { ?>
<span class="noselect day"><?= $day ?>.</span>
<?php } ?>
<?php } ?>
</article> </ul>
</figure>
</main> </main>
<body>
<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,62 +45,78 @@ 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>
<h2>Registrer deg som bruker</h2>
<article>
<h2>Registrer deg som bruker</h2>
<p>
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>
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.
For å aktivere din brukerkonto PVV, du møte opp
lokalene våre slik at du kan satt ditt passord.
</p>
<?php if($attrs) { //logged in with pvv account?>
<p> <p>
Du er logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>, PVV har for øyeblikket et manuelt system for å legge til nye brukere.
og trenger klart ikke sende melding om å ny PVV bruker. 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
en melding fra denne siden med ditt navn, epost og NTNU brukernavn.
For å aktivere din brukerkonto PVV, du møte opp
lokalene våre slik at vi kan satt et passord.
</p> </p>
<?php } elseif (isset($_SESSION['userdata'])) { //logged in with feide ?>
<?php if (! isset($_GET['send_mail'])) { ?> <?php if($attrs) { //logged in with pvv account?>
<h3>Meldingen som du sender:</h3> <p>
Du er logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>,
og trenger klart ikke sende melding om å ny PVV bruker.
</p>
<?php } elseif (isset($_SESSION['userdata'])) { //logged in with feide ?>
<?php if (! isset($_GET['send_mail'])) { ?>
<h3>Meldingen som du sender:</h3>
<code>
Til: <?=$mailTo?><br>
Fra: nettsiden<br>
Tittel: <?=$mailSubject?><br>
<br/>
<?= nl2br($mailBody) ?>
</code><br>
<br>
<a class="btn" href=".?send_mail#sent">Send!</a>
<?php } else { // not logged in?>
<p id="sent">
Meldingen har blitt sendt!
</p>
<?php }?>
<?php } else { // not logged in?>
<a class="btn" href=".?login">Hent navn og epost fra Feide</a>
<?php }?>
<h3>Meldingen du kan sende:</h3>
<?php if($attrs) { //logged in with pvv account?>
<p>
Du er logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>,
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> <code>
Til: <?=$mailTo?><br> Til: drift@pvv.ntnu.no<br>
Fra: nettsiden<br> Fra: nettsiden<br>
Tittel: <?=$mailSubject?><br>
<br/> <br/>
<?= nl2br($mailBody) ?> <?= nl2br($mailBody) ?>
</code><br> </code><br>
<br> <br>
<a class="btn" href=".?send_mail#sent">Send!</a> Todo: Legg til en "send mail" knapp
<?php } else { // not logged in?> <?php } else { // not logged in?>
<p id="sent"> <a class="btn" href=".?login">æ kanj itj lææv uten piær!</a>
Meldingen har blitt sendt!
</p>
<?php }?> <?php }?>
<?php } else { // not logged in?> </main>
<a class="btn" href=".?login">Hent navn og epost fra Feide</a> </body>
<?php }?>
</article>
</main>
<nav>
<?= navbar(1); ?>
<?= loginbar(); ?>
</nav>

View File

@ -46,41 +46,40 @@ 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>
<h2>Nytt prosjekt</h2>
<article> <form action="update.php", method="post">
<h2>Nytt prosjekt</h2> <p class="subtitle no-chin">Prosjektnavn</p>
<p class="subnote">Gi prosjektet ditt et passende navn</p>
<input type="text" name="title" value="<?= $project->getName() ?>" class="boxinput" style="width:66%;"><br>
<form action="update.php", method="post"> <p class="subtitle no-chin">Beskrivelse</p>
<p class="subtitle no-chin">Prosjektnavn</p> <p class="subnote no-chin">Hva går prosjektet ditt ut ?</p>
<p class="subnote">Gi prosjektet ditt et passende navn</p> <p class="subnote">Den første linjen blir vist prosjektkortet, prøv å holde den kort!</p>
<input type="text" name="title" value="<?= $project->getName() ?>" class="boxinput" style="width:66%;"><br> <textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
<p class="subtitle no-chin">Beskrivelse</p> <?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
<p class="subnote">Hva går prosjektet ditt ut ?</p>
<textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= $project->getDescription() ?></textarea>
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?> <div style="margin-top: 2em;">
<hr class="ruler">
<div style="margin-top: 2em;"> <?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?>
<hr class="ruler"> </div>
</form>
<?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?> </main>
</div> </body>
</form>
</article>
</main>
<nav>
<?= navbar(1, 'prosjekt'); ?>
<?= loginbar(); ?>
</nav>

View File

@ -5,63 +5,62 @@ $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">
<h2>Prosjekter</h2>
<?php
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>
<br>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
<?php
}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>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
<ul class="calendar-events">
<?php <?php
$randProjects = array_rand($projects, min(3, count($projects))); if(count($projects) == 0){
if (!is_array($randProjects)) {
$randProjects = [$randProjects];
};
foreach($randProjects as $i) {
$project = $projects[$i];
?> ?>
<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>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
<?php
}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>
<a class="btn" href="edit.php?new=1">Lag prosjekt</a>
<a class="btn" href="mine.php">Mine prosjekter</a>
<hr class="projects-divider">
<li> <?php
<p class="noborder no-chin"><?= "<a href=\"project/?id=" . $project->getID() . "\">" . $project->getName() . "</a>"; ?></p> $randProjects = array_rand($projects, min(6, count($projects)));
<p class="subnote"><?= "Organisert av: " . $project->getOwner(); ?></p> if (!is_array($randProjects)) {
<span> $randProjects = [$randProjects];
<p><?= $project->getDescription(); ?></p> };
</span> foreach($randProjects as $i) {
</li> $project = $projects[$i];
?>
<?php } ?> <div class="project-card">
</ul> <div class="card-content">
<?php <h4 class="project-title"><?= $project->getName(); ?></h4>
} <p><?= $project->getDescription()[0]; ?></p>
?> </div>
</article> <p class="project-organizer">Organisert av<br><?= $project->getOwner(); ?></p>
</div>
</main> <?php } ?>
<?php
<nav> }
<?= navbar(1, 'prosjekt'); ?> ?>
<?= loginbar($sp, $pdo); ?> </main>
</nav> </body>

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>