132 lines
5.7 KiB
HTML
132 lines
5.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{% block title %}J621{% endblock %}</title>
|
|
{% load static %}
|
|
|
|
<link rel="stylesheet" href="{% static 'css/style.css' %}">
|
|
{% block extra_head %}{% endblock %}
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet">
|
|
<!-- Font Awesome 7 (free) -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css">
|
|
<link rel="icon" type="image/png" href="{% static 'logo.png' %}">
|
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
|
<script src="{% static 'js/follow_common.js' %}"></script>
|
|
</head>
|
|
<body>
|
|
<div class="app-bar">
|
|
<div class="app-bar-title">
|
|
{% block app_bar_logo %}
|
|
<img src="{% static 'logo.png' %}" alt="j621 Gallery" height="32">
|
|
{% endblock %}
|
|
</div>
|
|
<nav class="app-bar-nav">
|
|
<!-- Desktop version (visible on wider screens) -->
|
|
<span class="version-badge desktop-version">
|
|
<i class="fas fa-tag"></i> {{ APP_ENV }}
|
|
<span class="separator">•</span>
|
|
<i class="fas fa-code-branch"></i> {{ GIT_COMMIT_HASH }}
|
|
<span class="separator">•</span>
|
|
<i class="{{ OS_ICON }}"></i> {{ OS_NAME }}
|
|
<span class="separator">•</span>
|
|
<i class="fas fa-clock"></i> {{ PAGE_GEN_TIME }}
|
|
</span>
|
|
|
|
<!-- Mobile version (visible on small screens) -->
|
|
<span class="version-badge mobile-version">
|
|
<i class="fas fa-code-branch"></i> {{ APP_ENV|slice:":1"|upper }}
|
|
<i class="{{ OS_ICON }}" style="margin-left: 4px;"></i>
|
|
</span>
|
|
<a href="{% url 'index' %}">
|
|
<i class="fas fa-home"></i><span class="nav-text"> Library</span>
|
|
</a>
|
|
</nav>
|
|
</div>
|
|
<main class="main-content">
|
|
{% block content %}{% endblock %}
|
|
</main>
|
|
|
|
{% if user.is_authenticated %}
|
|
<div class="user-bar">
|
|
<div class="user-avatar" onclick="toggleUserMenu()">
|
|
{% if user.userprofile.avatar_md5 %}
|
|
<img src="{% url 'serve_thumbnail' user.userprofile.avatar_md5 %}" alt="Avatar">
|
|
{% else %}
|
|
<div class="default-avatar">{{ user.username|first|upper }}</div>
|
|
{% endif %}
|
|
</div>
|
|
<div class="user-menu" id="user-menu">
|
|
<a href="{% url 'edit_profile' %}" class="user-edit">
|
|
<i class="fas fa-user-circle"></i> {{ user.username }}
|
|
{% if user.userprofile.e621_username %}
|
|
<span class="e621-user">({{ user.userprofile.e621_username }})</span>
|
|
{% endif %}
|
|
</a>
|
|
<div class="user-info"></div>
|
|
<a href="{% url 'upload_page' %}">
|
|
<i class="fas fa-upload"></i> Upload
|
|
</a>
|
|
<a href="{% url 'duplicates_page' %}">
|
|
<i class="fas fa-copy"></i> Duplicates
|
|
</a>
|
|
<a href="{% url 'delete_page' %}">
|
|
<i class="fas fa-trash-alt"></i> Delete
|
|
</a>
|
|
<a href="{% url 'follows:followed_tags' %}">
|
|
<i class="fa-solid fa-tags"></i> Followed Tags
|
|
</a>
|
|
<a href="{% url 'follows:followed_pools' %}">
|
|
<i class="fa-solid fa-boxes-stacked"></i> Followed Pools
|
|
</a>
|
|
{% if user.is_staff %}
|
|
<a href="{% url 'admin:index' %}">
|
|
<i class="fas fa-shield-alt"></i> Admin
|
|
</a>
|
|
<a href="{% url 'common:stats_dashboard' %}">
|
|
<i class="fa-solid fa-chart-bar"></i> Stats
|
|
</a>
|
|
{% endif %}
|
|
<form method="post" action="{% url 'logout' %}" style="display: inline;">
|
|
{% csrf_token %}
|
|
<button type="submit" class="logout-button">
|
|
<i class="fas fa-sign-out-alt"></i> Logout
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function toggleUserMenu() {
|
|
const menu = document.getElementById('user-menu');
|
|
menu.style.display = menu.style.display === 'block' ? 'none' : 'block';
|
|
}
|
|
document.addEventListener('click', (e) => {
|
|
if (!e.target.closest('.user-bar')) {
|
|
document.getElementById('user-menu').style.display = 'none';
|
|
}
|
|
});
|
|
function getCookie(name) {
|
|
let cookieValue = null;
|
|
if (document.cookie && document.cookie !== '') {
|
|
const cookies = document.cookie.split(';');
|
|
for (let i = 0; i < cookies.length; i++) {
|
|
const cookie = cookies[i].trim();
|
|
if (cookie.substring(0, name.length + 1) === (name + '=')) {
|
|
cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
return cookieValue;
|
|
}
|
|
</script>
|
|
{% else %}
|
|
<div class="auth-bar">
|
|
<a href="{% url 'login' %}"><i class="fas fa-sign-in-alt"></i> Login</a> |
|
|
<a href="{% url 'register' %}"><i class="fas fa-user-plus"></i> Register</a>
|
|
</div>
|
|
{% endif %}
|
|
{% block extra_js %}{% endblock %}
|
|
</body>
|
|
</html> |