New design #2
|
@ -40,11 +40,10 @@ function loginBar($sp = null, $pdo = null) {
|
|||
$attr = $as->getAttributes();
|
||||
if($attr) {
|
||||
$uname = $attr['uid'][0];
|
||||
$isAdmin = false;
|
||||
if (isset($pdo)) {
|
||||
$userManager = new \pvv\admin\UserManager($pdo);
|
||||
$isAdmin = $userManager->isAdmin($uname);
|
||||
} else {
|
||||
$isAdmin = false;
|
||||
}
|
||||
$result .= "\n\t<ul id=\"usermenu\">\n";
|
||||
$result .= "\n\t\t<li><a id=\"login\" href=\"#\">${svg}" . htmlspecialchars($uname) . "</a></li>\n";
|
||||
|
|
|
@ -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
|
||||
);
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -7,7 +7,7 @@ class Project{
|
|||
public function __construct($id, $name, $descr, $owner, $owneruname, $active){
|
||||
$this->id = $id;
|
||||
$this->name = $name;
|
||||
$this->descr = $descr;
|
||||
$this->descr = explode("\n", $descr);
|
||||
$this->owner = $owner;
|
||||
$this->owneruname = $owneruname;
|
||||
$this->active = $active;
|
||||
|
|
|
@ -54,59 +54,61 @@ if($new == 0){
|
|||
}
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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>
|
||||
|
||||
<header class="admin">Aktivitets­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">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $event->getName(). '" class="boxinput">' ?><br>
|
||||
<form action="update.php", method="post" class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $event->getName(). '" class="boxinput">' ?><br>
|
||||
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($event->getDescription(), "\n"); ?></textarea>
|
||||
</div>
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($event->getDescription(), "\n"); ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="gridr noborder">
|
||||
<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>' ?>
|
||||
<div class="gridr noborder">
|
||||
<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>' ?>
|
||||
|
||||
<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>' ?>
|
||||
<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>' ?>
|
||||
|
||||
<p class="subtitle">Organisert av</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $event->getOrganiser(). '" class="boxinput">' ?><br>
|
||||
<p class="subtitle">Arrangør</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $event->getOrganiser(). '" class="boxinput">' ?><br>
|
||||
|
||||
<p class="subtitle">Hvor?</p>
|
||||
<?= '<input type="text" name="location" value="' . $event->getLocation(). '" class="boxinput">' ?><br>
|
||||
</div>
|
||||
<p class="subtitle">Sted</p>
|
||||
<?= '<input type="text" name="location" value="' . $event->getLocation(). '" class="boxinput">' ?><br>
|
||||
</div>
|
||||
|
||||
<?= '<input type="hidden" name="id" value="' . $event->getID() . '" />' ?>
|
||||
<?= '<input type="hidden" name="id" value="' . $event->getID() . '" />' ?>
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<input type="submit" class="btn" value="Lagre"></a>
|
||||
</div>
|
||||
</form>
|
||||
<input type="submit" class="btn" value="Lagre"></a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<p>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<p>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -47,90 +47,94 @@ $events = array_values(array_filter(
|
|||
));
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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>
|
||||
|
||||
<header class="admin">Aktivitets­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="gridl">
|
||||
<h2 class="no-chin">Aktive aktiviteter</h2>
|
||||
<p class="subnote">Gjentagende aktiviteter vises ikke</p>
|
||||
<div class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Aktive aktiviteter</h2>
|
||||
<p class="subnote">Gjentagende aktiviteter vises ikke</p>
|
||||
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($events) ;$i++){
|
||||
if($counter == $pageLimit){
|
||||
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];
|
||||
$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(), "</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>
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($events))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
|
@ -28,64 +28,65 @@ if(!$userManager->isAdmin($uname)){
|
|||
$users = $userManager->getAllUserData();
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
</head>
|
||||
|
||||
<nav>
|
||||
<?php echo navbar(2, ''); ?>
|
||||
<?php echo loginbar(); ?>
|
||||
</nav>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(2, 'admin'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<header class="admin">Bruker­administrasjon</header>
|
||||
<main>
|
||||
<h2>Brukeradministrasjon</h2>
|
||||
<hr class="ruler">
|
||||
|
||||
<main>
|
||||
<article>
|
||||
<form action="./update.php" method="post">
|
||||
<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
|
||||
foreach($userManager->usergroups as $name => $group){
|
||||
echo '<td><input type="checkbox" ' . (($groupFlag & $group) ? 'checked' : '') . ' name="' . $uname . '_' . $name . '" class="usergroupcheckbox">' . $name . '</td>';
|
||||
}
|
||||
$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>
|
||||
|
||||
<?php
|
||||
}
|
||||
echo '<input type="hidden" name="users" value="' . $users_value . '" />';
|
||||
?>
|
||||
<tr>
|
||||
<td><?= $uname ?></td>
|
||||
<?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">
|
||||
<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>';
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</form>
|
||||
echo '<input type="hidden" name="users" value="' . $users_value . '" />';
|
||||
?>
|
||||
|
||||
</article>
|
||||
</main>
|
||||
<tr class="newuserrow">
|
||||
<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>
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<?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();
|
||||
$attrs = $as->getAttributes();
|
||||
$uname = $attrs['uid'][0];
|
||||
|
@ -16,36 +21,40 @@ if(!($isAdmin | $projectGroup | $activityGroup)){
|
|||
}
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../css/admin.css">
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../css/admin.css">
|
||||
</head>
|
||||
|
||||
<header class="admin">Stor-­gutt-­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>
|
||||
<h2>Verktøy</h2>
|
||||
<?php
|
||||
if($isAdmin | $activityGroup){
|
||||
echo '<a class="btn adminbtn" href="aktiviteter/?page=1">Aktiviteter/Hendelser</a>';
|
||||
}
|
||||
if($isAdmin | $projectGroup){
|
||||
echo '<li><a class="btn" href="prosjekter/">Prosjekter</a></li>';
|
||||
}
|
||||
|
||||
if($isAdmin | $projectGroup){
|
||||
echo '<a class="btn adminbtn" href="prosjekter/">Prosjekter</a>';
|
||||
}
|
||||
if($isAdmin) {
|
||||
echo '<li><a class="btn" href="motd/">Dagens melding</a></li>';
|
||||
}
|
||||
|
||||
if($isAdmin){
|
||||
echo '<a class="btn adminbtn" href="brukere/">Brukere</a>';
|
||||
}
|
||||
?>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1); ?>
|
||||
<?= loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
if($isAdmin){
|
||||
echo '<li><a class="btn" href="brukere/">Brukere</a></li>';
|
||||
}
|
||||
?>
|
||||
<ul>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -49,53 +49,55 @@ if($new == 0){
|
|||
}
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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>
|
||||
|
||||
<header class="admin">Prosjekt­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">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
|
||||
<form action="update.php", method="post" class="gridsplit5050">
|
||||
<div class="gridl">
|
||||
<p class="subtitle">Tittel</p>
|
||||
<?= '<input type="text" name="title" value="' . $project->getName() . '" class="boxinput">' ?><br>
|
||||
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= $project->getDescription(); ?></textarea>
|
||||
</div>
|
||||
<p class="subtitle">Beskrivelse</p>
|
||||
<textarea name="desc" cols="40" rows="5" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
|
||||
</div>
|
||||
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Prosjekteier (Brukernavn)</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $project->getOwnerUName(). '" class="boxinput">' ?><br>
|
||||
<div class="gridr noborder">
|
||||
<p class="subtitle">Prosjektleder (Brukernavn)</p>
|
||||
<?= '<input type="text" name="organiser" value="' . $project->getOwnerUName(). '" class="boxinput">' ?><br>
|
||||
|
||||
<p class="subtitle">Prosjekteier (Navn)</p>
|
||||
<?= '<input type="text" name="organisername" value="' . $project->getOwner(). '" class="boxinput">' ?>
|
||||
<p class="subtitle">Prosjektleder (Navn)</p>
|
||||
<?= '<input type="text" name="organisername" value="' . $project->getOwner(). '" class="boxinput">' ?>
|
||||
|
||||
<p class="subtitle">Aktiv</p>
|
||||
<?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?>
|
||||
</div>
|
||||
<p class="subtitle">Aktiv</p>
|
||||
<?= '<input type="checkbox" '. ($project->getActive() ? 'checked' : '') . ' name="active"/>' ?>
|
||||
</div>
|
||||
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
<div class="allgrids" style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</div>
|
||||
</form>
|
||||
<p>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<input type="submit" class="btn" value="Lagre">
|
||||
</div>
|
||||
</form>
|
||||
<p>
|
||||
</main>
|
||||
</body>
|
|
@ -47,86 +47,91 @@ $projects = array_values(array_filter(
|
|||
));
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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>
|
||||
|
||||
<header class="admin">Prosjekt­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="gridl">
|
||||
<h2 class="no-chin">Prosjekter</h2>
|
||||
<div class="gridsplit">
|
||||
<div class="gridl">
|
||||
<h2 class="no-chin">Prosjekter</h2>
|
||||
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
<ul class="event-list">
|
||||
<?php
|
||||
$counter = 0;
|
||||
$pageLimit = 4;
|
||||
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){
|
||||
if($counter == $pageLimit){
|
||||
break;
|
||||
for($i = ($pageLimit * ($page - 1)); $i < count($projects); $i++){
|
||||
if($counter == $pageLimit){
|
||||
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];
|
||||
$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><?= $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>
|
||||
if(($counter == $pageLimit) and (($pageLimit * $page) < count($projects))){
|
||||
echo '<a class="btn float-right" href="?page=' . ($page + 1) . '">Neste side</a>';
|
||||
}
|
||||
?>
|
||||
</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>
|
||||
<?= navbar(2); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<div style="margin-top: 2em;">
|
||||
<input type="submit" class="btn" value="Filtrer"></input>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
|
@ -14,59 +14,61 @@ $day = (isset($_GET['day']))
|
|||
?>
|
||||
<!DOCTYPE html>
|
||||
<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­verk­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
|
||||
use \DateTimeImmutable;
|
||||
$events = ($day==-1)
|
||||
? $agenda->getNextOfEach(new \DateTimeImmutable)
|
||||
: $agenda->getEventsBetween(
|
||||
new DateTimeImmutable("$year-$month-$day 00:00:00"),
|
||||
new DateTimeImmutable("$year-$month-$day 23:59:59"));
|
||||
<main>
|
||||
<?php
|
||||
use \DateTimeImmutable;
|
||||
$events = ($day==-1)
|
||||
? $agenda->getNextOfEach(new \DateTimeImmutable)
|
||||
: $agenda->getEventsBetween(
|
||||
new DateTimeImmutable("$year-$month-$day 00:00:00"),
|
||||
new DateTimeImmutable("$year-$month-$day 23:59:59"));
|
||||
|
||||
$limit = 0;
|
||||
foreach($events as $event) {
|
||||
?>
|
||||
<article>
|
||||
<h2>
|
||||
<?php if ($event->getImageURL()) { ?>
|
||||
<img src="<?= $event->getImageURL() ?>">
|
||||
$limit = 0;
|
||||
foreach($events as $event) {
|
||||
?>
|
||||
<div>
|
||||
<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 } ?>
|
||||
<?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 if (Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
||||
<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>
|
||||
</main>
|
||||
|
||||
<?php $description = $event->getDescription(); ?>
|
||||
<?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>
|
||||
</body>
|
||||
|
|
|
@ -9,6 +9,7 @@ use \pvv\side\Agenda;
|
|||
<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>Sosial­verk­stedet</header>
|
||||
|
|
|
@ -12,6 +12,7 @@ use \pvv\side\Agenda;
|
|||
<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>Sosial­verk­stedet</header>
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
header.admin {
|
||||
margin-top: 3rem;
|
||||
height: 16rem;
|
||||
overflow: hidden;
|
||||
text-align: right;
|
||||
color: #fff;
|
||||
font-family: monospace;
|
||||
padding: 1rem;
|
||||
font-size: 4em;
|
||||
background: url('ja.png') no-repeat 1% 50% #024;
|
||||
background-size: contain;
|
||||
.tools {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
.tools li {
|
||||
margin: 1.5em 0;
|
||||
}
|
||||
|
||||
.event-list {
|
||||
|
@ -56,39 +54,6 @@ header.admin {
|
|||
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 {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
@ -101,27 +66,6 @@ header.admin {
|
|||
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 {
|
||||
table-layout: fixed;
|
||||
width: 100%;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
Binary file not shown.
After Width: | Height: | Size: 52 KiB |
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
||||
}
|
|
@ -190,107 +190,90 @@ nav #usermenu li:first-child:hover {
|
|||
top: 0;
|
||||
}
|
||||
}
|
||||
header {
|
||||
margin-top: 3rem;
|
||||
height: 16rem;
|
||||
overflow: 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;
|
||||
|
||||
body {
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
* {
|
||||
font-style: -apple-system, 'avenir next', avenir, roboto, noto, ubuntu, 'helvetica neue', helvetica, arial, sans-serif;
|
||||
}
|
||||
|
||||
main {
|
||||
max-width: 60rem;
|
||||
margin: -7rem auto 0 auto;
|
||||
padding: 0;
|
||||
padding: 1em 15vw;
|
||||
height: 100vh;
|
||||
margin-top: 7vh;
|
||||
|
||||
background-color: #fff;
|
||||
}
|
||||
article {
|
||||
padding: .1rem 1rem 1rem 1rem;
|
||||
margin: 0 1rem 0 1rem;
|
||||
background: white;
|
||||
|
||||
main h2 {
|
||||
color: #002244;
|
||||
|
||||
z-index: 2; /* Make appear under #menu */
|
||||
position: relative;
|
||||
}
|
||||
article p {
|
||||
text-align: justify;
|
||||
hyphens: auto;
|
||||
}
|
||||
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;
|
||||
|
||||
article {
|
||||
margin-bottom: 7vh;
|
||||
}
|
||||
|
||||
.split {
|
||||
display: table;
|
||||
width: 100%;
|
||||
table-layout: fixed;
|
||||
border-spacing: 1em;
|
||||
}
|
||||
.split > * {
|
||||
display: table-cell;
|
||||
.gridsplit {
|
||||
padding-top: 1.3em;
|
||||
display: grid;
|
||||
grid-template-columns: 3fr 1fr;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-weight: bold;
|
||||
.gridsplit5050 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
|
||||
.ruler {
|
||||
border: none;
|
||||
border-bottom: 1px dotted rgba(0,0,0,.5);
|
||||
.gridsplitthirds {
|
||||
display: grid;
|
||||
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;
|
||||
border: 1px solid #048;
|
||||
color: #048;
|
||||
padding: .2em 1em;
|
||||
border-radius: .2em;
|
||||
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;
|
||||
color: #fff;
|
||||
background-color: #002244;
|
||||
|
||||
transition: background-color .2s ease;
|
||||
}
|
||||
|
||||
.boxinput {
|
||||
text-decoration: none;
|
||||
border: 1px solid #048;
|
||||
color: #048;
|
||||
padding: .2em .4em;
|
||||
border-radius: .2em;
|
||||
display: inline-block;
|
||||
margin-bottom: .25em;
|
||||
resize: none;
|
||||
}
|
||||
.btn:hover {
|
||||
background-color: #00407F;
|
||||
|
||||
.noborder {
|
||||
border: none !important;
|
||||
transition: background-color .2s ease;
|
||||
}
|
||||
|
||||
.subnote {
|
||||
|
@ -304,72 +287,7 @@ a.btn:active {
|
|||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.icon.subscribe {
|
||||
color: white;
|
||||
background: #082;
|
||||
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;
|
||||
.ruler {
|
||||
border: none;
|
||||
border-bottom: 1px dotted rgba(0,0,0,.5);
|
||||
}
|
||||
|
|
165
www/index.php
165
www/index.php
|
@ -2,91 +2,98 @@
|
|||
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'];
|
||||
$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>
|
||||
<html lang="no">
|
||||
<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/splash.css">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
<head>
|
||||
<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/splash.css">
|
||||
<link rel="stylesheet" href="css/landing.css">
|
||||
<link rel="shortcut icon" href="favicon.ico">
|
||||
</head>
|
||||
|
||||
<header>Program­vare­verk­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­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&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"><li>Veibeskrivelse</li></a>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<article class="threed">
|
||||
<img src="pvv-logo.png" class="float-right">
|
||||
<h2>Velkommen til Program­vare­verk­stedet</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>
|
||||
<p>
|
||||
<a class="btn" href="om/">Om PVV</a>
|
||||
<a class="btn" href="paamelding/">Bli medlem</a>
|
||||
<a class="btn" 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">Veibeskrivelse</a>
|
||||
</p>
|
||||
</article>
|
||||
<main class="contentsplit">
|
||||
<div class="gridr">
|
||||
<h2>Kommende aktiviteter</h2>
|
||||
<div class="calendar-events">
|
||||
<?php $counter1 = 0; ?>
|
||||
<?php $counter2 = 0; ?>
|
||||
<?php foreach($agenda->getNextDays() as $period => $events) if ($events && $counter1 < 3 && $counter2 < 10) { $counter1++ ?>
|
||||
<p class="no-chin"><?= $translation[$period] ?></p>
|
||||
<hr>
|
||||
<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">
|
||||
<article>
|
||||
<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>
|
||||
<?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 } ?>
|
||||
</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 må 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>
|
||||
<div class="gridl">
|
||||
<?php
|
||||
$title = $motd["title"];
|
||||
|
||||
</main>
|
||||
echo "<h2>";
|
||||
if($title == ""){
|
||||
echo "Dagens melding";
|
||||
}else{
|
||||
echo $title;
|
||||
}
|
||||
echo "</h2>";
|
||||
|
||||
<nav>
|
||||
<?php echo navbar(0, ''); ?>
|
||||
<?php echo loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
echo "<p>" . implode($motd["content"], "<br>") . "</p>";
|
||||
?>
|
||||
</div>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -16,77 +16,75 @@ $days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year));
|
|||
|
||||
?><!DOCTYPE html>
|
||||
<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­verk­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>
|
||||
<h2 style="text-align:center;">Aktiviteter for <?=$months_translations[$month-1]?> <?=$year?></h2>
|
||||
<main>
|
||||
<h2 style="text-align:center;">Aktiviteter for <?=$months_translations[$month-1]?> <?=$year?></h2>
|
||||
|
||||
<p><?php
|
||||
$pmonth = $month-1;
|
||||
$nmonth = $month+1;
|
||||
$pyear=$year;
|
||||
$nyear=$year;
|
||||
if ($pmonth==0) {$pmonth=12; $pyear--;}
|
||||
if ($nmonth==13) {$nmonth=1; $nyear++;}
|
||||
?>
|
||||
<a class="btn noselect" href="../kalender?year=<?=$pyear?>&month=<?=$pmonth?>">Forrige måned</a>
|
||||
<a class="btn noselect" style="float:right;" href="../kalender?year=<?=$nyear?>&month=<?=$nmonth?>">Neste måned</a>
|
||||
</p>
|
||||
<p><?php
|
||||
$pmonth = $month-1;
|
||||
$nmonth = $month+1;
|
||||
$pyear=$year;
|
||||
$nyear=$year;
|
||||
if ($pmonth==0) {$pmonth=12; $pyear--;}
|
||||
if ($nmonth==13) {$nmonth=1; $nyear++;}
|
||||
?>
|
||||
<a class="btn noselect" href="../kalender?year=<?=$pyear?>&month=<?=$pmonth?>">Forrige måned</a>
|
||||
<a class="btn noselect" style="float:right;" href="../kalender?year=<?=$nyear?>&month=<?=$nmonth?>">Neste måned</a>
|
||||
</p>
|
||||
|
||||
|
||||
<figure class="calendar">
|
||||
<ul>
|
||||
<li class="header noselect">mandag
|
||||
<li class="header noselect">tirsdag
|
||||
<li class="header noselect">onsdag
|
||||
<li class="header noselect">torsdag
|
||||
<li class="header noselect">fredag
|
||||
<li class="header noselect">lørdag
|
||||
<li class="header noselect">søndag
|
||||
<figure class="calendar">
|
||||
<ul>
|
||||
<li class="header noselect">mandag
|
||||
<li class="header noselect">tirsdag
|
||||
<li class="header noselect">onsdag
|
||||
<li class="header noselect">torsdag
|
||||
<li class="header noselect">fredag
|
||||
<li class="header noselect">lørdag
|
||||
<li class="header noselect">søndag
|
||||
|
||||
<?php if ($days_before_the_first != 0) { ?>
|
||||
<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&month=$month&day=$day"?>"><div>
|
||||
<span class="noselect day"><?= $day ?>.</span>
|
||||
<?php foreach($events as $event) { ?>
|
||||
<section style="background: <?=$event->getColor()?>"><?=$event->getName()?></section>
|
||||
<?php if ($days_before_the_first != 0) { ?>
|
||||
<li class="outOfMonth" style="grid-column: 1/<?=$days_before_the_first+1?>;">
|
||||
<?php } ?>
|
||||
</div></a>
|
||||
<?php } else { ?>
|
||||
<span class="noselect day"><?= $day ?>.</span>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
</ul>
|
||||
</figure>
|
||||
<?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&month=$month&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>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1, 'kalender'); ?>
|
||||
<?= loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
</ul>
|
||||
</figure>
|
||||
</main>
|
||||
<body>
|
||||
|
|
|
@ -1,38 +1,37 @@
|
|||
<?php
|
||||
require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc', 'include.php']);
|
||||
?><!DOCTYPE html>
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<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­verk­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>
|
||||
|
||||
<h2>Kommunikasjon</h2>
|
||||
<p>
|
||||
Det er ulike måter å kommunisere med PVV-medlemmer på.
|
||||
</p>
|
||||
<p>
|
||||
Vi har en IRC-kanal på <a href="http://webchat.ircnet.net/">IRCnet</a> kalt #pvv.
|
||||
</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>.
|
||||
</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">på stripa</a>.
|
||||
</p>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1, 'kontakt'); ?>
|
||||
<?= loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
<main>
|
||||
<h2>Kommunikasjon</h2>
|
||||
<p>
|
||||
Det er ulike måter å kommunisere med PVV-medlemmer på.
|
||||
</p>
|
||||
<p>
|
||||
Vi har en IRC-kanal på <a href="http://webchat.ircnet.net/">IRCnet</a> kalt #pvv.
|
||||
</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>.
|
||||
</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">på stripa</a>.
|
||||
</p>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -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­verk­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>
|
|
@ -9,6 +9,7 @@ use \pvv\side\Agenda;
|
|||
<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>Sosial­verk­stedet</header>
|
||||
|
|
|
@ -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år brukerkonto på 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år tom for diskplass er det mulig å kjøpe utvidet diskkvote. For å aktivere brukerkonto på PVV, må man møte opp på lokalene slik at man får satt passord.
|
||||
|
||||
<p>I tillegg får man tilgang til PVVs to oppholdsrom, rom 226 og 229 i Sentralbygg 2 (se kart over andre etasje i SBII). På rom 229 er det seks arbeidsstasjoner som kjører Linux, macOS, FreeBSD, samt bordplass, nettverksuttak og egen Wifi AP for laptoper. På rom 226 er det sofakrok med TV og diverse spillkonsoller.
|
||||
|
||||
<p>Dersom du ønsker å lære Unix er det god anledning til det på PVV. Vi har et sterkt faglig miljø, med mange svært kunnskapsrike personer, som stort sett ikke har noe imot å hjelpe nybegynnere. Man kan få større privilegier her enn på stud-maskinene, for eksempel gjennom å 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å ei relativt innholdsrik boksamling til disposisjon for medlemmene, samt ei bokhylle full av blad og tegneserier. (For tiden abonnerer vi på Lunch tegneserie). Vi har i tillegg et romslig bokbudsjett, så dersom du har forslag til bøker/blad vi burde kjøpe inn er det bare å sende en mail til styret (<code lang="">pvv@pvv.ntnu.no</code>). Ta en titt på hva som står i bokhyllen.
|
||||
|
||||
<p>PVV har også en del brettspill du kan prøve.
|
||||
</article>
|
||||
|
||||
<article>
|
||||
<h2>Hvordan bli medlem</h2>
|
||||
|
||||
<p>Første steg for å bli medlem i PVV er å betale medlemskontingent.
|
||||
|
||||
<p>Medlemskontingenten er kr 50,00 per år. Det er også mulig å bli livstidsmedlem ved å betale kr 1024,00 én gang. Kontingent betales til konto <code lang="">8601.11.16916</code>. Betalingen Må merkes med NTNU brukernavn.
|
||||
|
||||
<p>Det er mulig å betale for flere år samtidig ved å betale et helt multiplum av kr 50.
|
||||
|
||||
<p>Kontingentinnbetalinger blir registrert i medlemsdatabasen, og det er lurt å sjekke at betalingen din dukker opp her (merk at det kan ta litt tid fra du betaler til kasserer får beskjed om det, og deretter litt tid før kasserer fø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>
|
|
@ -45,62 +45,78 @@ if (isset($_SESSION['userdata'])) { // if logged in with feide
|
|||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<title>PVV registrering</title>
|
||||
|
||||
<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">
|
||||
<head>
|
||||
<title>PVV registrering</title>
|
||||
<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­verks­stedet</header>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(1); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
|
||||
<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 på besøk på <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 på 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 på PVV, må du møte opp på
|
||||
lokalene våre slik at du kan få satt ditt passord.
|
||||
</p>
|
||||
|
||||
<?php if($attrs) { //logged in with pvv account?>
|
||||
<main>
|
||||
<h2>Registrer deg som bruker</h2>
|
||||
|
||||
<p>
|
||||
Du er nå logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>,
|
||||
og trenger klart ikke sende melding om å få ny PVV bruker.
|
||||
PVV har for øyeblikket et manuelt system for å legge til nye brukere.
|
||||
Vi foretrekker at du kommer inn på besøk på <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 på 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 på PVV, må du møte opp på
|
||||
lokalene våre slik at vi kan få satt et passord.
|
||||
</p>
|
||||
<?php } elseif (isset($_SESSION['userdata'])) { //logged in with feide ?>
|
||||
<?php if (! isset($_GET['send_mail'])) { ?>
|
||||
<h3>Meldingen som du nå sender:</h3>
|
||||
|
||||
<?php if($attrs) { //logged in with pvv account?>
|
||||
<p>
|
||||
Du er nå logget in som <i><?= htmlspecialchars($attrs['uid'][0]) ?></i>,
|
||||
og trenger klart ikke sende melding om å få ny PVV bruker.
|
||||
</p>
|
||||
<?php } elseif (isset($_SESSION['userdata'])) { //logged in with feide ?>
|
||||
<?php if (! isset($_GET['send_mail'])) { ?>
|
||||
<h3>Meldingen som du nå 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>
|
||||
Til: <?=$mailTo?><br>
|
||||
Til: drift@pvv.ntnu.no<br>
|
||||
Fra: nettsiden<br>
|
||||
Tittel: <?=$mailSubject?><br>
|
||||
<br/>
|
||||
<?= nl2br($mailBody) ?>
|
||||
</code><br>
|
||||
<br>
|
||||
<a class="btn" href=".?send_mail#sent">Send!</a>
|
||||
Todo: Legg til en "send mail" knapp
|
||||
<?php } else { // not logged in?>
|
||||
<p id="sent">
|
||||
Meldingen har blitt sendt!
|
||||
</p>
|
||||
<a class="btn" href=".?login">æ kanj itj lææv uten dæ piær!</a>
|
||||
<?php }?>
|
||||
<?php } else { // not logged in?>
|
||||
<a class="btn" href=".?login">Hent navn og epost fra Feide</a>
|
||||
<?php }?>
|
||||
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -46,41 +46,40 @@ if($new == 0){
|
|||
}
|
||||
?>
|
||||
|
||||
<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/events.css">
|
||||
<link rel="stylesheet" href="../../css/admin.css">
|
||||
<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/splash.css">
|
||||
</head>
|
||||
|
||||
<header>Prosjekt­verk­stedet</header>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(1, 'prosjekt'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
<main>
|
||||
<h2>Nytt prosjekt</h2>
|
||||
|
||||
<article>
|
||||
<h2>Nytt prosjekt</h2>
|
||||
<form action="update.php", method="post">
|
||||
<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">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>
|
||||
<p class="subtitle no-chin">Beskrivelse</p>
|
||||
<p class="subnote no-chin">Hva går prosjektet ditt ut på?</p>
|
||||
<p class="subnote">Den første linjen blir vist på prosjektkortet, prøv å holde den kort!</p>
|
||||
<textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= implode($project->getDescription(), "\n"); ?></textarea>
|
||||
|
||||
<p class="subtitle no-chin">Beskrivelse</p>
|
||||
<p class="subnote">Hva går prosjektet ditt ut på?</p>
|
||||
<textarea name="desc" style="width:100%" rows="8" class="boxinput"><?= $project->getDescription() ?></textarea>
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
|
||||
<?= '<input type="hidden" name="id" value="' . $project->getID() . '" />' ?>
|
||||
<div style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<div style="margin-top: 2em;">
|
||||
<hr class="ruler">
|
||||
|
||||
<?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?>
|
||||
</div>
|
||||
</form>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1, 'prosjekt'); ?>
|
||||
<?= loginbar(); ?>
|
||||
</nav>
|
||||
<?= '<input type="submit" class="btn" value="' . ($new ? 'Opprett prosjekt' : 'Lagre endringer') . '"></a>'; ?>
|
||||
</div>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
|
@ -5,63 +5,62 @@ $translation = ['i dag', 'i morgen', 'denne uka', 'neste uke', 'denne måneden',
|
|||
$projectManager = new \pvv\side\ProjectManager($pdo);
|
||||
$projects = $projectManager->getAll();
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="no">
|
||||
<title>Prosjektverkstedet</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/splash.css">
|
||||
<head>
|
||||
<title>Prosjektverkstedet</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/splash.css">
|
||||
<link rel="stylesheet" href="../css/projects.css">
|
||||
</head>
|
||||
|
||||
<header>Prosjekt­verk­stedet</header>
|
||||
<body>
|
||||
<nav>
|
||||
<?php echo navbar(1, 'prosjekt'); ?>
|
||||
<?php echo loginbar(null, $pdo); ?>
|
||||
</nav>
|
||||
|
||||
<main>
|
||||
|
||||
<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">
|
||||
<main>
|
||||
<h2>Prosjekter</h2>
|
||||
<?php
|
||||
$randProjects = array_rand($projects, min(3, count($projects)));
|
||||
if (!is_array($randProjects)) {
|
||||
$randProjects = [$randProjects];
|
||||
};
|
||||
foreach($randProjects as $i) {
|
||||
$project = $projects[$i];
|
||||
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>
|
||||
<hr class="projects-divider">
|
||||
|
||||
<li>
|
||||
<p class="noborder no-chin"><?= "<a href=\"project/?id=" . $project->getID() . "\">" . $project->getName() . "</a>"; ?></p>
|
||||
<p class="subnote"><?= "Organisert av: " . $project->getOwner(); ?></p>
|
||||
<span>
|
||||
<p><?= $project->getDescription(); ?></p>
|
||||
</span>
|
||||
</li>
|
||||
<?php
|
||||
$randProjects = array_rand($projects, min(6, count($projects)));
|
||||
if (!is_array($randProjects)) {
|
||||
$randProjects = [$randProjects];
|
||||
};
|
||||
foreach($randProjects as $i) {
|
||||
$project = $projects[$i];
|
||||
?>
|
||||
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</article>
|
||||
|
||||
</main>
|
||||
|
||||
<nav>
|
||||
<?= navbar(1, 'prosjekt'); ?>
|
||||
<?= loginbar($sp, $pdo); ?>
|
||||
</nav>
|
||||
<div class="project-card">
|
||||
<div class="card-content">
|
||||
<h4 class="project-title"><?= $project->getName(); ?></h4>
|
||||
<p><?= $project->getDescription()[0]; ?></p>
|
||||
</div>
|
||||
<p class="project-organizer">Organisert av<br><?= $project->getOwner(); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</main>
|
||||
</body>
|
||||
|
|
|
@ -71,7 +71,7 @@ $projects = array_values(array_filter(
|
|||
<div class="event">
|
||||
<div class="event-info">
|
||||
<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>
|
||||
</li>
|
||||
|
|
Loading…
Reference in New Issue