Files
e-cosplay/templates/artemis/base.twig

117 lines
6.1 KiB
Twig
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mainframe - {% block title %}{% endblock %}</title>
<meta name="robots" content="noindex">
{{ vite_asset('admin.js',[]) }}
<style>
/* Custom styles */
body {
font-family: 'Inter', sans-serif;
}
/* Custom scrollbar for webkit browsers */
.sidebar-scroll::-webkit-scrollbar {
width: 4px;
}
.sidebar-scroll::-webkit-scrollbar-track {
background-color: #1f2937;
}
.sidebar-scroll::-webkit-scrollbar-thumb {
background-color: #4b5563;
border-radius: 20px;
}
</style>
</head>
<body class="bg-gray-100 dark:bg-gray-900 text-gray-900 dark:text-gray-100">
<div class="flex h-screen bg-gray-100 dark:bg-gray-900">
<!-- Sidebar -->
<aside id="sidebar" class="fixed top-0 left-0 z-40 w-64 h-screen bg-white dark:bg-gray-800 shadow-lg transform -translate-x-full md:translate-x-0 transition-transform duration-300 ease-in-out">
<div class="flex items-center justify-center h-20 border-b dark:border-gray-700">
<h1 class="text-2xl font-bold ml-2">Mainframe</h1>
</div>
<nav class="mt-4 flex-1 sidebar-scroll overflow-y-auto" style="height: calc(100vh - 80px);">
<ul>
<!-- Dashboard Link -->
<li class="px-4 py-2">
<a href="{{ path('artemis_dashboard') }}" class="flex items-center p-2 text-base font-normal text-gray-900 dark:text-white {% if app.request.get('_route') == "artemis_dashboard"%}bg-gray-200 dark:bg-gray-700{% endif%} rounded-lg">
<svg class="w-6 h-6 text-gray-500 dark:text-gray-400" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M2 10a8 8 0 018-8v8h8a8 8 0 11-16 0z"></path><path d="M12 2.252A8.014 8.014 0 0117.748 12H12V2.252z"></path></svg>
<span class="ml-3">Tableau de bord</span>
</a>
</li>
</ul>
</nav>
</aside>
<!-- Main content -->
<div class="flex flex-col flex-1 md:ml-64 transition-all duration-300 ease-in-out">
<!-- Header -->
<header class="flex items-center justify-between h-20 px-6 bg-white dark:bg-gray-800 border-b dark:border-gray-700">
<button id="sidebar-toggle" class="text-gray-500 dark:text-gray-400 focus:outline-none focus:text-gray-600 dark:focus:text-gray-300 md:hidden">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
</button>
<div class="relative w-full max-w-md md:ml-0 ml-4">
<span class="absolute inset-y-0 left-0 flex items-center pl-3">
<svg class="w-5 h-5 text-gray-400" viewBox="0 0 24 24" fill="none"><path d="M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></svg>
</span>
<input type="text" class="w-full py-2 pl-10 pr-4 text-gray-700 bg-white border rounded-md dark:bg-gray-900 dark:text-gray-300 dark:border-gray-600 focus:border-blue-500 dark:focus:border-blue-500 focus:outline-none focus:ring" placeholder="Recherchée">
</div>
<div class="flex items-center">
<div class="relative">
<a href="{{ path('artemis_profils') }}" class="relative z-10 block w-8 h-8 overflow-hidden rounded-full shadow focus:outline-none">
{% if app.user.avatarOriginalName is defined and app.user.avatarOriginalName is not empty %}
<img src="{{ vich_uploader_asset(app.user,'avatar') | imagine_filter('webp') }}" alt="Avatar de {{ app.user.username }}" class="object-cover w-full h-full">
{% else %}
<img src="{{ path('artemis_avatar') }}" alt="Avatar de {{ app.user.username }}" class="object-cover w-full h-full">
{% endif %}
</a>
</div>
</div>
<div id="flash-messages-container" class="absolute top-4 right-4 z-50 space-y-2 w-full max-w-xs">
{# This block demonstrates how Symfony flash messages would be displayed. #}
{# They are typically set in your Symfony controller and then iterated over in Twig. #}
{% for label, messages in app.flashes %}
{% for message in messages %}
<div class="p-4 rounded-lg shadow-md flex items-center justify-between transition-opacity duration-300
{% if label == 'success' %} bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100
{% elseif label == 'error' %} bg-red-100 text-red-800 dark:bg-red-800 dark:text-red-100
{% elseif label == 'warning' %} bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100
{% else %} bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100
{% endif %}">
<span>{{ message }}</span>
</div>
{% endfor %}
{% endfor %}
</div>
</header>
<!-- Content -->
<main class="flex-1 p-6 overflow-y-auto">
{% block content %}
{% endblock %}
</main>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
const sidebar = document.getElementById('sidebar');
const sidebarToggle = document.getElementById('sidebar-toggle');
sidebarToggle.addEventListener('click', function () {
sidebar.classList.toggle('-translate-x-full');
});
});
</script>
</body>
</html>