navbar logout mit post
This commit is contained in:
+21
-1
@@ -250,7 +250,7 @@ CSS für die navbar
|
|||||||
padding: 2rem 1rem;
|
padding: 2rem 1rem;
|
||||||
box-shadow: 2px 0 10px rgba(0,0,0,0.5);
|
box-shadow: 2px 0 10px rgba(0,0,0,0.5);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
|
||||||
/* Genug Abstand oben rechts, damit Links nicht hinter dem X liegen */
|
/* Genug Abstand oben rechts, damit Links nicht hinter dem X liegen */
|
||||||
padding: 4rem 1.5rem 2rem 1.5rem;
|
padding: 4rem 1.5rem 2rem 1.5rem;
|
||||||
}
|
}
|
||||||
@@ -285,6 +285,26 @@ CSS für die navbar
|
|||||||
border-bottom: 1px solid #333d43;
|
border-bottom: 1px solid #333d43;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav__logout-form {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav__mobile-logout-button {
|
||||||
|
color: #fff;
|
||||||
|
text-decoration: none;
|
||||||
|
font-size: 1.2rem;
|
||||||
|
font-weight: 600;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
text-align: left;
|
||||||
|
padding: 0.5rem 1rem;
|
||||||
|
border: none;
|
||||||
|
border-bottom: 1px solid #333d43;
|
||||||
|
background: none;
|
||||||
|
cursor: pointer;
|
||||||
|
font-family: inherit;
|
||||||
|
}
|
||||||
|
|
||||||
.nav__mobile-submenu {
|
.nav__mobile-submenu {
|
||||||
display: block;
|
display: block;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
|
|||||||
+12
-4
@@ -28,7 +28,12 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
<?php if (isset($_SESSION['user'])): ?>
|
<?php if (isset($_SESSION['user'])): ?>
|
||||||
|
|
||||||
<li><a href="index.php?pfad=profile">Profil</a></li>
|
<li><a href="index.php?pfad=profile">Profil</a></li>
|
||||||
<li><a href="index.php?pfad=logout">Abmelden</a></li>
|
<li>
|
||||||
|
<form method="post" action="php/controller/logout-controller.php" class="nav__logout-form">
|
||||||
|
<?php csrf_field(); ?>
|
||||||
|
<button type="submit" class="nav__mobile-logout-button">Abmelden</button>
|
||||||
|
</form>
|
||||||
|
</li>
|
||||||
<li><a href="index.php?pfad=createArticle">Beitrag erstellen</a></li>
|
<li><a href="index.php?pfad=createArticle">Beitrag erstellen</a></li>
|
||||||
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
@@ -158,9 +163,12 @@ Globales Menü, wird via PHP später in alle Seiten eingebunden
|
|||||||
Beitrag erstellen
|
Beitrag erstellen
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="index.php?pfad=logout" class="nav__item nav__button">
|
<form method="post" action="php/controller/logout-controller.php" class="nav__logout-form">
|
||||||
Abmelden
|
<?php csrf_field(); ?>
|
||||||
</a>
|
<button type="submit" class="nav__item nav__button">
|
||||||
|
Abmelden
|
||||||
|
</button>
|
||||||
|
</form>
|
||||||
|
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user