Updated the proostekrant to work properly again.

This commit is contained in:
douwe
2026-10-09 10:33:21 +02:00
parent 56d143b74b
commit 256a81a770
133 changed files with 10491 additions and 837 deletions
+19
View File
@@ -0,0 +1,19 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# Redirect all requests to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
# Allow .htaccess overrides
AllowOverride All
# PHP settings
<IfModule mod_php.c>
php_value upload_max_filesize 50M
php_value post_max_size 52M
php_value max_execution_time 300
</IfModule>
+1291
View File
File diff suppressed because it is too large Load Diff
+582
View File
@@ -0,0 +1,582 @@
/* Reset and Base Styles */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
}
/* Container */
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}
/* Header */
.header {
background: linear-gradient(135deg, #8B4513, #A0522D);
color: white;
padding: 20px 0;
margin-bottom: 30px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.header-content {
text-align: center;
margin-bottom: 20px;
}
.logo {
font-size: 2.5rem;
font-weight: bold;
margin-bottom: 5px;
}
.logo a {
color: white;
text-decoration: none;
}
.logo a:hover {
text-decoration: underline;
}
.slogan {
font-style: italic;
font-size: 1.2rem;
margin-bottom: 5px;
}
.location {
font-size: 1rem;
opacity: 0.9;
}
/* Navigation */
.nav {
display: flex;
justify-content: center;
gap: 20px;
flex-wrap: wrap;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.2);
}
.nav a {
color: white;
text-decoration: none;
padding: 10px 15px;
border-radius: 5px;
transition: background-color 0.3s;
}
.nav a:hover {
background-color: rgba(255, 255, 255, 0.2);
}
.nav a.btn {
background-color: #4CAF50;
}
.nav a.btn:hover {
background-color: #45a049;
}
.nav a.btn-logout {
background-color: #f44336;
}
.nav a.btn-logout:hover {
background-color: #d32f2f;
}
/* Main Content */
.main {
padding: 20px 0;
min-height: calc(100vh - 200px);
}
/* Footer */
.footer {
background-color: #8B4513;
color: white;
text-align: center;
padding: 20px 0;
margin-top: 30px;
}
/* Alerts */
.alert {
padding: 15px 20px;
margin-bottom: 20px;
border-radius: 5px;
display: flex;
justify-content: space-between;
align-items: center;
}
.alert-success {
background-color: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.alert-error {
background-color: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
.alert .close {
cursor: pointer;
font-weight: bold;
}
/* Login Page */
.login-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 70vh;
}
.login-card {
background-color: white;
padding: 40px;
border-radius: 10px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
width: 100%;
max-width: 500px;
}
.login-card h2 {
text-align: center;
color: #8B4513;
margin-bottom: 20px;
}
.login-card p {
text-align: center;
color: #666;
margin-bottom: 30px;
}
.login-form {
display: flex;
flex-direction: column;
gap: 20px;
}
/* Form Styles */
.form-group {
display: flex;
flex-direction: column;
gap: 5px;
}
.form-control {
padding: 12px;
border: 1px solid #ddd;
border-radius: 5px;
font-size: 1rem;
transition: border-color 0.3s;
}
.form-control:focus {
border-color: #8B4513;
outline: none;
}
.form-control.error {
border-color: #f44336;
}
.error-message {
color: #f44336;
font-size: 0.9rem;
margin-top: 5px;
}
label {
font-weight: 500;
color: #333;
}
/* Buttons */
.btn {
display: inline-block;
padding: 12px 24px;
background-color: #8B4513;
color: white;
text-decoration: none;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #A0522D;
}
.btn-primary {
background-color: #4CAF50;
}
.btn-primary:hover {
background-color: #45a049;
}
.btn-secondary {
background-color: #607d8b;
}
.btn-secondary:hover {
background-color: #455a64;
}
.btn-small {
padding: 8px 12px;
font-size: 0.9rem;
background-color: #607d8b;
}
.btn-small:hover {
background-color: #455a64;
}
/* Tables */
.articles-table {
width: 100%;
border-collapse: collapse;
margin: 20px 0;
}
.articles-table th,
.articles-table td {
padding: 15px;
text-align: left;
border-bottom: 1px solid #ddd;
}
.articles-table th {
background-color: #f5f5f5;
font-weight: 600;
}
.articles-table tr:hover {
background-color: #f9f9f9;
}
/* Status Badges */
.status-badge {
padding: 5px 10px;
border-radius: 15px;
font-size: 0.85rem;
font-weight: 500;
}
.status-badge.published {
background-color: #d4edda;
color: #155724;
}
.status-badge.draft {
background-color: #fff3cd;
color: #856404;
}
.status-badge.archived {
background-color: #f8d7da;
color: #721c24;
}
/* Cards */
.article-card,
.season-card,
.dashboard-card {
background-color: white;
border-radius: 10px;
padding: 20px;
margin-bottom: 20px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.article-card h4,
.season-card h4,
.dashboard-card h3 {
color: #8B4513;
margin-bottom: 10px;
}
.article-card .article-meta {
color: #666;
font-size: 0.9rem;
margin-bottom: 10px;
}
.article-card p {
color: #444;
line-height: 1.5;
}
.article-image {
width: 100%;
max-height: 200px;
object-fit: cover;
border-radius: 5px;
margin-top: 15px;
}
/* Grids */
.articles-grid,
.seasons-grid,
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 20px;
margin: 20px 0;
}
.dashboard-grid {
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
/* Season Banner */
.season-banner,
.season-info {
padding: 20px;
border-radius: 10px;
margin: 20px 0;
color: #333;
}
.season-banner h3,
.season-info h3 {
color: #333;
}
/* Form Layout */
.form-row {
display: flex;
gap: 20px;
margin-bottom: 20px;
}
.form-row .form-group {
flex: 1;
}
.form-row .full-width {
flex: none;
width: 100%;
}
.checkbox-group {
display: flex;
flex-wrap: wrap;
gap: 15px;
}
.checkbox-label {
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
padding: 8px 12px;
background-color: #f5f5f5;
border-radius: 5px;
transition: background-color 0.3s;
}
.checkbox-label:hover {
background-color: #e0e0e0;
}
.checkbox-label input[type="checkbox"] {
cursor: pointer;
}
.form-actions {
display: flex;
gap: 15px;
margin-top: 30px;
}
/* Article Detail */
.article-detail {
background-color: white;
border-radius: 10px;
padding: 30px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.article-detail h2 {
color: #8B4513;
margin-bottom: 20px;
}
.article-meta {
display: flex;
flex-wrap: wrap;
gap: 20px;
margin-bottom: 20px;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
}
.meta-item {
display: flex;
flex-direction: column;
}
.meta-item strong {
color: #8B4513;
}
.article-image-container {
margin: 20px 0;
text-align: center;
}
.article-image {
max-width: 100%;
max-height: 500px;
border-radius: 5px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.article-content {
line-height: 1.8;
color: #444;
}
.article-actions {
margin-top: 30px;
display: flex;
gap: 15px;
}
/* Quick Links */
.quick-links {
display: flex;
gap: 15px;
flex-wrap: wrap;
margin-top: 20px;
}
.quick-links a {
display: inline-block;
padding: 10px 20px;
background-color: white;
color: #8B4513;
text-decoration: none;
border: 1px solid #ddd;
border-radius: 5px;
transition: all 0.3s;
}
.quick-links a:hover {
background-color: #8B4513;
color: white;
}
/* Season Detail */
.season-detail {
background-color: white;
border-radius: 10px;
padding: 30px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.season-detail h2 {
color: #8B4513;
margin-bottom: 20px;
}
.season-info {
background-color: #f9f9f9;
padding: 15px;
border-radius: 5px;
margin-bottom: 30px;
}
.season-actions {
margin-top: 20px;
}
.back-link {
margin-top: 30px;
}
.back-link a {
color: #8B4513;
text-decoration: none;
}
.back-link a:hover {
text-decoration: underline;
}
/* Responsive */
@media (max-width: 768px) {
.header-content {
text-align: left;
}
.logo {
font-size: 2rem;
}
.nav {
flex-direction: column;
align-items: center;
}
.form-row {
flex-direction: column;
gap: 0;
}
.articles-grid,
.seasons-grid,
.dashboard-grid {
grid-template-columns: 1fr;
}
.article-meta {
flex-direction: column;
gap: 10px;
}
.form-actions {
flex-direction: column;
}
}
/* Print Styles */
@media print {
.nav,
.header-content {
display: none;
}
.article-card,
.season-card,
.dashboard-card {
box-shadow: none;
page-break-inside: avoid;
}
}
View File
View File
+114
View File
@@ -0,0 +1,114 @@
<?php
// Error reporting
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Start session
session_start();
// Set timezone
ini_set('date.timezone', 'Europe/Brussels');
// Autoload classes
spl_autoload_register(function ($class) {
$prefix = 'App\\';
$baseDir = __DIR__ . '/../src/';
$len = strlen($prefix);
if (strncmp($prefix, $class, $len) !== 0) {
return;
}
$relativeClass = substr($class, $len);
// Convert namespace separators to directory separators
$file = $baseDir . str_replace('\\', '/', $relativeClass) . '.php';
// Convert to lowercase for directory names
$parts = explode('/', $file);
$newParts = [];
foreach ($parts as $part) {
if (strpos($part, '.php') === false) {
$newParts[] = strtolower($part);
} else {
$newParts[] = $part;
}
}
$file = implode('/', $newParts);
if (file_exists($file)) {
require $file;
}
});
// Load configuration
$config = include __DIR__ . '/../config/app.php';
// Database configuration
$databaseConfig = include __DIR__ . '/../config/database.php';
// Set database environment variables for Docker
if (!getenv('DB_HOST')) {
putenv('DB_HOST=mysql');
}
if (!getenv('DB_NAME')) {
putenv('DB_NAME=proostenkrant');
}
if (!getenv('DB_USER')) {
putenv('DB_USER=proostenkrant');
}
if (!getenv('DB_PASSWORD')) {
putenv('DB_PASSWORD=proostenkrant');
}
// Load routes
$routes = include __DIR__ . '/../config/routes.php';
// Get current request
$method = $_SERVER['REQUEST_METHOD'];
$uri = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
// Route matching
$matched = false;
foreach ($routes[$method] ?? [] as $pattern => $handler) {
// Convert route pattern to regex
// First, replace route parameter patterns before quoting
$patternForRegex = preg_replace('/\(\d+\)/', '(\d+)', $pattern);
$patternForRegex = preg_replace('/\(\w+\)/', '([^\/]+)', $patternForRegex);
$regex = '#^' . $patternForRegex . '$#';
if (preg_match($regex, $uri, $matches)) {
// Remove first match (full match)
array_shift($matches);
// Parse handler
list($controllerName, $actionName) = explode('@', $handler);
// Instantiate controller
$controllerClass = 'App\\Controllers\\' . $controllerName;
if (class_exists($controllerClass)) {
$controller = new $controllerClass();
// Call action with parameters
if (method_exists($controller, $actionName)) {
call_user_func_array([$controller, $actionName], $matches);
$matched = true;
break;
}
}
}
}
// Handle 404
if (!$matched) {
http_response_code(404);
// Show a simple 404 page
echo '<!DOCTYPE html>';
echo '<html lang="nl">';
echo '<head><meta charset="UTF-8"><title>404 - Pagina niet gevonden</title></head>';
echo '<body style="text-align: center; padding: 50px;">';
echo '<h1>404 - Pagina niet gevonden</h1>';
echo '<p><a href="/">Ga terug naar de homepagina</a></p>';
echo '</body></html>';
}
+97
View File
@@ -0,0 +1,97 @@
// ProostenKrant JavaScript
document.addEventListener('DOMContentLoaded', function() {
// Auto-hide alerts after 5 seconds
const alerts = document.querySelectorAll('.alert');
alerts.forEach(alert => {
setTimeout(() => {
alert.style.opacity = '0';
setTimeout(() => {
alert.remove();
}, 500);
}, 5000);
});
// Form validation feedback
const formGroups = document.querySelectorAll('.form-group');
formGroups.forEach(group => {
const input = group.querySelector('.form-control');
const errorMessage = group.querySelector('.error-message');
if (input && errorMessage && errorMessage.textContent.trim() !== '') {
input.addEventListener('focus', function() {
input.classList.remove('error');
errorMessage.style.display = 'none';
});
}
});
// Auto-focus first input on login page
if (document.querySelector('.login-form')) {
const firstInput = document.querySelector('.login-form .form-control');
if (firstInput) {
firstInput.focus();
}
}
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Image preview for article form
const imageInputs = [document.getElementById('article_image'), document.getElementById('image')];
imageInputs.forEach(input => {
if (input) {
const form = input.closest('form');
const previewContainer = document.createElement('div');
previewContainer.className = 'image-preview';
previewContainer.style.display = 'none';
previewContainer.style.marginTop = '15px';
input.parentNode.parentNode.appendChild(previewContainer);
input.addEventListener('change', function(e) {
const file = e.target.files[0];
if (file && file.type.startsWith('image/')) {
const reader = new FileReader();
reader.onload = function(e) {
previewContainer.innerHTML = '<img src="' + e.target.result + '" style="max-width: 200px; max-height: 200px; border-radius: 5px;" />';
previewContainer.style.display = 'block';
};
reader.readAsDataURL(file);
} else {
previewContainer.style.display = 'none';
}
});
}
});
// Confirm before logout
const logoutLinks = document.querySelectorAll('.btn-logout, a[href="/logout"]');
logoutLinks.forEach(link => {
link.addEventListener('click', function(e) {
if (!confirm('Weet u zeker dat u wilt uitloggen?')) {
e.preventDefault();
}
});
});
// Season color indicator
const seasonCards = document.querySelectorAll('.season-card');
seasonCards.forEach(card => {
const bgColor = card.style.backgroundColor;
if (bgColor) {
card.style.borderLeft = '5px solid ' + bgColor;
}
});
});
+1
View File
@@ -0,0 +1 @@
/var/www/html/storage/latex