Compare commits
27 Commits
the-format
...
mobile_vie
Author | SHA1 | Date | |
---|---|---|---|
3d843667ad | |||
617a799ad8 | |||
0be8e51af4 | |||
381f67189a | |||
2e56c7aed4 | |||
5b7a04dc69 | |||
485110bf43 | |||
3498cb7d8e | |||
ed3f307b9b | |||
7070a12e16 | |||
6bda1a91bd | |||
559b7ec03b | |||
602ae1f396 | |||
f3c439d038 | |||
2b3a9dd6ec | |||
59b071d8be | |||
f732582d0d | |||
de72342018 | |||
b54bbda71f | |||
20bab54235
|
|||
c3d8ce017d
|
|||
02cfe9feaa
|
|||
4d4ec78ea3
|
|||
a74ea31356
|
|||
0653672a17
|
|||
8a1ff1a265
|
|||
c1802e7cf2
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,6 +1,7 @@
|
||||
/result
|
||||
/config.php
|
||||
*.sqlite
|
||||
/cache
|
||||
/config.php
|
||||
/result
|
||||
/test.sql
|
||||
/vendor/
|
||||
/www/simplesaml
|
||||
|
@@ -51,7 +51,6 @@ return (new PhpCsFixer\Config())
|
||||
|
||||
// TODO: fix these
|
||||
'psr_autoloading' => false,
|
||||
'strict_comparison' => false,
|
||||
])
|
||||
->setFinder($finder)
|
||||
->setIndent(" ")
|
||||
|
62
README.md
62
README.md
@@ -1,3 +1,4 @@
|
||||
|
||||
# Programvareverkstedets nettside
|
||||
|
||||
A website created with the latest and greatest web technologies.
|
||||
@@ -5,59 +6,25 @@ May contain blackjack and other things one tends to include in awesome projects.
|
||||
|
||||
## Installation
|
||||
|
||||
git clone --recursive https://github.com/Programvareverkstedet/nettsiden.git
|
||||
git clone --recursive https://github.com/Programvareverkstedet/nettsiden.git
|
||||
|
||||
Put it in a folder your webserver can find.
|
||||
|
||||
## Development setup
|
||||
|
||||
Make sure you have `sqlite3`, `php` and `pdo-sqlite` installed.
|
||||
These can be obtained from your package manager.
|
||||
Then make sure PHP has the `curl`, `pdo-sqlite`, `ext-dom` and `sqlite3` extensions enabled, see `/etc/php/php.ini`.
|
||||
The development environment can be setup with:
|
||||
|
||||
To install all mentioned requirements on debian: `apt install composer sqlite3 php8.1-sqlite3 simplesamlphp php-xml`, followed by `composer update`.
|
||||
nix develop
|
||||
|
||||
./dev.sh
|
||||
For this you will need to install the nix package manager and possibly set the experimental features in your nix config, likely located at /etc/nix/nix.conf or $HOME/.config/nix/nix.conf.
|
||||
|
||||
On Windows you can use chocolatey and git bash to run `./dev.sh`.
|
||||
Install `php` and `sqlite`, then enable these extensions in `C:\tools\php80\php.ini`:
|
||||
`mbstring`, `openssl`, `curl`, `pdo-sqlite` and `sqlite3`
|
||||
Installing nix with your package manager might not work without some tweaking, but the upstream script should just work which you can find [here](https://nixos.org/download/).
|
||||
|
||||
Alternatively you may use `cmd` on Windows.
|
||||
In this case you'll have to perform a `composer install` manually beforehand.
|
||||
Good luck.
|
||||
experimental-features = flakes nix-command
|
||||
|
||||
dev.bat
|
||||
|
||||
|
||||
### Dependency management
|
||||
|
||||
`dev.sh` will ensure the git submodules have been properly pulled, then download the `composer` package manager to a php archive file named `composer.phar`, then run it.
|
||||
Composer will then check for the php extensions needed, such as `pdo_sqlite`, which must be enabled on your system.
|
||||
This usually includes installing a php-sqlite3 package and enabling it in `/etc/php/php.ini`:
|
||||
|
||||
[PHP]
|
||||
extension=pdo_sqlite
|
||||
extension=sqlite3
|
||||
extension=ext-curl
|
||||
|
||||
Composer is used as such:
|
||||
|
||||
php composer.phar update
|
||||
php composer.phar install
|
||||
|
||||
|
||||
### Docker
|
||||
|
||||
We provide a simple docker-compose setup for local development.
|
||||
First ensure that docker is running:
|
||||
|
||||
sudo systemctl start docker
|
||||
|
||||
then
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose up
|
||||
You can then run the server with:
|
||||
|
||||
runDev
|
||||
|
||||
### Admin account
|
||||
|
||||
@@ -65,15 +32,6 @@ Login goes through `idp.pvv.ntnu.no` via SAML, so you have to use your PVV accou
|
||||
(This only works if you use access the local development site via the the hostname `localhost`)
|
||||
To make your account into an admin account, run:
|
||||
|
||||
sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
If using docker, when already running:
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose exec nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
If not already running:
|
||||
|
||||
DOCKER_USER=$(id -u):$(id -g) docker-compose run nettside sqlite3 pvv.sqlite 'INSERT INTO users (uname, groups) VALUES ("YOUR_USERNAME", 1);'
|
||||
|
||||
sqlite3 pvv.sqlite "INSERT INTO users (uname, groups) VALUES ('YOUR_USERNAME', 1);"
|
||||
|
||||
## Hosting
|
||||
|
50
dist/pvv.sql
vendored
50
dist/pvv.sql
vendored
@@ -1,50 +0,0 @@
|
||||
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,
|
||||
"description" TEXT,
|
||||
"active" BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE "projectmembers" (
|
||||
"projectid" INTEGER,
|
||||
"name" TEXT,
|
||||
"uname" TEXT,
|
||||
"mail" TEXT,
|
||||
"role" TEXT,
|
||||
"lead" BOOLEAN DEFAULT 0,
|
||||
"owner" BOOLEAN DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE "users" (
|
||||
"uname" TEXT,
|
||||
"groups" INT DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE "motd" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"title" TEXT,
|
||||
"content" TEXT
|
||||
);
|
||||
INSERT INTO motd (title, content)
|
||||
VALUES ('MOTD ./dev.sh', 'du kan endre motd i admin panelet');
|
||||
|
||||
CREATE TABLE "door" (
|
||||
"time" INTEGER PRIMARY KEY,
|
||||
"open" BOOLEAN
|
||||
);
|
||||
INSERT INTO door (time, open)
|
||||
VALUES (0, FALSE);
|
||||
|
||||
|
||||
INSERT INTO users (uname, groups)
|
||||
VALUES ('min_test_bruker', 1);
|
60
dist/pvv_mysql.sql
vendored
60
dist/pvv_mysql.sql
vendored
@@ -1,47 +1,45 @@
|
||||
CREATE TABLE events (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`start` TEXT,
|
||||
`stop` TEXT,
|
||||
`organiser` TEXT,
|
||||
`location` TEXT,
|
||||
`description` TEXT
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`start` TEXT,
|
||||
`stop` TEXT,
|
||||
`organiser` TEXT,
|
||||
`location` TEXT,
|
||||
`description` TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE projects (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`description` TEXT,
|
||||
`active` BOOLEAN
|
||||
CREATE TABLE projects (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`name` TEXT,
|
||||
`description` TEXT,
|
||||
`active` BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE projectmembers (
|
||||
`projectid` INTEGER,
|
||||
`name` TEXT,
|
||||
`uname` TEXT,
|
||||
`mail` TEXT,
|
||||
`role` TEXT,
|
||||
`lead` BOOLEAN DEFAULT 0,
|
||||
`owner` BOOLEAN DEFAULT 0
|
||||
`projectid` INTEGER,
|
||||
`name` TEXT,
|
||||
`uname` TEXT,
|
||||
`mail` TEXT,
|
||||
`role` TEXT,
|
||||
`lead` BOOLEAN DEFAULT 0,
|
||||
`owner` BOOLEAN DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE users (
|
||||
`uname` TEXT,
|
||||
`groups` INT DEFAULT 0
|
||||
);
|
||||
CREATE TABLE users (`uname` TEXT, `groups` INT DEFAULT 0);
|
||||
|
||||
CREATE TABLE motd (
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`title` TEXT,
|
||||
`content` TEXT
|
||||
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
|
||||
`title` TEXT,
|
||||
`content` TEXT
|
||||
);
|
||||
|
||||
/*
|
||||
INSERT INTO motd (title, content)
|
||||
VALUES ("MOTD ./dev.sh", "du kan endre motd i admin panelet");
|
||||
*/
|
||||
CREATE TABLE door (`time` INTEGER PRIMARY KEY, `open` BOOLEAN);
|
||||
|
||||
CREATE TABLE door (
|
||||
`time` INTEGER PRIMARY KEY,
|
||||
`open` BOOLEAN
|
||||
);
|
||||
INSERT INTO door(time, open) VALUES (0, FALSE);
|
||||
INSERT INTO
|
||||
door (time, open)
|
||||
VALUES
|
||||
(0, FALSE);
|
||||
|
54
dist/pvv_sqlite.sql
vendored
Normal file
54
dist/pvv_sqlite.sql
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
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,
|
||||
"description" TEXT,
|
||||
"active" BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE "projectmembers" (
|
||||
"projectid" INTEGER,
|
||||
"name" TEXT,
|
||||
"uname" TEXT,
|
||||
"mail" TEXT,
|
||||
"role" TEXT,
|
||||
"lead" BOOLEAN DEFAULT 0,
|
||||
"owner" BOOLEAN DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE "users" ("uname" TEXT, "groups" INT DEFAULT 0);
|
||||
|
||||
CREATE TABLE "motd" (
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"title" TEXT,
|
||||
"content" TEXT
|
||||
);
|
||||
|
||||
INSERT INTO
|
||||
motd (title, content)
|
||||
VALUES
|
||||
(
|
||||
'MOTD ./dev.sh',
|
||||
'du kan endre motd i admin panelet'
|
||||
);
|
||||
|
||||
CREATE TABLE "door" ("time" INTEGER PRIMARY KEY, "open" BOOLEAN);
|
||||
|
||||
INSERT INTO
|
||||
door (time, open)
|
||||
VALUES
|
||||
(0, FALSE);
|
||||
|
||||
INSERT INTO
|
||||
users (uname, groups)
|
||||
VALUES
|
||||
('min_test_bruker', 1);
|
1
dist/simplesamlphp-authsources.php
vendored
1
dist/simplesamlphp-authsources.php
vendored
@@ -6,6 +6,7 @@ $config = [
|
||||
/* This is the name of this authentication source, and will be used to access it later. */
|
||||
'default-sp' => [
|
||||
'saml:SP',
|
||||
'entityID' => 'https://www.pvv.ntnu.no/simplesaml/',
|
||||
'idp' => 'https://idp.pvv.ntnu.no/',
|
||||
],
|
||||
];
|
||||
|
@@ -27,9 +27,9 @@ use pvv\side\Agenda;
|
||||
$agenda = new Agenda([
|
||||
// new \pvv\side\social\NerdepitsaActivity,
|
||||
// new \pvv\side\social\AnimekveldActivity,
|
||||
new pvv\side\social\HackekveldActivity(),
|
||||
new pvv\side\social\BrettspillActivity(),
|
||||
new pvv\side\social\DriftkveldActivity(),
|
||||
// new pvv\side\social\HackekveldActivity(),
|
||||
// new pvv\side\social\BrettspillActivity(),
|
||||
// new pvv\side\social\DriftkveldActivity(),
|
||||
new pvv\side\DBActivity($pdo),
|
||||
]);
|
||||
|
||||
|
@@ -18,7 +18,7 @@ function navbar($depth, $active = null) {
|
||||
];
|
||||
foreach ($menuItems as $caption => $link) {
|
||||
$isActive = $active === $link;
|
||||
if (substr($link, 0, 4) != 'http') {
|
||||
if (substr($link, 0, 4) !== 'http') {
|
||||
$link = rtrim(str_repeat('../', $depth) . $link, '/') . '/';
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
{ pkgs }:
|
||||
{ pkgs, lib }:
|
||||
let
|
||||
phpEnv = pkgs.php84.buildEnv {
|
||||
extensions = { enabled, all }: enabled ++ (with all; [ iconv mbstring pdo_mysql pdo_sqlite ]);
|
||||
@@ -11,20 +11,21 @@ pkgs.mkShellNoCC {
|
||||
php84Packages.php-parallel-lint
|
||||
php84Packages.php-cs-fixer
|
||||
sqlite-interactive
|
||||
sql-formatter
|
||||
];
|
||||
|
||||
# Prepare dev environment with sqlite and config files
|
||||
shellHook = ''
|
||||
alias runDev='php -S localhost:1080 -d error_reporting=E_ALL -d display_errors=1 -t www/'
|
||||
|
||||
# Prepare dev environment with sqlite and config files
|
||||
test -e pvv.sqlite || sqlite3 pvv.sqlite < dist/pvv.sql
|
||||
test -e config.php || cp -v dist/config.local.php config.php
|
||||
declare -a PROJECT_ROOT="$("${lib.getExe pkgs.git}" rev-parse --show-toplevel)"
|
||||
|
||||
mkdir -p "$PROJECT_ROOT/www/galleri/bilder/slideshow"
|
||||
test -e "$PROJECT_ROOT/pvv.sqlite" || sqlite3 "$PROJECT_ROOT/pvv.sqlite" < "$PROJECT_ROOT/dist/pvv_sqlite.sql"
|
||||
test -e "$PROJECT_ROOT/config.php" || cp -v "$PROJECT_ROOT/dist/config.local.php" "$PROJECT_ROOT/config.php"
|
||||
|
||||
if [ ! -d www/galleri/bilder/slideshow ] ; then
|
||||
mkdir -p www/galleri/bilder/slideshow
|
||||
fi
|
||||
|
||||
if [ ! -d vendor ] ; then
|
||||
if [ ! -d "$PROJECT_ROOT/vendor" ] ; then
|
||||
pushd "$PROJECT_ROOT"
|
||||
composer install || exit $?
|
||||
|
||||
cp dist/simplesamlphp-authsources.php vendor/simplesamlphp/simplesamlphp/config/authsources.php
|
||||
@@ -34,6 +35,7 @@ pkgs.mkShellNoCC {
|
||||
cp dist/config.local.php config.php
|
||||
|
||||
ln -s ../vendor/simplesamlphp/simplesamlphp/public/ www/simplesaml
|
||||
popd
|
||||
fi
|
||||
'';
|
||||
}
|
||||
|
@@ -98,7 +98,7 @@ class UserManager {
|
||||
$statement->execute();
|
||||
|
||||
$row = $statement->fetch();
|
||||
if ($row == false) {
|
||||
if ($row === false) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -8,11 +8,11 @@ use pvv\side\Activity;
|
||||
|
||||
class AnimekveldActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 20 || $date->format('H') == 19 && $date->format('i') > 30) {
|
||||
if (intval($date->format('H')) > 20 || intval($date->format('H')) === 19 && intval($date->format('i')) > 30) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(19, 30, 0));
|
||||
}
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if ($date->format('N') != 5) {
|
||||
if (intval($date->format('N')) !== 5) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ class AnimekveldActivity implements Activity {
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 19 || $date->format('H') == 20 && $date->format('i') < 30) {
|
||||
if (intval($date->format('H')) < 19 || intval($date->format('H')) === 20 && intval($date->format('i')) < 30) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(19, 30, 0));
|
||||
}
|
||||
$date = $date->setTime(19, 30, 0);
|
||||
if ($date->format('N') != 5) {
|
||||
if (intval($date->format('N')) !== 5) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
|
||||
|
@@ -8,14 +8,14 @@ use pvv\side\Activity;
|
||||
|
||||
class BrettspillActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 17 || $date->format('H') == 16 && $date->format('i') > 15) {
|
||||
if (intval($date->format('H')) > 17 || intval($date->format('H')) === 16 && intval($date->format('i')) > 15) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(16, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 7) {
|
||||
if (intval($date->format('N')) !== 7) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2 - 1) {
|
||||
if (intval($date->format('W')) % 2 - 1) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ class BrettspillActivity implements Activity {
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 16 || $date->format('H') == 17 && $date->format('i') < 15) {
|
||||
if (intval($date->format('H')) < 16 || intval($date->format('H')) === 17 && intval($date->format('i')) < 15) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(16, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 7) {
|
||||
if (intval($date->format('N')) !== 7) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2 - 1) {
|
||||
if (intval($date->format('W')) % 2 - 1) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
|
@@ -8,14 +8,14 @@ use pvv\side\Activity;
|
||||
|
||||
class DriftkveldActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30) {
|
||||
if (intval($date->format('H')) > 18 || intval($date->format('H')) === 17 && intval($date->format('i')) > 30) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6) {
|
||||
if (intval($date->format('N')) !== 6) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2 - 1) {
|
||||
if (intval($date->format('W')) % 2 - 1) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ class DriftkveldActivity implements Activity {
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30) {
|
||||
if (intval($date->format('H')) < 17 || intval($date->format('H')) === 18 && intval($date->format('i')) < 30) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6) {
|
||||
if (intval($date->format('N')) !== 6) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2 - 1) {
|
||||
if (intval($date->format('W')) % 2 - 1) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
|
@@ -8,14 +8,14 @@ use pvv\side\Activity;
|
||||
|
||||
class HackekveldActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 18 || $date->format('H') == 17 && $date->format('i') > 30) {
|
||||
if (intval($date->format('H')) > 18 || intval($date->format('H')) === 17 && intval($date->format('i')) > 30) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(16, 15, 0);
|
||||
if ($date->format('N') != 6) {
|
||||
if (intval($date->format('N')) !== 6) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2) {
|
||||
if (intval($date->format('W')) % 2) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ class HackekveldActivity implements Activity {
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 17 || $date->format('H') == 18 && $date->format('i') < 30) {
|
||||
if (intval($date->format('H')) < 17 || intval($date->format('H')) === 18 && intval($date->format('i')) < 30) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(18, 15, 0));
|
||||
}
|
||||
$date = $date->setTime(18, 15, 0);
|
||||
if ($date->format('N') != 6) {
|
||||
if (intval($date->format('N')) !== 6) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2) {
|
||||
if (intval($date->format('W')) % 2) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
|
@@ -8,14 +8,14 @@ use pvv\side\Activity;
|
||||
|
||||
class NerdepitsaActivity implements Activity {
|
||||
public function nextDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') > 19) {
|
||||
if (intval($date->format('H')) > 19) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D'))->setTime(19, 0, 0));
|
||||
}
|
||||
$date = $date->setTime(19, 0, 0);
|
||||
if ($date->format('N') != 5) {
|
||||
if (intval($date->format('N')) !== 5) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2) {
|
||||
if (intval($date->format('W')) % 2) {
|
||||
return $this->nextDate($date->add(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
@@ -23,14 +23,14 @@ class NerdepitsaActivity implements Activity {
|
||||
}
|
||||
|
||||
public function prevDate(\DateTimeImmutable $date) {
|
||||
if ($date->format('H') < 19) {
|
||||
if (intval($date->format('H')) < 19) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D'))->setTime(19, 0, 0));
|
||||
}
|
||||
$date = $date->setTime(19, 0, 0);
|
||||
if ($date->format('N') != 5) {
|
||||
if (intval($date->format('N')) !== 5) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P1D')));
|
||||
}
|
||||
if ($date->format('W') % 2) {
|
||||
if (intval($date->format('W')) % 2) {
|
||||
return $this->prevDate($date->sub(new \DateInterval('P7D')));
|
||||
}
|
||||
|
||||
|
@@ -55,6 +55,7 @@ $day = (isset($_GET['day']))
|
||||
<em><?php echo $event->getRelativeDate(); ?></em>
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
<?php if ($event->getURL()) { ?>
|
||||
<br>
|
||||
<a href="<?php echo $event->getURL(); ?>"><?php echo $event->getName(); ?></a>
|
||||
<?php } else { ?>
|
||||
<?php echo $event->getName(); ?>
|
||||
|
@@ -11,7 +11,6 @@ h2 em {
|
||||
font-size: .5em;
|
||||
line-height: 2em;
|
||||
float: left;
|
||||
margin-right: 1em;
|
||||
border: .1em solid gray;
|
||||
padding: 0 1em;
|
||||
border-radius: .25em;
|
||||
@@ -107,7 +106,6 @@ p + .subtext {
|
||||
}
|
||||
@media screen and (max-width: 50rem) {
|
||||
h2 {
|
||||
text-align: center;
|
||||
position: relative;
|
||||
border-bottom-left-radius: 0.3em;
|
||||
border-bottom-right-radius: 0.3em;
|
||||
@@ -133,4 +131,8 @@ p + .subtext {
|
||||
article >.subtext {
|
||||
margin-top: -1em !important;
|
||||
}
|
||||
|
||||
.subtext li {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
@@ -45,6 +45,7 @@ main {
|
||||
|
||||
.serviceContent {
|
||||
flex-grow: 1;
|
||||
margin-right: 4%;
|
||||
}
|
||||
|
||||
.serviceTitle {
|
||||
@@ -91,3 +92,18 @@ main {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 400px) {
|
||||
.serviceImage {
|
||||
width: 25%;
|
||||
height: auto;
|
||||
}
|
||||
.serviceContent {
|
||||
width: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 360px) {
|
||||
.serviceContent {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
@@ -66,9 +66,5 @@ $translation = ['I dag', 'I morgen', 'Denne uka', 'Neste uke', 'Denne måneden',
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 2em;">
|
||||
<a style="padding-left: 2em; padding-right: 2em;" class="btn" style="" href="../kalender/">Kalender</a>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
</body>
|
||||
|
@@ -37,7 +37,7 @@ if (!$event) {
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?><strong><?php } ?>
|
||||
<em><?php echo $event->getRelativeDate(); ?></em>
|
||||
<?php if (Agenda::isToday($event->getStart())) { ?></strong><?php } ?>
|
||||
|
||||
<br>
|
||||
<?php echo $event->getName(); ?>
|
||||
</h2>
|
||||
<ul class="subtext">
|
||||
|
@@ -109,6 +109,8 @@ $doorTime = date('H:i', $doorEntry->time);
|
||||
</div>
|
||||
|
||||
<div class="gridl">
|
||||
<img src="/sosiale/fadderuke-2025.png" width="100%">
|
||||
<br>
|
||||
<?php
|
||||
$title = $motd['title'];
|
||||
|
||||
|
BIN
www/sosiale/fadderuke-2025.png
Normal file
BIN
www/sosiale/fadderuke-2025.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 380 KiB |
@@ -129,29 +129,29 @@ require_once \dirname(__DIR__, 2) . implode(\DIRECTORY_SEPARATOR, ['', 'inc', 'i
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Proxmox @joshua</h2>
|
||||
<p class="serviceDescription">Joshua er en av våre VM-tjenere, her kan du kjøre enten fulle VM-er eller konteinere. Bare Drift har tilgang på disse tjenerne.</p>
|
||||
<div class="serviceLink"><a href="https://joshua.pvv.ntnu.no:8006" target="_blank">Gå til joshua.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @blossom</h2>
|
||||
<p class="serviceDescription">Blossom er den sterkeste av våre VM-tjenere, her kan du kjøre enten fulle VM-er eller konteinere. Bare Drift har tilgang på disse tjenerne.</p>
|
||||
<div class="serviceLink"><a href="https://blossom.pvv.ntnu.no:8006" target="_blank">Gå til blossom.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Proxmox @andresbu</h2>
|
||||
<p class="serviceDescription">Andresbu er en kraftigere VM-tjener, men har fortsatt en del rusk i maskineriet.</p>
|
||||
<div class="serviceLink"><a href="https://andresbu.pvv.ntnu.no:8006" target="_blank">Gå til andresbu.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @bubbles</h2>
|
||||
<p class="serviceDescription">Bubbles er den svakeste av våre VM-tjenere.</p>
|
||||
<div class="serviceLink"><a href="https://bubbles.pvv.ntnu.no:8006" target="_blank">Gå til bubbles.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
|
||||
<div class="service">
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">ESXI @asgore</h2>
|
||||
<p class="serviceDescription">Asgore er vår eldste og største VM-tjener, og kjører ESXI.</p>
|
||||
<div class="serviceLink"><a href="https://asgore.pvv.ntnu.no" target="_blank">Gå til asgore.pvv.ntnu.no</a></div>
|
||||
<h2 class="serviceTitle">Proxmox @buttercup</h2>
|
||||
<p class="serviceDescription">Buttercup er en av våre VM-tjenere.</p>
|
||||
<div class="serviceLink"><a href="https://buttercup.pvv.ntnu.no:8006" target="_blank">Gå til buttercup.pvv.ntnu.no</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/esxi.png" alt="ESXI-logo">
|
||||
<img class="serviceImage" src="img/proxmox.png" alt="Proxmox-logo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -164,7 +164,7 @@ require_once \dirname(__DIR__, 2) . implode(\DIRECTORY_SEPARATOR, ['', 'inc', 'i
|
||||
<div class="serviceContent">
|
||||
<h2 class="serviceTitle">Minecraft</h2>
|
||||
<p class="serviceDescription">Vi har en egen Minecraft-server <b>for medlemmer</b>, som du kan koble til med IP-adressen <b>minecraft.pvv.ntnu.no</b>. Spør om whitelist på matrix/discord.</p>
|
||||
<div class="serviceLink"><a href="https://isvegg.pvv.ntnu.no/kart/" target="_blank">Gå til verdenskartet vårt</a></div>
|
||||
<div class="serviceLink"><a href="https://minecraft.pvv.ntnu.no" target="_blank">Gå til verdenskartet vårt</a></div>
|
||||
</div>
|
||||
<img class="serviceImage" src="img/minecraft.png" alt="Minecraft-logo">
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user