21 Commits

Author SHA1 Message Date
cd31bd4476 simplify mobile view 2025-09-08 13:25:54 +02:00
3d843667ad update /tjenester for mobile devices 2025-08-31 01:13:26 +02:00
617a799ad8 Merge pull request 'remove duplicated Kalender button at /hendelser' (#89) from vegardbm/nettsiden:main into main
Reviewed-on: #89
2025-08-18 02:03:29 +02:00
0be8e51af4 remove duplicated Kalender button at /hendelser 2025-08-18 01:59:37 +02:00
381f67189a Merge pull request 'fix missing port for buttercup' (#88) from vegardbm/nettsiden:main into main
Reviewed-on: #88
2025-08-17 20:57:52 +02:00
2e56c7aed4 fix missing port for buttercup 2025-08-17 20:54:21 +02:00
5b7a04dc69 Merge pull request 'update dead links for VM hosts at /tjenester' (#87) from vegardbm/nettsiden:main into main
Reviewed-on: #87
2025-08-17 20:45:06 +02:00
485110bf43 update dead links for VM hosts at /tjenester 2025-08-17 20:43:05 +02:00
3498cb7d8e Merge pull request 'fix minecraft map link at /tjenester' (#86) from vegardbm/nettsiden:main into main
Reviewed-on: #86
2025-08-17 00:13:58 +02:00
ed3f307b9b fix minecraft map link at /tjenester 2025-08-17 00:04:51 +02:00
7070a12e16 Merge pull request 'render /hendelser tid, sted, arrangør nicely on mobile' (#85) from vegardbm/nettsiden:main into main
Reviewed-on: #85
Reviewed-by: Oystein Kristoffer Tveit <oysteikt@pvv.ntnu.no>
2025-08-14 22:47:21 +02:00
6bda1a91bd render /hendelser tid, sted, arrangør nicely on mobile 2025-08-14 22:46:06 +02:00
559b7ec03b Merge pull request 'fix mobile experience for /aktiviteter' (#84) from vegardbm/nettsiden:main into main
Reviewed-on: #84
Reviewed-by: Oystein Kristoffer Tveit <oysteikt@pvv.ntnu.no>
2025-08-14 22:20:24 +02:00
602ae1f396 fix mobile experience for /aktiviteter 2025-08-14 22:17:25 +02:00
f3c439d038 fix README 2025-08-14 21:20:05 +02:00
2b3a9dd6ec update README to reflect changes in dev environment 2025-08-14 21:09:33 +02:00
59b071d8be Fix oopsie, gitignore cache 2025-08-14 19:00:44 +02:00
f732582d0d Merge pull request 'Høst 2025; Legg til fadderuke, pause events' (#83) from fall-2025 into main
Reviewed-on: #83
Reviewed-by: Peder Bergebakken Sundt <pederbs@pvv.ntnu.no>
2025-07-18 21:05:40 +02:00
de72342018 activities: disable recurring events for the summer 2025-07-17 23:39:56 +02:00
b54bbda71f index.php: add fadderuke 2025 poster 2025-07-17 23:35:07 +02:00
20bab54235 dist/simplesamlphp-authsources: set entityID for service provider 2025-03-19 01:34:39 +01:00
13 changed files with 63 additions and 76 deletions

5
.gitignore vendored
View File

@@ -1,6 +1,7 @@
/result
/config.php
*.sqlite
/cache
/config.php
/result
/test.sql
/vendor/
/www/simplesaml

View File

@@ -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

View File

@@ -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/',
],
];

View File

@@ -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),
]);

View File

@@ -35,7 +35,7 @@ pkgs.mkShellNoCC {
cp dist/config.local.php config.php
ln -s ../vendor/simplesamlphp/simplesamlphp/public/ www/simplesaml
popd "$PROJECT_ROOT"
popd
fi
'';
}

View File

@@ -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(); ?>

View File

@@ -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;
}
}

View File

@@ -24,6 +24,7 @@ main {
}
.categoryLabel {
padding-top: 5px;
background-color: #002244;
color: white;
@@ -45,6 +46,7 @@ main {
.serviceContent {
flex-grow: 1;
margin-right: 4%;
}
.serviceTitle {
@@ -91,3 +93,27 @@ main {
}
}
@media (max-width: 480px) {
.categoryContainer {
border-radius: unset;
border: unset;
box-shadow: unset;
margin-bottom: unset;
}
.serviceWrapper {
width: 100%;
}
.serviceImage {
width: 25%;
height: auto;
}
.serviceContent {
width: 50%;
}
}
@media (max-width: 360px) {
.serviceContent {
font-size: 14px;
}
}

View File

@@ -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>

View File

@@ -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">

View File

@@ -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'];

Binary file not shown.

After

Width:  |  Height:  |  Size: 380 KiB

View File

@@ -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>