forked from enviPath/enviPy
refactor: add public_mode for static pages to remove nav elements
This commit is contained in:
@ -350,6 +350,14 @@ LOGIN_EXEMPT_URLS = [
|
|||||||
"/password_reset/",
|
"/password_reset/",
|
||||||
"/reset/",
|
"/reset/",
|
||||||
"/microsoft/",
|
"/microsoft/",
|
||||||
|
"/terms",
|
||||||
|
"/privacy",
|
||||||
|
"/cookie-policy",
|
||||||
|
"/about",
|
||||||
|
"/contact",
|
||||||
|
"/jobs",
|
||||||
|
"/cite",
|
||||||
|
"/legal",
|
||||||
]
|
]
|
||||||
|
|
||||||
# MS AD/Entra
|
# MS AD/Entra
|
||||||
|
|||||||
@ -118,6 +118,7 @@
|
|||||||
{% include "includes/footer.html" %}
|
{% include "includes/footer.html" %}
|
||||||
|
|
||||||
{# Floating Help Tab #}
|
{# Floating Help Tab #}
|
||||||
|
{% if not public_mode %}
|
||||||
<div class="fixed right-0 top-1/2 -translate-y-1/2 z-50">
|
<div class="fixed right-0 top-1/2 -translate-y-1/2 z-50">
|
||||||
<a href="https://community.envipath.org/" target="_blank"
|
<a href="https://community.envipath.org/" target="_blank"
|
||||||
class="flex items-center justify-center btn btn-secondary hover:btn-secondary-focus text-secondary-content text-sm shadow-lg transition-all duration-300 hover:scale-105 hover:-translate-x-1"
|
class="flex items-center justify-center btn btn-secondary hover:btn-secondary-focus text-secondary-content text-sm shadow-lg transition-all duration-300 hover:scale-105 hover:-translate-x-1"
|
||||||
@ -127,6 +128,7 @@
|
|||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# Modals - TODO: Convert these to DaisyUI modals #}
|
{# Modals - TODO: Convert these to DaisyUI modals #}
|
||||||
{% block modals %}
|
{% block modals %}
|
||||||
|
|||||||
@ -9,6 +9,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{% if not public_mode %}
|
||||||
<div class="navbar-center hidden lg:flex">
|
<div class="navbar-center hidden lg:flex">
|
||||||
<a href="#" role="button" class="btn btn-ghost" id="predictLink">Predict</a>
|
<a href="#" role="button" class="btn btn-ghost" id="predictLink">Predict</a>
|
||||||
<!-- <li><a href="{{ meta.server_url }}/package" id="packageLink">Package</a></li> -->
|
<!-- <li><a href="{{ meta.server_url }}/package" id="packageLink">Package</a></li> -->
|
||||||
@ -25,16 +26,19 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<div class="navbar-end">
|
<div class="navbar-end">
|
||||||
|
{% if not public_mode %}
|
||||||
<a href="/search" role="button" >
|
<a href="/search" role="button" >
|
||||||
<div class="flex items-center badge badge-dash space-x-1 bg-base-200 text-base-content/50 p-2 m-1">
|
<div class="flex items-center badge badge-dash space-x-1 bg-base-200 text-base-content/50 p-2 m-1">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search-icon lucide-search"><path d="m21 21-4.34-4.34"/><circle cx="11" cy="11" r="8"/></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search-icon lucide-search"><path d="m21 21-4.34-4.34"/><circle cx="11" cy="11" r="8"/></svg>
|
||||||
<span id="search-shortcut">⌘K</span>
|
<span id="search-shortcut">⌘K</span>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
{% if meta.user.username == 'anonymous' %}
|
{% endif %}
|
||||||
<li><a href="{% url 'login' %}" id="loginButton">Login</a></li>
|
{% if meta.user.username == 'anonymous' or public_mode %}
|
||||||
|
<a href="{% url 'login' %}" id="loginButton" class="p-2">Login</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="dropdown dropdown-end">
|
<div class="dropdown dropdown-end">
|
||||||
<div tabindex="0" role="button" class="btn btn-ghost m-1 btn-circle" id="loggedInButton">
|
<div tabindex="0" role="button" class="btn btn-ghost m-1 btn-circle" id="loggedInButton">
|
||||||
@ -42,7 +46,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul tabindex="-1" class="dropdown-content menu bg-base-100 rounded-box z-50 w-52 p-2 shadow-sm">
|
<ul tabindex="-1" class="dropdown-content menu bg-base-100 rounded-box z-50 w-52 p-2 shadow-sm">
|
||||||
<li><a href="{{ meta.user.url }}" id="accountbutton">Settings</a></li>
|
<li><a href="{{ meta.user.url }}" id="accountbutton">Settings</a></li>
|
||||||
<li><a href="{% url 'logout' %}" id="logoutButton">Logout</a></li>
|
<li>
|
||||||
|
<form id="logoutForm" action="{% url 'logout' %}" method="post" style="display: none;">
|
||||||
|
{% csrf_token %}
|
||||||
|
<input type="hidden" name="logout" value="true">
|
||||||
|
</form>
|
||||||
|
<a href="#" id="logoutButton" onclick="event.preventDefault(); document.getElementById('logoutForm').submit();">Logout</a>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user