2024-09-02 14:31:50 +02:00
|
|
|
<template>
|
2024-09-10 08:49:09 +02:00
|
|
|
<button
|
|
|
|
|
@click="toggleExpand()"
|
2024-09-10 18:07:43 +02:00
|
|
|
class="btn btn--white | rounded-xl"
|
2024-09-10 08:49:09 +02:00
|
|
|
aria-controls="menu"
|
|
|
|
|
:aria-expanded="isExpanded"
|
|
|
|
|
>
|
|
|
|
|
<svg
|
|
|
|
|
aria-labelledby="menu-toggle"
|
|
|
|
|
class="icon"
|
|
|
|
|
width="20"
|
|
|
|
|
height="20"
|
|
|
|
|
viewBox="0 0 20 20"
|
|
|
|
|
fill="none"
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
>
|
|
|
|
|
<title id="menu-toggle">
|
|
|
|
|
{{ isExpanded ? "Masquer le menu" : "Afficher le menu" }}
|
|
|
|
|
</title>
|
|
|
|
|
<path
|
|
|
|
|
d="M10.6751 2.625L3.00007 10.3125C2.94028 10.3686 2.89263 10.4364 2.86005 10.5116C2.82748 10.5869 2.81067 10.668 2.81067 10.75C2.81067 10.832 2.82748 10.9131 2.86005 10.9884C2.89263 11.0636 2.94028 11.1314 3.00007 11.1875L10.6751 18.875M17.1876 2.625L9.50007 10.3125C9.38555 10.4293 9.32141 10.5864 9.32141 10.75C9.32141 10.9136 9.38555 11.0707 9.50007 11.1875L17.1876 18.875"
|
|
|
|
|
stroke="currentColor"
|
|
|
|
|
stroke-width="1.25"
|
|
|
|
|
stroke-linecap="round"
|
|
|
|
|
stroke-linejoin="round"
|
|
|
|
|
/>
|
2024-09-04 18:55:21 +02:00
|
|
|
</svg>
|
|
|
|
|
</button>
|
2024-09-10 18:07:43 +02:00
|
|
|
<div v-if="isExpanded" id="menu" class="flex | rounded-xl">
|
2024-09-04 18:55:21 +02:00
|
|
|
<header class="w-full | flex">
|
2024-11-20 15:24:34 +01:00
|
|
|
<!-- TODO: à dynamiser en récupérant le $site->title() -->
|
2024-11-21 18:31:17 +01:00
|
|
|
<p lang="en">Design to Pack</p>
|
2024-09-04 18:55:21 +02:00
|
|
|
</header>
|
|
|
|
|
<nav class="w-full | flow">
|
|
|
|
|
<ul class="flex">
|
2024-09-10 08:49:09 +02:00
|
|
|
<li
|
|
|
|
|
v-for="mainItem in mainItems"
|
2024-09-10 15:40:43 +02:00
|
|
|
:data-icon="mainItem.icon"
|
2024-09-10 08:49:09 +02:00
|
|
|
:key="mainItem.path"
|
2024-11-19 16:04:35 +01:00
|
|
|
:class="{ active: isCurrent(mainItem), disabled: mainItem.disabled }"
|
2024-09-10 08:49:09 +02:00
|
|
|
>
|
2024-09-17 17:03:13 +02:00
|
|
|
<router-link
|
|
|
|
|
:to="mainItem.path"
|
|
|
|
|
:aria-current="isCurrent(mainItem)"
|
|
|
|
|
>{{ mainItem.title }}</router-link
|
|
|
|
|
>
|
2024-11-22 17:16:58 +01:00
|
|
|
<span
|
2024-11-22 17:38:23 +01:00
|
|
|
v-if="mainItem.title === 'Inspirations' && page?.newInspirations"
|
2024-11-22 17:16:58 +01:00
|
|
|
class="pill pill--secondary"
|
|
|
|
|
>{{ "Nouveautés" }}</span
|
|
|
|
|
>
|
2024-09-04 18:55:21 +02:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
2024-11-11 17:12:26 +01:00
|
|
|
<details v-if="currentProjects.length" open>
|
2024-09-04 18:55:21 +02:00
|
|
|
<summary>Projets en cours</summary>
|
|
|
|
|
<ul>
|
2024-11-19 17:06:57 +01:00
|
|
|
<li
|
|
|
|
|
v-for="project in currentProjects"
|
|
|
|
|
:class="{ active: isCurrent(project) }"
|
|
|
|
|
>
|
2024-12-04 15:09:22 +01:00
|
|
|
<router-link
|
|
|
|
|
:to="project.uri"
|
|
|
|
|
:class="hasUnreadNotification(project) ? 'new' : undefined"
|
|
|
|
|
>{{ project.title }}</router-link
|
|
|
|
|
>
|
2024-09-10 09:16:46 +02:00
|
|
|
</li>
|
2024-09-04 18:55:21 +02:00
|
|
|
</ul>
|
|
|
|
|
</details>
|
2024-11-11 17:12:26 +01:00
|
|
|
<details v-if="archivedProjects.length">
|
2024-09-04 18:55:21 +02:00
|
|
|
<summary>Projets archivés</summary>
|
|
|
|
|
<ul>
|
2024-11-19 17:06:57 +01:00
|
|
|
<li
|
|
|
|
|
v-for="project in archivedProjects"
|
|
|
|
|
:class="{ active: isCurrent(project) }"
|
|
|
|
|
>
|
2024-12-04 15:09:22 +01:00
|
|
|
<router-link :to="project.uri">{{ project.title }}</router-link>
|
2024-09-10 09:16:46 +02:00
|
|
|
</li>
|
2024-09-04 18:55:21 +02:00
|
|
|
</ul>
|
|
|
|
|
</details>
|
|
|
|
|
</nav>
|
|
|
|
|
<footer class="w-full">
|
|
|
|
|
<ul class="flex">
|
2024-11-21 18:19:14 +01:00
|
|
|
<li data-icon="user" v-if="user?.role !== 'client'">
|
2024-09-17 17:03:13 +02:00
|
|
|
<router-link to="/profil">Profil</router-link>
|
2024-09-04 18:55:21 +02:00
|
|
|
</li>
|
|
|
|
|
<li data-icon="logout">
|
2024-10-28 15:55:14 +01:00
|
|
|
<a href="/logout">Déconnexion</a>
|
2024-09-04 18:55:21 +02:00
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
</footer>
|
|
|
|
|
</div>
|
2024-09-02 14:31:50 +02:00
|
|
|
</template>
|
2024-09-02 21:18:25 +02:00
|
|
|
|
2024-09-10 08:49:09 +02:00
|
|
|
<script setup>
|
2024-09-10 09:16:46 +02:00
|
|
|
import { storeToRefs } from "pinia";
|
2024-09-10 08:49:09 +02:00
|
|
|
import { ref } from "vue";
|
2024-09-10 09:16:46 +02:00
|
|
|
import { useProjectsStore } from "../stores/projects";
|
2024-09-17 17:03:13 +02:00
|
|
|
import { useRoute } from "vue-router";
|
2024-11-21 18:14:34 +01:00
|
|
|
import { useUserStore } from "../stores/user";
|
2024-11-22 17:16:58 +01:00
|
|
|
import { usePageStore } from "../stores/page";
|
2024-09-10 08:49:09 +02:00
|
|
|
|
2024-09-17 17:03:13 +02:00
|
|
|
const route = useRoute();
|
2024-09-10 08:49:09 +02:00
|
|
|
const isExpanded = ref(true);
|
2024-11-21 18:19:14 +01:00
|
|
|
const { user } = storeToRefs(useUserStore());
|
2024-09-10 09:16:46 +02:00
|
|
|
const { currentProjects, archivedProjects } = storeToRefs(useProjectsStore());
|
2024-11-22 17:16:58 +01:00
|
|
|
const { page } = storeToRefs(usePageStore());
|
2024-09-10 08:49:09 +02:00
|
|
|
|
|
|
|
|
const mainItems = [
|
|
|
|
|
{
|
|
|
|
|
title: "Home",
|
|
|
|
|
path: "/",
|
|
|
|
|
icon: "home",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Notifications",
|
|
|
|
|
path: "/notifications",
|
|
|
|
|
icon: "megaphone",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Réunions",
|
|
|
|
|
path: "/reunions",
|
|
|
|
|
icon: "calendar",
|
2024-11-18 15:27:41 +01:00
|
|
|
disabled: true,
|
2024-09-10 08:49:09 +02:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "Inspirations",
|
|
|
|
|
path: "/inspirations",
|
2024-09-10 15:40:43 +02:00
|
|
|
icon: "inspiration",
|
2024-09-10 08:49:09 +02:00
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
function toggleExpand() {
|
|
|
|
|
isExpanded.value = !isExpanded.value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isCurrent(navItem) {
|
2024-11-19 17:06:57 +01:00
|
|
|
if (navItem.path) {
|
|
|
|
|
return navItem.path === route.path;
|
|
|
|
|
}
|
|
|
|
|
if (navItem.uri) {
|
|
|
|
|
return navItem.uri === route.path;
|
|
|
|
|
}
|
2024-09-10 08:49:09 +02:00
|
|
|
}
|
2024-12-04 15:09:22 +01:00
|
|
|
|
|
|
|
|
function hasUnreadNotification(project) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2024-09-10 08:49:09 +02:00
|
|
|
</script>
|
2024-09-02 21:18:25 +02:00
|
|
|
|
2024-11-20 15:24:34 +01:00
|
|
|
<style>
|
2024-09-04 18:55:21 +02:00
|
|
|
button[aria-controls="menu"] {
|
2024-09-09 20:05:47 +02:00
|
|
|
position: fixed;
|
2024-11-21 18:27:25 +01:00
|
|
|
z-index: 101;
|
2024-09-04 18:55:21 +02:00
|
|
|
width: 2.5rem;
|
|
|
|
|
height: 2.5rem;
|
|
|
|
|
}
|
|
|
|
|
button[aria-controls="menu"] svg {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
}
|
|
|
|
|
button[aria-controls="menu"][aria-expanded="true"] {
|
|
|
|
|
margin-top: 1rem;
|
|
|
|
|
padding: 0.625rem; /* 10px */
|
|
|
|
|
left: var(--gutter);
|
|
|
|
|
transform: translateX(calc(var(--sidebar-width) - 100% - 1rem));
|
|
|
|
|
}
|
|
|
|
|
button[aria-controls="menu"][aria-expanded="false"] {
|
2024-09-17 17:23:39 +02:00
|
|
|
min-width: 3.5rem;
|
|
|
|
|
min-height: 3.5rem;
|
|
|
|
|
padding: 1.125rem;
|
2024-09-04 18:55:21 +02:00
|
|
|
transform: rotate(180deg);
|
|
|
|
|
}
|
2024-11-22 17:16:58 +01:00
|
|
|
button[aria-controls="menu"][aria-expanded="false"]
|
|
|
|
|
+ main
|
|
|
|
|
> header:not([role="tablist"]) {
|
2024-11-20 15:24:34 +01:00
|
|
|
margin-left: 4rem;
|
2024-12-11 12:01:07 +01:00
|
|
|
width: calc(100% - 4rem);
|
2024-11-20 15:24:34 +01:00
|
|
|
}
|
2024-09-04 18:55:21 +02:00
|
|
|
|
|
|
|
|
/* Menu */
|
|
|
|
|
|
|
|
|
|
#menu {
|
|
|
|
|
--flow-space: var(--space-32);
|
2024-09-17 17:23:39 +02:00
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: flex-start;
|
2024-11-27 15:43:37 +01:00
|
|
|
flex-wrap: nowrap;
|
2024-09-09 20:05:47 +02:00
|
|
|
position: -webkit-sticky;
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: var(--gutter);
|
2024-10-16 15:57:50 +02:00
|
|
|
width: 100%;
|
|
|
|
|
max-width: var(--sidebar-width);
|
2024-09-04 18:55:21 +02:00
|
|
|
height: calc(100vh - var(--gutter) * 2);
|
|
|
|
|
height: calc(100dvh - var(--gutter) * 2);
|
|
|
|
|
padding: var(--gap);
|
|
|
|
|
background: var(--color-background);
|
|
|
|
|
overflow-y: auto;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-21 18:27:25 +01:00
|
|
|
@media (max-width: 1023px) {
|
|
|
|
|
button[aria-controls="menu"][aria-expanded="true"] {
|
|
|
|
|
left: 0;
|
2024-11-22 17:16:58 +01:00
|
|
|
margin-top: 0.4rem;
|
2024-11-21 18:27:25 +01:00
|
|
|
}
|
|
|
|
|
#menu {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
z-index: 100;
|
|
|
|
|
border-radius: 0;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
height: 100dvh;
|
|
|
|
|
padding-top: 2.5rem;
|
|
|
|
|
}
|
|
|
|
|
button[aria-controls="menu"][aria-expanded="true"] + #menu::before {
|
|
|
|
|
content: "";
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
left: var(--sidebar-width);
|
|
|
|
|
bottom: 0;
|
|
|
|
|
z-index: -1;
|
|
|
|
|
background: var(--color-black-50);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-04 18:55:21 +02:00
|
|
|
#menu [data-icon]::before {
|
|
|
|
|
background-color: var(--color-grey-700);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu header {
|
2024-09-17 17:23:39 +02:00
|
|
|
align-items: center;
|
2024-09-04 18:55:21 +02:00
|
|
|
padding-left: var(--gap);
|
|
|
|
|
min-height: var(--space-40);
|
|
|
|
|
font-family: var(--font-serif);
|
2024-09-04 19:12:29 +02:00
|
|
|
font-size: var(--text-md);
|
2024-09-04 18:55:21 +02:00
|
|
|
background: var(--color-background);
|
|
|
|
|
position: -webkit-sticky;
|
|
|
|
|
position: sticky;
|
|
|
|
|
top: 0;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
}
|
|
|
|
|
#menu header::before {
|
2024-09-10 08:49:09 +02:00
|
|
|
content: "";
|
2024-09-04 18:55:21 +02:00
|
|
|
display: block;
|
|
|
|
|
position: absolute;
|
|
|
|
|
top: -1rem;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
bottom: -2rem;
|
2024-09-04 19:12:29 +02:00
|
|
|
z-index: -1;
|
2024-09-10 08:49:09 +02:00
|
|
|
background: linear-gradient(
|
|
|
|
|
to bottom,
|
|
|
|
|
var(--color-background) 0%,
|
|
|
|
|
var(--color-background) 75%,
|
|
|
|
|
transparent 100%
|
|
|
|
|
);
|
2024-09-04 18:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu nav {
|
|
|
|
|
--flow-space: var(--space-32);
|
|
|
|
|
flex: 1 1 0%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu ul {
|
|
|
|
|
--direction: column;
|
|
|
|
|
--items: flex-start;
|
|
|
|
|
--row-gap: var(--space-4);
|
|
|
|
|
width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu li,
|
|
|
|
|
#menu summary {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 2.5rem; /* 40px */
|
|
|
|
|
padding: 0 var(--space-16);
|
|
|
|
|
gap: var(--space-12);
|
2024-09-10 18:07:43 +02:00
|
|
|
border-radius: var(--rounded-lg);
|
2024-09-04 18:55:21 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu li {
|
|
|
|
|
position: relative;
|
|
|
|
|
min-height: 2.75rem; /* 44px */
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-19 16:04:35 +01:00
|
|
|
#menu li.disabled {
|
2024-11-19 17:06:57 +01:00
|
|
|
opacity: 0.5;
|
2024-11-19 16:04:35 +01:00
|
|
|
}
|
|
|
|
|
#menu li.disabled a::before {
|
|
|
|
|
cursor: not-allowed;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-04 18:55:21 +02:00
|
|
|
#menu li[data-count]::after {
|
|
|
|
|
content: attr(data-count);
|
|
|
|
|
display: inline-block;
|
|
|
|
|
color: var(--color-primary);
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu li .pill {
|
|
|
|
|
margin-left: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu li a::before {
|
2024-09-10 08:49:09 +02:00
|
|
|
content: "";
|
2024-09-04 18:55:21 +02:00
|
|
|
position: absolute;
|
|
|
|
|
inset: 0;
|
|
|
|
|
z-index: 1;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#menu li:hover {
|
|
|
|
|
background-color: var(--color-grey-50);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 15:40:43 +02:00
|
|
|
#menu .active {
|
|
|
|
|
background-color: var(--color-primary-10);
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-04 18:55:21 +02:00
|
|
|
#menu details {
|
|
|
|
|
font-family: var(--font-serif);
|
|
|
|
|
background-size: 1px 21px;
|
2024-09-10 08:49:09 +02:00
|
|
|
background-image: repeating-linear-gradient(
|
|
|
|
|
0deg,
|
|
|
|
|
var(--color-grey-50),
|
|
|
|
|
var(--color-grey-50) 1px,
|
|
|
|
|
transparent 1px,
|
|
|
|
|
transparent
|
|
|
|
|
);
|
2024-09-04 18:55:21 +02:00
|
|
|
background-repeat: repeat-x;
|
|
|
|
|
}
|
|
|
|
|
#menu details > summary {
|
|
|
|
|
font-family: var(--font-sans);
|
|
|
|
|
font-size: var(--text-sm);
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: var(--color-grey-700);
|
|
|
|
|
background-color: var(--color-background);
|
|
|
|
|
width: fit-content;
|
|
|
|
|
}
|
|
|
|
|
#menu details .new::after {
|
2024-09-10 08:49:09 +02:00
|
|
|
content: "Nouvelles modifications";
|
2024-09-04 18:55:21 +02:00
|
|
|
color: transparent;
|
|
|
|
|
position: relative;
|
|
|
|
|
display: inline-block;
|
2024-09-10 08:49:09 +02:00
|
|
|
width: 0.375rem; /* 6px */
|
|
|
|
|
height: 0.375rem; /* 6px */
|
2024-09-04 18:55:21 +02:00
|
|
|
border-radius: var(--rounded-full);
|
|
|
|
|
background-color: var(--color-primary-100);
|
|
|
|
|
margin-left: var(--space-8);
|
|
|
|
|
transform: translateY(-0.1em);
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
2024-09-02 21:18:25 +02:00
|
|
|
</style>
|