implemented ui functions for managing products, uploading images and editiing users
This commit is contained in:
@ -33,15 +33,43 @@
|
||||
</div>-->
|
||||
</div>
|
||||
|
||||
<% /* <div class="navbar-end">
|
||||
<div class="navbar-item">
|
||||
<div class="buttons">
|
||||
<a class="button is-primary">
|
||||
<strong>Sign up</strong>
|
||||
</a>
|
||||
<a class="button is-light">Log in</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<div class="navbar-item is-hidden" id="showOnLogin">
|
||||
<strong>Hey, <span id="nav_username"></span></strong>
|
||||
<button class="button" onclick="window.location='/pay_up'" >Zur Abrechnung</button>
|
||||
</div>
|
||||
</div> */ %>
|
||||
<div class="navbar-item is-hidden" id="onlyShowRoot">
|
||||
<button class="button" onclick="window.location='/admin/'" >Zur Administration</button>
|
||||
</div>
|
||||
<div class="navbar-item is-hidden" id="onlyShowAdmin">
|
||||
<button class="button" onclick="window.location='/admin/'" >Zur Administration</button>
|
||||
<button class="button" onclick="window.location='/'" >Abmelden</button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// Check if ?user is set
|
||||
if (window.location.search.includes('user')) {
|
||||
// Show the sign up button
|
||||
document.querySelector('#showOnLogin').classList.remove('is-hidden');
|
||||
// Get the username from the cookie
|
||||
username = document.cookie.split('; ').find(row => row.startsWith('name')).split('=')[1];
|
||||
// Set the username in the nav
|
||||
document.getElementById('nav_username').innerText = username;
|
||||
}
|
||||
|
||||
// Check if /user_select is the current page
|
||||
if (window.location.pathname == '/user_select') {
|
||||
// Show the sign up button
|
||||
document.querySelector('#onlyShowRoot').classList.remove('is-hidden');
|
||||
}
|
||||
|
||||
// If admin is contained in url
|
||||
if (window.location.pathname.includes('admin')) {
|
||||
// Show the sign up button
|
||||
document.querySelector('#onlyShowAdmin').classList.remove('is-hidden');
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</div>
|
||||
</nav>
|
||||
|
Reference in New Issue
Block a user