still some bugs and auth issues to iron out. need to implement a new action button/bar, the card for moments in a space, creating new moments and essays, dynamically refreshing the spaces view when a new post is created.

This commit is contained in:
2025-05-20 19:46:09 -06:00
parent a93c30c40f
commit 54a01f0f1f
20 changed files with 1018 additions and 1191 deletions
+21 -18
View File
@@ -2,24 +2,24 @@
$current_page = $_SERVER['SCRIPT_NAME'];
$nav = '
<nav>
<div class="row_space_between no_margin">
<div class="row space_between no_margin full_width">
<div class="site_navigation">
<ul>
<li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li>
<li><a href="/spaces.php?view=displaySpaces"' . ($current_page == '/spaces.php' ? ' class="underline"' : '') . '>Spaces</a></li>
<li><a href="/spaces.php?view=list"' . ($current_page == '/spaces.php' ? ' class="underline"' : '') . '>Spaces</a></li>
';
/* <li><a href="/index.php"' . ($current_page == '/index.php' ? ' class="underline"' : '') . '>Home</a></li> */
if (isset($_SESSION['user'])) {
$nav .= '
<li><a href="/user.php?view=display&user_id=' . $_SESSION['user_id'] . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li>
<li><a href="/todo.php?view=display"' . ($current_page == '/todo.php' ? ' class="underline"' : '') . '>Todos</a></li>
';
/* $nav .= ' */
/* <li><a href="/user.php?view=display&user_id=' . unserialize($_SESSION['user'])->getId() . '"' . ($current_page == '/user.php' ? ' class="underline"' : '') . '>Account</a></li> */
/* <li><a href="/todo.php?view=display"' . ($current_page == '/todo.php' ? ' class="underline"' : '') . '>Todos</a></li> */
/* '; */
if ($_SESSION['user'] <= developer) {
$nav .= '
if (unserialize($_SESSION['user'])->getRole() <= developer) {
$nav .= '
<li><a href="/admin.php?view=users"' . ($current_page == '/admin.php' ? ' class="underline"' : '') . '>Admin</a></li>
';
}
}
}
$nav .= '
@@ -31,23 +31,23 @@ $nav .= '
$theme_toggle = '';
if ($_SESSION['theme'] == 'dark')
$theme_toggle = 'light';
$theme_toggle = 'light';
else
$theme_toggle = 'dark';
$theme_toggle = 'dark';
$nav .= '
<button id="theme_toggle" value="' . $theme_toggle . '" name="theme"><i class="nf ' . ($theme_toggle == 'dark' ? 'nf-oct-moon' : 'nf-oct-sun') . '"></i></button>
</form>
';
if (isset($_SESSION['username'])) {
$nav .= '
<a href="user.php?view=logout">Log Out</a>
if (isset($_SESSION['user'])) {
$nav .= '
<p class="link underline" id="logout">Log Out</p>
';
} else {
$nav .= '
<a href="user.php?view=login">Login</a>
<a href="user.php?view=signup">Sign Up</a>
$nav .= '
<p class="link underline" id="login">Login</p>
<p class="link underline" id="signup">Sign Up</p>
';
}
@@ -56,7 +56,10 @@ $nav .= '
</div>
<script src="js/nav.js" defer></script>
<script src="js/login.js" defer></script>
</nav>
<div id="notificationModal"></div>
<div id="stdModal"></div>
';
echo $nav;