Updated the proostekrant to work properly again.
This commit is contained in:
Executable
+37
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
$page_title = 'Bevestiging';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="confirmation-container slide-up">
|
||||
<div class="icon">✓</div>
|
||||
<h2 class="title">Artikel Succesvol Ingediend!</h2>
|
||||
|
||||
<?php if ($article): ?>
|
||||
<div class="card mt-30">
|
||||
<h4 class="card-title"><?= htmlspecialchars($article['title']) ?></h4>
|
||||
<div class="article-meta">
|
||||
<span><strong>Datum:</strong> <?= date('d-m-Y', strtotime($article['event_date'])) ?></span>
|
||||
</div>
|
||||
<p class="card-content mt-20">
|
||||
Je artikel is opgeslagen en zal zichtbaar zijn in de volgende editie van de ProostenKrant.
|
||||
</p>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<p>Je artikel is succesvol ingediend en zal zichtbaar zijn in de volgende editie.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-actions mt-30">
|
||||
<a href="/" class="btn btn-primary">
|
||||
<span class="icon">←</span> Terug naar Home
|
||||
</a>
|
||||
<a href="/submit" class="btn btn-secondary">
|
||||
<span class="icon">+</span> Nog een Artikel Indienen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Executable
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
$page_title = 'Artikelen Bewerken';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="edit-list">
|
||||
<div class="section-header">
|
||||
<h2>Artikelen om te Bewerken</h2>
|
||||
<a href="/" class="btn btn-secondary btn-small">
|
||||
<span class="icon">←</span> Terug
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($articles)): ?>
|
||||
<div class="cards-grid">
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<div class="article-card">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start;">
|
||||
<h4 class="article-title"><?= htmlspecialchars($article['title']) ?></h4>
|
||||
<a href="/submit/edit/<?= $article['id'] ?>"
|
||||
class="edit-icon"
|
||||
title="Bewerken">
|
||||
<span>✏️</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="article-meta">
|
||||
<span><strong>Deelnemers:</strong>
|
||||
<?php
|
||||
$participantIds = explode(',', $article['participants']);
|
||||
$participantNames = [];
|
||||
foreach ($participantIds as $id) {
|
||||
if (!empty($id) && isset($usersById[$id])) {
|
||||
$participantNames[] = htmlspecialchars($usersById[$id]);
|
||||
}
|
||||
}
|
||||
echo implode(', ', $participantNames);
|
||||
?>
|
||||
</span>
|
||||
<span><strong>Datum:</strong> <?= date('d-m-Y', strtotime($article['event_date'])) ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="card text-center">
|
||||
<p class="text-muted">Er zijn geen artikelen om te bewerken.</p>
|
||||
<p class="mt-20">
|
||||
<a href="/submit" class="btn btn-primary">Nieuw Artikel Indienen</a>
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$page_title = 'Artikelen Bewerken - Beveiliging';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="passphrase-container slide-up">
|
||||
<h2 class="title">Artikelen Bewerken</h2>
|
||||
<p>Voer de familypaszin in om artikelen te kunnen bewerken:</p>
|
||||
|
||||
<form action="/submit/edit/verify" method="post">
|
||||
<div class="form-group">
|
||||
<label for="passphrase">Familie Paszin</label>
|
||||
<input type="password"
|
||||
name="passphrase"
|
||||
id="passphrase"
|
||||
class="form-control"
|
||||
required
|
||||
autocomplete="off"
|
||||
placeholder="Voer de paszin in">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="icon">→</span> Doorgaan
|
||||
</button>
|
||||
<a href="/" class="btn btn-secondary">Annuleren</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Executable
+192
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
$page_title = 'Nieuw Artikel Indienen';
|
||||
ob_start();
|
||||
|
||||
$users = $users ?? [];
|
||||
$oldInput = $oldInput ?? [];
|
||||
$errors = $errors ?? [];
|
||||
$article = $article ?? null;
|
||||
|
||||
// If editing, populate old input from article
|
||||
if ($article && empty($oldInput)) {
|
||||
$oldInput = [
|
||||
'title' => $article['title'],
|
||||
'content' => $article['content'],
|
||||
'writer' => $article['author_id'],
|
||||
'event_date' => $article['event_date'],
|
||||
'article_id' => $article['id']
|
||||
];
|
||||
|
||||
// Parse participants
|
||||
if (!empty($article['participants'])) {
|
||||
$participantIds = explode(',', $article['participants']);
|
||||
} else {
|
||||
$participantIds = [];
|
||||
}
|
||||
}
|
||||
|
||||
// Get selected participants from old input
|
||||
$selectedParticipants = [];
|
||||
if (!empty($oldInput['participants'])) {
|
||||
if (is_array($oldInput['participants'])) {
|
||||
$selectedParticipants = $oldInput['participants'];
|
||||
} else {
|
||||
$selectedParticipants = [$oldInput['participants']];
|
||||
}
|
||||
} elseif (isset($participantIds)) {
|
||||
$selectedParticipants = $participantIds;
|
||||
}
|
||||
|
||||
// Check if we have an uploaded image in session or from old input
|
||||
$uploadedImage = null;
|
||||
if (isset($_SESSION['uploaded_image'])) {
|
||||
$uploadedImage = $_SESSION['uploaded_image'];
|
||||
unset($_SESSION['uploaded_image']);
|
||||
} elseif ($article && $article['article_image']) {
|
||||
$uploadedImage = $article['article_image'];
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="article-form">
|
||||
<div class="section-header">
|
||||
<h2><?= $article ? 'Artikel Bewerken' : 'Nieuw Artikel Indienen' ?></h2>
|
||||
<a href="/" class="btn btn-secondary btn-small">
|
||||
<span class="icon">×</span> Annuleren
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<form action="/submit/store" method="post" enctype="multipart/form-data">
|
||||
<?php if ($article): ?>
|
||||
<input type="hidden" name="article_id" value="<?= $article['id'] ?>">
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="title">Titel *</label>
|
||||
<input type="text"
|
||||
name="title"
|
||||
id="title"
|
||||
value="<?= htmlspecialchars($oldInput['title'] ?? '') ?>"
|
||||
required
|
||||
class="form-control <?= isset($errors['title']) ? 'error' : '' ?>"
|
||||
placeholder="Voer de titel in">
|
||||
<?php if (isset($errors['title'])): ?>
|
||||
<span class="error-message"><?= htmlspecialchars($errors['title']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group full-width">
|
||||
<label for="content">Tekst *</label>
|
||||
<textarea name="content"
|
||||
id="content"
|
||||
rows="8"
|
||||
required
|
||||
class="form-control <?= isset($errors['content']) ? 'error' : '' ?>"
|
||||
placeholder="Schrijf hier de inhoud van je artikel..."><?= htmlspecialchars($oldInput['content'] ?? '') ?></textarea>
|
||||
<?php if (isset($errors['content'])): ?>
|
||||
<span class="error-message"><?= htmlspecialchars($errors['content']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="writer">Schrijver *</label>
|
||||
<select name="writer"
|
||||
id="writer"
|
||||
required
|
||||
class="form-control <?= isset($errors['writer']) ? 'error' : '' ?>">
|
||||
<option value="">-- Selecteer schrijver --</option>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<option value="<?= $user['id'] ?>"
|
||||
<?= (($oldInput['writer'] ?? '') == $user['id']) ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars($user['display_name']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php if (isset($errors['writer'])): ?>
|
||||
<span class="error-message"><?= htmlspecialchars($errors['writer']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="event_date">Datum van het evenement *</label>
|
||||
<input type="date"
|
||||
name="event_date"
|
||||
id="event_date"
|
||||
value="<?= htmlspecialchars($oldInput['event_date'] ?? date('Y-m-d')) ?>"
|
||||
required
|
||||
class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group full-width">
|
||||
<label>Deelnemers *</label>
|
||||
<p class="help-text">Selecteer alle personages die bij dit verhaal betrokken zijn.</p>
|
||||
<div class="checkbox-group">
|
||||
<?php foreach ($users as $user): ?>
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox"
|
||||
name="participants[]"
|
||||
value="<?= $user['id'] ?>"
|
||||
<?= (in_array($user['id'], $selectedParticipants)) ? 'checked' : '' ?>>
|
||||
<?= htmlspecialchars($user['display_name']) ?>
|
||||
</label>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<p class="help-text">Selecteer minstens één deelnemer</p>
|
||||
<?php if (isset($errors['participants'])): ?>
|
||||
<span class="error-message"><?= htmlspecialchars($errors['participants']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<div class="form-group full-width">
|
||||
<label for="image">Afbeelding *</label>
|
||||
<div class="file-upload-wrapper">
|
||||
<input type="file"
|
||||
name="image"
|
||||
id="image"
|
||||
accept="image/*"
|
||||
required>
|
||||
<label for="image" class="file-upload-label">
|
||||
<span class="icon">📷</span> Kies een afbeelding
|
||||
</label>
|
||||
</div>
|
||||
<p class="help-text file-upload-info">
|
||||
Upload een foto bij het artikel. Zowel landscape als portret foto's worden ondersteund.
|
||||
</p>
|
||||
|
||||
<?php if ($uploadedImage): ?>
|
||||
<div class="image-preview mt-20">
|
||||
<div class="image-preview-container">
|
||||
<img src="/<?= htmlspecialchars($uploadedImage) ?>" alt="Geselecteerde afbeelding">
|
||||
</div>
|
||||
<p class="text-muted mt-10">Afbeelding succesvol geupload: <?= htmlspecialchars(basename($uploadedImage)) ?></p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (isset($errors['image'])): ?>
|
||||
<span class="error-message"><?= htmlspecialchars($errors['image']) ?></span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="icon"><?= $article ? '✓' : '+' ?></span>
|
||||
<?= $article ? 'Artikel Bijwerken' : 'Artikel Indienen' ?>
|
||||
</button>
|
||||
<a href="/" class="btn btn-secondary">Annuleren</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Executable
+34
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
$page_title = 'Artikel Indienen - Beveiliging';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="passphrase-container slide-up">
|
||||
<h2 class="title">Beveiligingscontrole</h2>
|
||||
<p>Voer de familypaszin in om een artikel in te dienen:</p>
|
||||
|
||||
<form action="/submit/verify" method="post">
|
||||
<div class="form-group">
|
||||
<label for="passphrase">Familie Paszin</label>
|
||||
<input type="password"
|
||||
name="passphrase"
|
||||
id="passphrase"
|
||||
class="form-control"
|
||||
required
|
||||
autocomplete="off"
|
||||
placeholder="Voer de paszin in">
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="icon">→</span> Doorgaan
|
||||
</button>
|
||||
<a href="/" class="btn btn-secondary">Annuleren</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Executable
+51
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
$page_title = 'Verifieer Schrijver';
|
||||
ob_start();
|
||||
?>
|
||||
|
||||
<div class="writer-verification slide-up">
|
||||
<h2 class="title">Verifieer Schrijver</h2>
|
||||
|
||||
<?php if ($article): ?>
|
||||
<div class="card mb-30">
|
||||
<h4 class="card-title"><?= htmlspecialchars($article['title']) ?></h4>
|
||||
<p class="text-muted">
|
||||
Om dit artikel te bewerken, bevestig aub wie de schrijver is.
|
||||
</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="/submit/edit/verify-writer" method="post">
|
||||
<input type="hidden" name="article_id" value="<?= htmlspecialchars($article['id'] ?? '') ?>">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="writer_id">Selecteer de Schrijver *</label>
|
||||
<select name="writer_id"
|
||||
id="writer_id"
|
||||
required
|
||||
class="form-control">
|
||||
<option value="">-- Selecteer de schrijver --</option>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<option value="<?= $user['id'] ?>"
|
||||
<?= ($article && $article['author_id'] == $user['id']) ? 'selected' : '' ?>>
|
||||
<?= htmlspecialchars($user['display_name']) ?>
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="icon">→</span> Verifieer en Bewerk
|
||||
</button>
|
||||
<a href="/submit/edit/list" class="btn btn-secondary">
|
||||
<span class="icon">←</span> Terug naar Lijst
|
||||
</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content = ob_get_clean();
|
||||
require __DIR__ . '/../layouts/main.php';
|
||||
?>
|
||||
Reference in New Issue
Block a user