mirror of
https://github.com/Michatec/MiniFaceBook.git
synced 2026-03-31 23:46:30 +02:00
148 lines
8.7 KiB
HTML
148 lines
8.7 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="{{ get_locale() }}">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||
<title>{% block title %}MiniFacebook{% endblock %}</title>
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
|
||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css">
|
||
<link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
|
||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
|
||
<script src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||
<script src="{{ url_for('static', filename='js/translate.js') }}"></script>
|
||
<link rel="manifest" href="{{ url_for('static', filename='manifest.json') }}">
|
||
<meta name="theme-color" content="#2563eb">
|
||
<link rel="apple-touch-icon" href="{{ url_for('static', filename='icons/icon-192.png') }}">
|
||
<link rel="icon" href="{{ url_for('static', filename='icons/icon-192.png') }}">
|
||
<script>
|
||
if ('serviceWorker' in navigator) {
|
||
window.addEventListener('load', function() {
|
||
navigator.serviceWorker.register('{{ url_for('static', filename='js/sw.js') }}');
|
||
});
|
||
}
|
||
</script>
|
||
</head>
|
||
<body class="d-flex flex-column min-vh-100 {{ theme_class }}">
|
||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
||
<div class="container-fluid">
|
||
<a class="navbar-brand" href="{{ url_for('index') }}">
|
||
<i class="bi bi-people-fill me-2"></i>MiniFacebook
|
||
</a>
|
||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav"
|
||
aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
|
||
<span class="navbar-toggler-icon"></span>
|
||
</button>
|
||
<div class="collapse navbar-collapse" id="navbarNav">
|
||
<ul class="navbar-nav ms-auto">
|
||
{% if current_user.is_authenticated %}
|
||
{% if user.is_admin %}
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('admin.admin') }}"><i class="bi bi-shield-lock me-1"></i>{{ _('Admin Panel') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('admin.reset_requests') }}"><i class="bi bi-arrow-clockwise me-1"></i>{{ _('Reset Requests') }}</a></li>
|
||
{% endif %}
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('post.feed') }}"><i class="bi bi-house-door me-1"></i>{{ _('Feed') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('user.users') }}"><i class="bi bi-people me-1"></i>{{ _('Users') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('friend.friends') }}"><i class="bi bi-person-check me-1"></i>{{ _('Friends') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('profil.my_posts') }}"><i class="bi bi-file-earmark-text me-1"></i>{{ _('My Posts') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('notif.notifications') }}"><span class="badge bg-secondary" id="message_count">0</span><i class="bi bi-bell me-1"></i>{{ _('Notifications') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('profil.profile') }}"><i class="bi bi-person-circle me-1"></i>{{ _('Profile') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('log.logout') }}"><i class="bi bi-box-arrow-right me-1"></i>{{ _('Logout') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('support.support') }}"><i class="bi bi-question-circle me-1"></i>{{ _('Support') }}</a></li>
|
||
{% else %}
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('post.feed') }}"><i class="bi bi-house-door me-1"></i>{{ _('Feed') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('log.login') }}"><i class="bi bi-box-arrow-in-right me-1"></i>{{ _('Login') }}</a></li>
|
||
<li class="nav-item"><a class="nav-link" href="{{ url_for('log.register') }}"><i class="bi bi-person-plus me-1"></i>{{ _('Register') }}</a></li>
|
||
{% endif %}
|
||
<li class="nav-item">
|
||
<button id="toggle-theme" class="btn btn-outline-secondary btn-sm ms-2" type="button">
|
||
<span id="theme-icon" class="bi"></span> <span id="theme-label">{{ _('Theme') }}</span>
|
||
</button>
|
||
</li>
|
||
<li class="nav-item dropdown ms-2">
|
||
<button class="btn btn-outline-secondary btn-sm dropdown-toggle" type="button" id="langDropdown" data-bs-toggle="dropdown" aria-expanded="false">
|
||
<span id="lang-label">{% if get_locale() == 'de' %}Deutsch{% else %}English{% endif %}</span>
|
||
</button>
|
||
<ul class="dropdown-menu" aria-labelledby="langDropdown">
|
||
<li><a class="dropdown-item lang-select" href="#" data-lang="de">Deutsch</a></li>
|
||
<li><a class="dropdown-item lang-select" href="#" data-lang="en">English</a></li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</nav>
|
||
<div class="container flex-grow-1">
|
||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||
{% if messages %}
|
||
{% for category, message in messages %}
|
||
<div class="alert alert-{{ category }} mt-2">{{ message }}</div>
|
||
{% endfor %}
|
||
{% endif %}
|
||
{% endwith %}
|
||
<div class="d-flex align-items-center mb-3">
|
||
{% if user.profile_pic and user.profile_pic != 'default.png' %}
|
||
{% if user.profile_pic.startswith('http') %}
|
||
{% if SHOPITEM_ID_GOLDRAHMEN in user.shop_items | map(attribute='item_id') | list %}
|
||
<img src="{{ user.profile_pic }}" class="profile-pic me-2" style="border-color: gold;" alt="Profile Picture">
|
||
{% else %}
|
||
<img src="{{ user.profile_pic }}" class="profile-pic me-2" alt="Profile Picture">
|
||
{% endif %}
|
||
{% else %}
|
||
{% if SHOPITEM_ID_GOLDRAHMEN in user.shop_items | map(attribute='item_id') | list %}
|
||
<img src="{{ url_for('static', filename='profile_pics/' ~ user.profile_pic) }}" class="profile-pic me-2" style="border-color: gold;">
|
||
{% else %}
|
||
<img src="{{ url_for('static', filename='profile_pics/' ~ user.profile_pic) }}" class="profile-pic me-2">
|
||
{% endif %}
|
||
{% endif %}
|
||
{% endif %}
|
||
{% if user.is_authenticated %}
|
||
<h1>{{ _('Welcome, %(username)s!', username=user.username) }}</h1>
|
||
{% endif %}
|
||
</div>
|
||
{% if user.is_admin %}
|
||
<p class="text-success">{{ _('You are logged in as an admin.') }}</p>
|
||
{% endif %}
|
||
{% if user.is_authenticated %}
|
||
<span class="badge bg-secondary" id="check_notify">{{ _('You don’t have any notifications.') }}</span>
|
||
{% endif %}
|
||
{% if SHOPITEM_ID_PREMIUM in user.shop_items | map(attribute='item_id') | list %}
|
||
<span class="badge bg-warning text-dark"><i class="bi bi-star"></i> Premium</span>
|
||
{% endif %}
|
||
{% if user.is_authenticated %}
|
||
<hr>
|
||
{% endif %}
|
||
{% block content %}{% endblock %}
|
||
</div>
|
||
<footer class="footer mt-auto py-3">
|
||
<div class="container text-center">
|
||
<span class="text-muted">
|
||
© 2025 MiniFacebook ·
|
||
<a href="https://github.com/Michatec/MiniFaceBook" target="_blank" rel="noopener" class="text-decoration-none"><i class="bi bi-github m-1"></i>GitHub</a>
|
||
· <a href="{{ url_for('index') }}" class="text-decoration-none">{{ _('Home') }}</a>
|
||
· <a href="{{ url_for('credit.privacy_policy') }}" class="text-decoration-none">{{ _('Privacy Policy') }}</a>
|
||
· <a href="{{ url_for('credit.credits') }}" class="text-decoration-none">{{ _('Credits') }}</a>
|
||
</span>
|
||
</div>
|
||
</footer>
|
||
<script>
|
||
function set_message_count(n) {
|
||
$('#message_count').text(n);
|
||
$('#check_notify').text('{{ _("You have ") }}' + n + '{{ _(" new notification/s") }}');
|
||
}
|
||
{% if current_user.is_authenticated %}
|
||
$(function() {
|
||
setInterval(function() {
|
||
$.ajax("{{ url_for('notif.notifications_api') }}").done(
|
||
function(notifications) {
|
||
for (var i = 0; i < notifications.length; i++) {
|
||
set_message_count(i + 1);
|
||
}
|
||
}
|
||
);
|
||
}, 1000);
|
||
});
|
||
{% endif %}
|
||
</script>
|
||
</body>
|
||
</html>
|