Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fb78794261 | |||
| 371a65d361 | |||
| 7bd3c8dfd1 | |||
| e5aa6ea25d | |||
| de9afd3275 | |||
| 79e9f17f70 | |||
| 12cc3c5d5b | |||
| 404cea74ff | |||
| 16e94947f2 | |||
| aff0b0560f | |||
| de19a6fc65 | |||
| 1f669aadfc | |||
| 33f428559c | |||
| 0c3b9eb250 | |||
| c654fab94a |
@@ -16,8 +16,6 @@
|
||||
|
||||
## Bekannte Fehler und Mängel
|
||||
- Bitte auf die gesetzten TODO's achten. Wenn Inhalte fehlen, sind sie i.d.R. als TODO kommentiert.
|
||||
- Die Navbar hat noch keine onHover-Effekte und erschwert etwas die Bedienung.
|
||||
- Suchleiste in der Nav ist in der mobilen Ansicht etwas schmal. Ggf. ein alternatives (kleineres) Logo implementieren.
|
||||
- Die Suchseite und Kategorieseite packen momentan alle passenden Beiträge untereinander. Später sollen zunächst 10
|
||||
Ergebnisse auf einer Seite angezeigt werden.
|
||||
|
||||
|
||||
@@ -5,6 +5,13 @@ if (session_status() === PHP_SESSION_NONE) {
|
||||
|
||||
$results = $_SESSION["search_results"] ?? [];
|
||||
$query = $_SESSION["search_query"] ?? "";
|
||||
|
||||
$limit = isset($_GET['limit']) ? (int)$_GET['limit'] : 10;
|
||||
if (!in_array($limit, [10, 20, 50, 100])) {
|
||||
$limit = 10;
|
||||
}
|
||||
$results = array_slice($results, 0, $limit);
|
||||
|
||||
$resultCount = count($results);
|
||||
|
||||
?>
|
||||
@@ -19,7 +26,7 @@ $resultCount = count($results);
|
||||
<aside class="s-res-sidebar">
|
||||
|
||||
<!-- Sortierfuntion Box und Such Box-->
|
||||
<form action="php/controller/search-results-controller.php" method="GET" class="s-res-sidebar-form">
|
||||
<form id="search-form-id" action="php/controller/search-results-controller.php" method="GET" class="s-res-sidebar-form">
|
||||
|
||||
<div class="s-res-sidebar-box">
|
||||
<h3 class="s-res-sidebar-title">Suche anpassen</h3>
|
||||
@@ -99,11 +106,11 @@ $resultCount = count($results);
|
||||
<!-- Auswahl der Ergebnisse pro Seite -->
|
||||
<div class="s-res-limit-selector">
|
||||
<label for="s-res-per-page" class="s-res-limit-label">Ergebnisse pro Seite:</label>
|
||||
<select id="s-res-per-page" name="limit" class="s-res-limit-select">
|
||||
<option value="10" selected>10</option>
|
||||
<option value="20">20</option>
|
||||
<option value="50">50</option>
|
||||
<option value="100">100</option>
|
||||
<select id="s-res-per-page" name="limit" class="s-res-limit-select" form="search-form-id" onchange="this.form.submit()">
|
||||
<option value="10" <?php echo $limit === 10 ? 'selected' : ''; ?>>10</option>
|
||||
<option value="20" <?php echo $limit === 20 ? 'selected' : ''; ?>>20</option>
|
||||
<option value="50" <?php echo $limit === 50 ? 'selected' : ''; ?>>50</option>
|
||||
<option value="100" <?php echo $limit === 100 ? 'selected' : ''; ?>>100</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
+37
-20
@@ -57,6 +57,10 @@ CSS für die navbar
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.nav__dropdown-menu a:hover {
|
||||
color: #1d4ed8;
|
||||
}
|
||||
|
||||
.nav__link {
|
||||
display: inline-block;
|
||||
font-weight: 600;
|
||||
@@ -89,6 +93,12 @@ CSS für die navbar
|
||||
border-radius: 4px; /* Abgerundete Ecken */
|
||||
background: #fff;
|
||||
margin: 0 0.5rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav__search input {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav__search-button {
|
||||
@@ -115,6 +125,31 @@ CSS für die navbar
|
||||
display: block;
|
||||
}
|
||||
|
||||
.nav__search-form {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nav__search {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.nav__search-button {
|
||||
display: inline-block;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
margin-left: 4px;
|
||||
flex-shrink: 0;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Responsive Anpassung unter 1240px */
|
||||
@media (max-width: 1240px) {
|
||||
.nav {
|
||||
@@ -151,8 +186,8 @@ CSS für die navbar
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Responsive Anpassungen unter 760px (für z.B. Smartphones) */
|
||||
@media (max-width: 800px) {
|
||||
/* Responsive Anpassungen unter 900px (für z.B. Smartphones) */
|
||||
@media (max-width: 900px) {
|
||||
.nav {
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
@@ -189,24 +224,6 @@ CSS für die navbar
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.nav__search {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.nav__search-button {
|
||||
display: inline-block;
|
||||
background: #fff;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 0.4rem 0.6rem;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.nav__search-button:hover {
|
||||
background-color: #f8f9fa;
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
Suchleiste. Wird via PHP später in alle Seiten eingebunden
|
||||
-->
|
||||
<!--<label for="site-search">Suche</label>-->
|
||||
<form action="php/controller/search-results-controller.php" method="GET" class="search-form" style="display: flex; align-items: center; gap: 5px;">
|
||||
<form action="php/controller/search-results-controller.php" method="GET" class="nav__search-form">
|
||||
|
||||
<input type="hidden" name="pfad" value="search-results">
|
||||
|
||||
|
||||
@@ -15,17 +15,34 @@ class UserManager {
|
||||
$userManager = DatabaseUserManager::getInstance();
|
||||
|
||||
/*
|
||||
* Dummy-User anlegen, falls er noch nicht existiert.
|
||||
* Passwort: test123
|
||||
* Dummy-User anlegen, falls sie noch nicht existieren.
|
||||
* Passwort für alle User: test12345
|
||||
*/
|
||||
if ($userManager->findUser("mustermann@web.de") == null) {
|
||||
$dummyUsers = [
|
||||
['email' => 'max.mustermann@web.de', 'vorname' => 'Max', 'nachname' => 'Mustermann'],
|
||||
['email' => 'erika.mustermann@web.de', 'vorname' => 'Erika', 'nachname' => 'Mustermann'],
|
||||
['email' => 'john.doe@gmail.com', 'vorname' => 'John', 'nachname' => 'Doe'],
|
||||
['email' => 'jane.doe@gmail.com', 'vorname' => 'Jane', 'nachname' => 'Doe'],
|
||||
['email' => 'anna.schmidt@gmx.de', 'vorname' => 'Anna', 'nachname' => 'Schmidt'],
|
||||
['email' => 'thomas.mueller@gmx.de', 'vorname' => 'Thomas', 'nachname' => 'Müller'],
|
||||
['email' => 'sabine.fischer@outlook.com', 'vorname' => 'Sabine', 'nachname' => 'Fischer'],
|
||||
['email' => 'michael.weber@outlook.com', 'vorname' => 'Michael', 'nachname' => 'Weber'],
|
||||
['email' => 'julia.wagner@t-online.de', 'vorname' => 'Julia', 'nachname' => 'Wagner'],
|
||||
['email' => 'stefan.becker@t-online.de', 'vorname' => 'Stefan', 'nachname' => 'Becker']
|
||||
];
|
||||
|
||||
$passwordHash = password_hash("test12345", PASSWORD_DEFAULT);
|
||||
|
||||
foreach ($dummyUsers as $user) {
|
||||
if ($userManager->findUser($user['email']) == null) {
|
||||
$userManager->addUser(
|
||||
"mustermann@web.de",
|
||||
"Max",
|
||||
"Mustermann",
|
||||
password_hash("test12345", PASSWORD_DEFAULT)
|
||||
$user['email'],
|
||||
$user['vorname'],
|
||||
$user['nachname'],
|
||||
$passwordHash
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return $userManager;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user