Compare commits
9 Commits
i-am-implo
...
master
Author | SHA1 | Date |
---|---|---|
Felix Albrigtsen | e7b66b4bc6 | |
Oystein Kristoffer Tveit | c62f4d4705 | |
Oystein Kristoffer Tveit | 814e5bc6c7 | |
Oystein Kristoffer Tveit | f57edf60c1 | |
Felix Albrigtsen | a29d3fe803 | |
Felix Albrigtsen | 8bcadd1d2d | |
Felix Albrigtsen | 8a82e2795c | |
Felix Albrigtsen | 4ee8b73044 | |
Oystein Kristoffer Tveit | 6580cfe546 |
|
@ -33,9 +33,5 @@
|
||||||
devShells = forAllSystems (system: pkgs: {
|
devShells = forAllSystems (system: pkgs: {
|
||||||
default = pkgs.callPackage ./nix/shell.nix { inherit pkgs; };
|
default = pkgs.callPackage ./nix/shell.nix { inherit pkgs; };
|
||||||
});
|
});
|
||||||
|
|
||||||
# TODO:
|
|
||||||
# - Relicense the project to GPL or something
|
|
||||||
# - Write a module for the project
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,9 @@ use \pvv\side\Agenda;
|
||||||
$agenda = new \pvv\side\Agenda([
|
$agenda = new \pvv\side\Agenda([
|
||||||
// new \pvv\side\social\NerdepitsaActivity,
|
// new \pvv\side\social\NerdepitsaActivity,
|
||||||
// new \pvv\side\social\AnimekveldActivity,
|
// new \pvv\side\social\AnimekveldActivity,
|
||||||
// new \pvv\side\social\HackekveldActivity,
|
new \pvv\side\social\HackekveldActivity,
|
||||||
// new \pvv\side\social\BrettspillActivity,
|
new \pvv\side\social\BrettspillActivity,
|
||||||
// new \pvv\side\social\DriftkveldActivity,
|
new \pvv\side\social\DriftkveldActivity,
|
||||||
new \pvv\side\DBActivity($pdo),
|
new \pvv\side\DBActivity($pdo),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,10 @@ pkgs.mkShellNoCC {
|
||||||
test -e config.php || cp -v dist/config.local.php config.php
|
test -e config.php || cp -v dist/config.local.php config.php
|
||||||
|
|
||||||
|
|
||||||
|
if [ ! -d www/galleri/bilder/slideshow ] ; then
|
||||||
|
mkdir -p www/galleri/bilder/slideshow
|
||||||
|
fi
|
||||||
|
|
||||||
if [ ! -d vendor ] ; then
|
if [ ! -d vendor ] ; then
|
||||||
composer install || exit $?
|
composer install || exit $?
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ use \DateInterval;
|
||||||
|
|
||||||
class Agenda {
|
class Agenda {
|
||||||
|
|
||||||
|
private $activities;
|
||||||
|
|
||||||
const TODAY = 0;
|
const TODAY = 0;
|
||||||
const TOMORROW = 1;
|
const TOMORROW = 1;
|
||||||
const THIS_WEEK = 2;
|
const THIS_WEEK = 2;
|
||||||
|
@ -18,7 +20,7 @@ class Agenda {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getFormattedDate($date) {
|
public static function getFormattedDate($date) {
|
||||||
return trim(strftime('%A %e. %b %H.%M', $date->getTimeStamp()));
|
return $date->format("l j. M H.i");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getEventsBetween(DateTimeImmutable $from, DateTimeImmutable $to) {
|
public function getEventsBetween(DateTimeImmutable $from, DateTimeImmutable $to) {
|
||||||
|
|
|
@ -5,6 +5,7 @@ use \DateTimeImmutable;
|
||||||
use \PDO;
|
use \PDO;
|
||||||
|
|
||||||
class DBActivity implements Activity {
|
class DBActivity implements Activity {
|
||||||
|
private $pdo;
|
||||||
|
|
||||||
public function __construct(PDO $pdo) {
|
public function __construct(PDO $pdo) {
|
||||||
$this->pdo = $pdo;
|
$this->pdo = $pdo;
|
||||||
|
|
|
@ -24,7 +24,7 @@ abstract class Event {
|
||||||
return 'i morgen';
|
return 'i morgen';
|
||||||
}
|
}
|
||||||
if (Agenda::isThisWeek($this->getStart()) || $this->getStart()->sub(new DateInterval('P4D'))->getTimestamp() < time()) {
|
if (Agenda::isThisWeek($this->getStart()) || $this->getStart()->sub(new DateInterval('P4D'))->getTimestamp() < time()) {
|
||||||
return strftime('%A', $this->getStart()->getTimestamp());
|
return $this->getStart()->format("l");
|
||||||
}
|
}
|
||||||
if (Agenda::isNextWeek($this->getStart())) {
|
if (Agenda::isNextWeek($this->getStart())) {
|
||||||
return 'neste uke';
|
return 'neste uke';
|
||||||
|
@ -32,7 +32,7 @@ abstract class Event {
|
||||||
if (Agenda::isThisMonth($this->getStart())) {
|
if (Agenda::isThisMonth($this->getStart())) {
|
||||||
return 'denne måneden';
|
return 'denne måneden';
|
||||||
}
|
}
|
||||||
return trim(strftime('%e. %B', $this->getStart()->getTimestamp()));
|
return $this->getStart()->format("j. F");
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract function getStop(); /* : DateTimeImmutable */
|
public abstract function getStop(); /* : DateTimeImmutable */
|
||||||
|
|
|
@ -5,7 +5,7 @@ class SimpleEvent extends Event {
|
||||||
|
|
||||||
private $id, $name, $descr, $start, $end, $org, $loc;
|
private $id, $name, $descr, $start, $end, $org, $loc;
|
||||||
|
|
||||||
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $isDBEvent = false){
|
public function __construct($id, $name,\DateTimeImmutable $start,\DateTimeImmutable $end,$org, $loc, $descr, $_isDBEvent = false){
|
||||||
$this->id = $id;
|
$this->id = $id;
|
||||||
$this->name = $name;
|
$this->name = $name;
|
||||||
$this->start = $start;
|
$this->start = $start;
|
||||||
|
@ -13,7 +13,6 @@ class SimpleEvent extends Event {
|
||||||
$this->org = $org;
|
$this->org = $org;
|
||||||
$this->loc = $loc;
|
$this->loc = $loc;
|
||||||
$this->descr = explode("\n", $descr);
|
$this->descr = explode("\n", $descr);
|
||||||
$this->isDBEvent = $isDBEvent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getID(){
|
public function getID(){
|
||||||
|
@ -52,10 +51,6 @@ class SimpleEvent extends Event {
|
||||||
return $this->descr;
|
return $this->descr;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isDBEvent() {
|
|
||||||
return $this->isDBEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getColor() {
|
public function getColor() {
|
||||||
return "#3b7";
|
return "#3b7";
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,39 +65,23 @@ img.float-right {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-events ul li :not(.date):not(.time) {
|
|
||||||
display: inline-block;
|
|
||||||
width: calc(100% - 7em);
|
|
||||||
white-space: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
.calendar-events ul .date {
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
font-size: 0.8em;
|
|
||||||
margin-top: 0.2em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-events > li > p {
|
|
||||||
border-bottom: 0.1em dotted rgba(0, 0, 0, 0.2);
|
|
||||||
}
|
|
||||||
|
|
||||||
.calendar-events ul {
|
.calendar-events ul {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-events a,
|
.calendar-events a {
|
||||||
|
color: rgba(0,0,0, 0.85);
|
||||||
.calendar-events ul .time {
|
|
||||||
color: rgba(0, 0, 0, 0.5);
|
|
||||||
float: right;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-events ul .icon,
|
.calendar-events ul .datetime {
|
||||||
.calendar-events ul .date {
|
color: rgba(0, 0, 0, 0.5);
|
||||||
float: right;
|
float: right;
|
||||||
margin-right: 0.5em;
|
margin-left: 0.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar-events ul li {
|
||||||
|
margin-bottom: 0.4em;
|
||||||
}
|
}
|
||||||
|
|
||||||
main.contentsplit {
|
main.contentsplit {
|
||||||
|
|
|
@ -77,18 +77,20 @@ $doorTime = date("H:i", $doorEntry->time);
|
||||||
<?php } else { ?>
|
<?php } else { ?>
|
||||||
<strong><?= $event->getName(); ?></strong>
|
<strong><?= $event->getName(); ?></strong>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<?php /* <a class="icon subscribe">+</a> */ ?>
|
|
||||||
<?php if ($period !== \pvv\side\Agenda::TODAY) {
|
<span class="datetime">
|
||||||
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
|
<?php if ($period !== \pvv\side\Agenda::TODAY) {
|
||||||
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
|
echo $event->getStart()->format('H:i') . " " ;
|
||||||
echo '<span class="date">' . strftime('%a', $event->getStart()->getTimestamp()) . '</span>';
|
if (\pvv\side\Agenda::isThisWeek($event->getStart()) || $event->getStart()->sub(new DateInterval('P3D'))->getTimestamp() < time()) {
|
||||||
} else {
|
echo $event->getStart()->format('D');
|
||||||
echo '<span class="date">' . strftime('%e. %b', $event->getStart()->getTimestamp()) . '</span>';
|
} else {
|
||||||
}
|
echo $event->getStart()->format('j. F');
|
||||||
} else {
|
}
|
||||||
echo '<span class="time">' . $event->getStart()->format('H:i') . '</span>';
|
} else {
|
||||||
}
|
echo $event->getStart()->format('H:i');
|
||||||
?>
|
}
|
||||||
|
?>
|
||||||
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -108,7 +110,7 @@ $doorTime = date("H:i", $doorEntry->time);
|
||||||
echo $title;
|
echo $title;
|
||||||
}
|
}
|
||||||
echo "</h1>";
|
echo "</h1>";
|
||||||
|
|
||||||
$Parsedown = new Parsedown();
|
$Parsedown = new Parsedown();
|
||||||
echo $Parsedown->text(implode("\n", $motd["content"]));
|
echo $Parsedown->text(implode("\n", $motd["content"]));
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -110,7 +110,7 @@ require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc'
|
||||||
<div class="serviceContent">
|
<div class="serviceContent">
|
||||||
<h2 class="serviceTitle">Brukernettsider</h2>
|
<h2 class="serviceTitle">Brukernettsider</h2>
|
||||||
<p class="serviceDescription">Alle brukere får automatisk en egen side for html og php. Denne er offentlig på pvv.ntnu.no/~brukernavn.</p>
|
<p class="serviceDescription">Alle brukere får automatisk en egen side for html og php. Denne er offentlig på pvv.ntnu.no/~brukernavn.</p>
|
||||||
<div class="serviceLink"><a href="https://wiki.pvv.ntnu.no/wiki/Hjemmesider" target="_blank">Gå til dokumentasjon på wiki</a></div>
|
<div class="serviceLink"><a href="https://wiki.pvv.ntnu.no/wiki/Tjenester/Hjemmesider" target="_blank">Gå til dokumentasjon på wiki</a></div>
|
||||||
</div>
|
</div>
|
||||||
<img class="serviceImage" src="img/php.png" alt="En elephpant">
|
<img class="serviceImage" src="img/php.png" alt="En elephpant">
|
||||||
</div>
|
</div>
|
||||||
|
@ -119,7 +119,7 @@ require_once dirname(dirname(__DIR__)) . implode(DIRECTORY_SEPARATOR, ['', 'inc'
|
||||||
<div class="serviceContent">
|
<div class="serviceContent">
|
||||||
<h2 class="serviceTitle">PVV-siden</h2>
|
<h2 class="serviceTitle">PVV-siden</h2>
|
||||||
<p class="serviceDescription">Du befinner deg nå på PVV sin offisielle hjemmeside. Den er skrevet i PHP og kjører på en egen server.</p>
|
<p class="serviceDescription">Du befinner deg nå på PVV sin offisielle hjemmeside. Den er skrevet i PHP og kjører på en egen server.</p>
|
||||||
<div class="serviceLink"><a href="https://github.com/Programvareverkstedet/nettsiden" target="_blank">Se koden på github</a></div>
|
<div class="serviceLink"><a href="https://git.pvv.ntnu.no/Projects/nettsiden" target="_blank">Se koden på gitea</a></div>
|
||||||
</div>
|
</div>
|
||||||
<img class="serviceImage" src="../pvv-logo.png" alt="PVV-logo">
|
<img class="serviceImage" src="../pvv-logo.png" alt="PVV-logo">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue