2022-08-11 21:56:30 +03:00
|
|
|
<template>
|
2022-08-31 00:48:38 +03:00
|
|
|
<OptionalRouterLink
|
2022-08-31 00:58:03 +03:00
|
|
|
v-slot="{ isActive, href, navigate } = {}"
|
2022-08-31 00:48:38 +03:00
|
|
|
:to="routeTo"
|
|
|
|
|
>
|
|
|
|
|
<li
|
|
|
|
|
class="NavigationEntry menu-item"
|
|
|
|
|
:class="{ '-active': isActive }"
|
|
|
|
|
v-bind="$attrs"
|
2022-08-11 21:56:30 +03:00
|
|
|
>
|
2022-08-31 00:48:38 +03:00
|
|
|
<component
|
|
|
|
|
:is="routeTo ? 'a' : 'button'"
|
2022-08-31 00:58:03 +03:00
|
|
|
class="main-link button-unstyled"
|
2022-08-31 00:48:38 +03:00
|
|
|
:href="href"
|
|
|
|
|
@click="navigate"
|
|
|
|
|
>
|
|
|
|
|
<span>
|
|
|
|
|
<FAIcon
|
|
|
|
|
v-if="item.icon"
|
|
|
|
|
fixed-width
|
|
|
|
|
class="fa-scale-110 menu-icon"
|
|
|
|
|
:icon="item.icon"
|
|
|
|
|
/>
|
|
|
|
|
</span>
|
|
|
|
|
<span
|
|
|
|
|
v-if="item.iconLetter"
|
|
|
|
|
class="icon iconLetter fa-scale-110 menu-icon"
|
|
|
|
|
>{{ item.iconLetter }}
|
|
|
|
|
</span>
|
|
|
|
|
<span class="label">
|
2022-08-31 00:58:03 +03:00
|
|
|
{{ item.labelRaw || $t(item.label) }}
|
2022-08-31 00:48:38 +03:00
|
|
|
</span>
|
|
|
|
|
</component>
|
2022-08-30 00:15:42 +03:00
|
|
|
<slot />
|
|
|
|
|
<div
|
|
|
|
|
v-if="item.badgeGetter && getters[item.badgeGetter]"
|
2024-02-16 00:29:16 +02:00
|
|
|
class="badge -notification"
|
2022-08-30 00:15:42 +03:00
|
|
|
>
|
|
|
|
|
{{ getters[item.badgeGetter] }}
|
|
|
|
|
</div>
|
2022-08-12 01:27:09 +03:00
|
|
|
<button
|
2022-08-30 00:15:42 +03:00
|
|
|
v-if="showPin && currentUser"
|
2022-08-12 01:27:09 +03:00
|
|
|
type="button"
|
2022-08-30 00:15:42 +03:00
|
|
|
class="button-unstyled extra-button"
|
2022-08-24 20:24:08 +03:00
|
|
|
:title="$t(isPinned ? 'general.unpin' : 'general.pin' )"
|
|
|
|
|
:aria-pressed="!!isPinned"
|
2022-08-12 01:27:09 +03:00
|
|
|
@click.stop.prevent="togglePin(item.name)"
|
|
|
|
|
>
|
|
|
|
|
<FAIcon
|
|
|
|
|
v-if="showPin && currentUser"
|
|
|
|
|
fixed-width
|
|
|
|
|
class="fa-scale-110"
|
|
|
|
|
:class="{ 'veryfaint': !isPinned(item.name) }"
|
|
|
|
|
:transform="!isPinned(item.name) ? 'rotate-45' : ''"
|
|
|
|
|
icon="thumbtack"
|
2022-08-11 21:56:30 +03:00
|
|
|
/>
|
2022-08-12 01:27:09 +03:00
|
|
|
</button>
|
2022-08-31 00:48:38 +03:00
|
|
|
</li>
|
|
|
|
|
</OptionalRouterLink>
|
2022-08-11 21:56:30 +03:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script src="./navigation_entry.js"></script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
2023-01-09 13:02:16 -05:00
|
|
|
@import "../../variables";
|
2022-08-11 21:56:30 +03:00
|
|
|
|
|
|
|
|
.NavigationEntry {
|
2022-08-31 00:48:38 +03:00
|
|
|
display: flex;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
align-items: baseline;
|
|
|
|
|
height: 3.5em;
|
|
|
|
|
line-height: 3.5em;
|
2024-02-12 17:26:08 +02:00
|
|
|
padding: 0;
|
2022-08-31 00:48:38 +03:00
|
|
|
width: 100%;
|
|
|
|
|
color: $fallback--link;
|
|
|
|
|
color: var(--link, $fallback--link);
|
|
|
|
|
|
2024-02-12 17:26:08 +02:00
|
|
|
&[aria-expanded] {
|
|
|
|
|
padding-right: 1em;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-31 00:48:38 +03:00
|
|
|
.timelines-chevron {
|
|
|
|
|
margin-right: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.main-link {
|
2022-08-30 00:15:42 +03:00
|
|
|
flex: 1;
|
2024-02-12 17:26:08 +02:00
|
|
|
padding: 0 1em;
|
2022-08-30 00:15:42 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.menu-icon {
|
2022-08-11 21:56:30 +03:00
|
|
|
margin-right: 0.8em;
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-30 00:15:42 +03:00
|
|
|
.extra-button {
|
|
|
|
|
width: 3em;
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
|
|
|
|
&:last-child {
|
|
|
|
|
margin-right: -0.8em;
|
|
|
|
|
}
|
2022-08-11 21:56:30 +03:00
|
|
|
}
|
2024-02-16 00:29:16 +02:00
|
|
|
|
|
|
|
|
.badge {
|
|
|
|
|
margin: 0 0.8em;
|
|
|
|
|
}
|
2022-08-11 21:56:30 +03:00
|
|
|
}
|
|
|
|
|
</style>
|