Merge branch 'feature/Lerninhalte_Verlinkungen' into 'dev'
Button für Weiterleitung zur Bearbeitungsseite hinzugefügt See merge request eb2342s/swe-b1-a!20
This commit was merged in pull request #80.
This commit is contained in:
@@ -28,32 +28,41 @@
|
||||
session_start();
|
||||
if (isset($_SESSION['user']) && $_SESSION['user']->isLoggedIn()) {
|
||||
?>
|
||||
<div class="relative">
|
||||
<!-- Dropdown Trigger -->
|
||||
<button id="userDropdownToggle"
|
||||
<div class="flex items-center space-x-4">
|
||||
<!-- Dropdown Button Elemente -->
|
||||
<div class="relative">
|
||||
<!-- Dropdown Trigger -->
|
||||
<button id="userDropdownToggle"
|
||||
class="bg-[var(--primary-color)] text-white px-4 py-2 rounded-lg hover:bg-[var(--accent-color)] transition duration-300 flex items-center">
|
||||
<span><?php echo htmlspecialchars($_SESSION['user']->getUsername()); ?></span>
|
||||
<i class="fas fa-chevron-down ml-2"></i>
|
||||
</button>
|
||||
|
||||
<!-- Dropdown Menu -->
|
||||
<div id="userDropdownMenu"
|
||||
class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border">
|
||||
<a href="account.php"
|
||||
class="block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-t-lg flex items-center">
|
||||
<i class="fas fa-user mr-2"></i> Accountseite
|
||||
</a>
|
||||
<button id="dropdownChangePasswordButton"
|
||||
class="block w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100 flex items-center">
|
||||
<i class="fas fa-key mr-2"></i> Passwort ändern
|
||||
<span><?php echo htmlspecialchars($_SESSION['user']->getUsername()); ?></span>
|
||||
<i class="fas fa-chevron-down ml-2"></i>
|
||||
</button>
|
||||
<form id="dropdownLogoutForm" action="logout.php" method="POST" class="block">
|
||||
<button type="submit"
|
||||
class="w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-b-lg flex items-center">
|
||||
<i class="fas fa-sign-out-alt mr-2"></i> Logout
|
||||
|
||||
<!-- Dropdown Menu -->
|
||||
<div id="userDropdownMenu"
|
||||
class="hidden absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-lg border">
|
||||
<!-- TODO: Accountseite entsprechend verlinken -->
|
||||
<a href="index.php"
|
||||
class="block px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-t-lg flex items-center">
|
||||
<i class="fas fa-user mr-2"></i> Accountseite
|
||||
</a>
|
||||
<button id="dropdownChangePasswordButton"
|
||||
class="block w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100 flex items-center">
|
||||
<i class="fas fa-key mr-2"></i> Passwort ändern
|
||||
</button>
|
||||
</form>
|
||||
<form id="dropdownLogoutForm" action="logout.php" method="POST" class="block">
|
||||
<button type="submit"
|
||||
class="w-full text-left px-4 py-2 text-gray-700 hover:bg-gray-100 rounded-b-lg flex items-center">
|
||||
<i class="fas fa-sign-out-alt mr-2"></i> Logout
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bearbeiten Button --> <!-- TODO: Korrekte/dynamische Verlinkung implementieren -->
|
||||
<a href="index.php" class="bg-white text-[var(--primary-color)] border-2 border-[var(--primary-color)] w-10 h-10 flex items-center justify-center rounded-lg hover:bg-[var(--primary-color)] hover:text-white transition duration-300">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</a>
|
||||
</div>
|
||||
<?php
|
||||
} else {
|
||||
@@ -207,6 +216,7 @@ if (isset($_SESSION['user']) && $_SESSION['user']->isLoggedIn()) {
|
||||
});
|
||||
|
||||
|
||||
|
||||
// JavaScript to handle opening and closing of the change password popup
|
||||
const changePasswordButton = document.getElementById('changePasswordButton');
|
||||
const changePasswordPopup = document.getElementById('changePasswordPopup');
|
||||
|
||||
Reference in New Issue
Block a user