forked from DebaucheryLibrarian/traxxx
Added stashes with experimental row security policies. Added tag photos.
This commit is contained in:
@@ -93,82 +93,7 @@
|
||||
</div>
|
||||
|
||||
<template v-slot:tooltip>
|
||||
<div class="menu">
|
||||
<ul class="menu-items noselect">
|
||||
<router-link
|
||||
v-if="!me"
|
||||
to="/login"
|
||||
class="menu-item"
|
||||
@click.stop
|
||||
>
|
||||
<Icon icon="enter2" />Log in
|
||||
</router-link>
|
||||
|
||||
<li
|
||||
v-if="me"
|
||||
class="menu-username"
|
||||
>{{ me.username }}</li>
|
||||
|
||||
<li
|
||||
v-if="me"
|
||||
class="menu-item"
|
||||
@click.stop="$store.dispatch('logout')"
|
||||
>
|
||||
<Icon icon="enter2" />Log out
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="!sfw"
|
||||
class="menu-item"
|
||||
@click.stop="setSfw(true)"
|
||||
>
|
||||
<Icon
|
||||
icon="flower"
|
||||
class="toggle noselect"
|
||||
/>Safe mode
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="sfw"
|
||||
class="menu-item"
|
||||
@click.stop="setSfw(false)"
|
||||
>
|
||||
<Icon
|
||||
icon="fire"
|
||||
class="toggle noselect"
|
||||
/>Filth mode
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="theme === 'light'"
|
||||
class="menu-item"
|
||||
@click.stop="setTheme('dark')"
|
||||
>
|
||||
<Icon
|
||||
icon="moon"
|
||||
class="toggle noselect"
|
||||
/>Dark theme
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="theme === 'dark'"
|
||||
class="menu-item"
|
||||
@click.stop="setTheme('light')"
|
||||
>
|
||||
<Icon
|
||||
icon="sun"
|
||||
class="toggle noselect"
|
||||
/>Light theme
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="menu-item"
|
||||
@click="$emit('showFilters', true)"
|
||||
>
|
||||
<Icon icon="filter" />Filters
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<Menu />
|
||||
</template>
|
||||
</Tooltip>
|
||||
|
||||
@@ -201,34 +126,14 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
import Menu from './menu.vue';
|
||||
import Search from './search.vue';
|
||||
|
||||
import logo from '../../img/logo.svg';
|
||||
|
||||
function sfw(state) {
|
||||
return state.ui.sfw;
|
||||
}
|
||||
|
||||
function theme(state) {
|
||||
return state.ui.theme;
|
||||
}
|
||||
|
||||
function me(state) {
|
||||
return state.auth.user;
|
||||
}
|
||||
|
||||
function setTheme(newTheme) {
|
||||
this.$store.dispatch('setTheme', newTheme);
|
||||
}
|
||||
|
||||
function setSfw(enabled) {
|
||||
this.$store.dispatch('setSfw', enabled);
|
||||
}
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Menu,
|
||||
Search,
|
||||
},
|
||||
emits: ['toggleSidebar', 'showFilters'],
|
||||
@@ -239,17 +144,6 @@ export default {
|
||||
showFilters: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
sfw,
|
||||
theme,
|
||||
me,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
setSfw,
|
||||
setTheme,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -414,51 +308,6 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
.menu-items {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
padding: .75rem 1rem .75rem .75rem;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
|
||||
.icon {
|
||||
fill: var(--darken);
|
||||
margin: 0 1rem 0 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: var(--darken-weak);
|
||||
cursor: default;
|
||||
|
||||
.icon {
|
||||
fill: var(--darken-weak);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover:not(.disabled) {
|
||||
cursor: pointer;
|
||||
color: var(--primary);
|
||||
|
||||
.icon {
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-username {
|
||||
font-weight: bold;
|
||||
color: var(--shadow-strong);
|
||||
font-size: .9rem;
|
||||
padding: .75rem 1rem;
|
||||
border-bottom: solid 1px var(--shadow-hint);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-compact {
|
||||
display: none;
|
||||
height: 100%;
|
||||
|
||||
168
assets/components/header/menu.vue
Normal file
168
assets/components/header/menu.vue
Normal file
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<div class="menu">
|
||||
<ul class="menu-items noselect">
|
||||
<router-link
|
||||
v-if="me"
|
||||
:to="{ name: 'user', params: { username: me.username } }"
|
||||
class="menu-username"
|
||||
>{{ me.username }}</router-link>
|
||||
|
||||
<router-link
|
||||
v-else
|
||||
to="/login"
|
||||
class="menu-item"
|
||||
@click.stop
|
||||
>
|
||||
<Icon icon="enter2" />Log in
|
||||
</router-link>
|
||||
|
||||
<li
|
||||
v-if="me"
|
||||
class="menu-item"
|
||||
@click.stop="$store.dispatch('logout')"
|
||||
>
|
||||
<Icon icon="enter2" />Log out
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="!sfw"
|
||||
class="menu-item"
|
||||
@click.stop="setSfw(true)"
|
||||
>
|
||||
<Icon
|
||||
icon="flower"
|
||||
class="toggle noselect"
|
||||
/>Safe mode
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="sfw"
|
||||
class="menu-item"
|
||||
@click.stop="setSfw(false)"
|
||||
>
|
||||
<Icon
|
||||
icon="fire"
|
||||
class="toggle noselect"
|
||||
/>Filth mode
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="theme === 'light'"
|
||||
class="menu-item"
|
||||
@click.stop="setTheme('dark')"
|
||||
>
|
||||
<Icon
|
||||
icon="moon"
|
||||
class="toggle noselect"
|
||||
/>Dark theme
|
||||
</li>
|
||||
|
||||
<li
|
||||
v-show="theme === 'dark'"
|
||||
class="menu-item"
|
||||
@click.stop="setTheme('light')"
|
||||
>
|
||||
<Icon
|
||||
icon="sun"
|
||||
class="toggle noselect"
|
||||
/>Light theme
|
||||
</li>
|
||||
|
||||
<li
|
||||
class="menu-item"
|
||||
@click="$emit('showFilters', true)"
|
||||
>
|
||||
<Icon icon="filter" />Filters
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
|
||||
function sfw(state) {
|
||||
return state.ui.sfw;
|
||||
}
|
||||
|
||||
function theme(state) {
|
||||
return state.ui.theme;
|
||||
}
|
||||
|
||||
function me(state) {
|
||||
return state.auth.user;
|
||||
}
|
||||
|
||||
function setTheme(newTheme) {
|
||||
this.$store.dispatch('setTheme', newTheme);
|
||||
}
|
||||
|
||||
function setSfw(enabled) {
|
||||
this.$store.dispatch('setSfw', enabled);
|
||||
}
|
||||
|
||||
export default {
|
||||
computed: {
|
||||
...mapState({
|
||||
sfw,
|
||||
theme,
|
||||
me,
|
||||
}),
|
||||
},
|
||||
methods: {
|
||||
setSfw,
|
||||
setTheme,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import 'breakpoints';
|
||||
|
||||
.menu-items {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
display: flex;
|
||||
padding: .75rem 1rem .75rem .75rem;
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
|
||||
.icon {
|
||||
fill: var(--darken);
|
||||
margin: 0 1rem 0 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: var(--darken-weak);
|
||||
cursor: default;
|
||||
|
||||
.icon {
|
||||
fill: var(--darken-weak);
|
||||
}
|
||||
}
|
||||
|
||||
&:hover:not(.disabled) {
|
||||
cursor: pointer;
|
||||
color: var(--primary);
|
||||
|
||||
.icon {
|
||||
fill: var(--primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.menu-username {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
color: var(--shadow-strong);
|
||||
font-size: .9rem;
|
||||
padding: .75rem 1rem;
|
||||
border-bottom: solid 1px var(--shadow-hint);
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user