Compare commits
4 Commits
c8ac8d6564
...
d0e987a2aa
Author | SHA1 | Date |
---|---|---|
|
d0e987a2aa | |
|
6e8af52237 | |
|
e301e2184c | |
|
3b3f4a1f2d |
|
@ -187,7 +187,7 @@ export default {
|
|||
|
||||
<style lang="scss" scoped>
|
||||
.disclaimer {
|
||||
padding: 1rem;
|
||||
padding: .5rem 1rem;
|
||||
margin: 0;
|
||||
color: var(--text-light);
|
||||
background: var(--warn);
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
class="menu-item"
|
||||
@click.stop="$store.dispatch('logout')"
|
||||
>
|
||||
<Icon icon="enter2" />Log out
|
||||
<Icon icon="exit2" />Log out
|
||||
</li>
|
||||
|
||||
<li
|
||||
|
|
|
@ -204,7 +204,7 @@ export default {
|
|||
width: 1rem;
|
||||
height: 1rem;
|
||||
box-sizing: border-box;
|
||||
padding: .375rem .25rem;
|
||||
margin: .25rem;
|
||||
border-radius: 0 0 .5rem 0;
|
||||
color: var(--primary);
|
||||
font-size: 1rem;
|
||||
|
@ -434,7 +434,13 @@ export default {
|
|||
.tile.new .poster::after {
|
||||
bottom: 0;
|
||||
top: auto;
|
||||
border-radius: 0 .5rem 0 0;
|
||||
margin: 0 .25rem;
|
||||
}
|
||||
|
||||
.stash {
|
||||
left: 0;
|
||||
right: auto;
|
||||
padding: .25rem .5rem .5rem .25rem;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -129,35 +129,63 @@
|
|||
</nav>
|
||||
</div>
|
||||
|
||||
<div class="sidebar-section toggles noselect">
|
||||
<div class="sidebar-section controls noselect">
|
||||
<label
|
||||
v-show="sfw"
|
||||
class="toggle"
|
||||
@click="setSfw(false)"
|
||||
><Icon icon="fire" />Disable safe mode</label>
|
||||
v-if="auth && me"
|
||||
@click="$emit('toggleSidebar', false)"
|
||||
>
|
||||
<router-link
|
||||
:to="{ name: 'user', params: { username: me.username } }"
|
||||
class="toggle username nolink"
|
||||
>{{ me.username }}</router-link>
|
||||
</label>
|
||||
|
||||
<label
|
||||
v-show="!sfw"
|
||||
class="toggle"
|
||||
@click="setSfw(true)"
|
||||
><Icon icon="flower" />Enable safe mode</label>
|
||||
<div class="toggles noselect">
|
||||
<label
|
||||
v-if="auth && !me"
|
||||
@click="$emit('toggleSidebar', false)"
|
||||
>
|
||||
<router-link
|
||||
:to="{ name: 'login', query: { ref: $route.path } }"
|
||||
class="toggle nolink"
|
||||
><Icon icon="enter2" />Log in</router-link>
|
||||
</label>
|
||||
|
||||
<label
|
||||
v-show="theme === 'dark'"
|
||||
class="toggle"
|
||||
@click="setTheme('light')"
|
||||
><Icon icon="sun" />Use light theme</label>
|
||||
<label
|
||||
v-if="auth && me"
|
||||
class="toggle"
|
||||
@click.stop="$store.dispatch('logout')"
|
||||
><Icon icon="exit2" />Log out</label>
|
||||
|
||||
<label
|
||||
v-show="theme === 'light'"
|
||||
class="toggle"
|
||||
@click="setTheme('dark')"
|
||||
><Icon icon="moon" />Use dark theme</label>
|
||||
<label
|
||||
v-show="sfw"
|
||||
class="toggle"
|
||||
@click="setSfw(false)"
|
||||
><Icon icon="fire" />Disable safe mode</label>
|
||||
|
||||
<label
|
||||
class="toggle"
|
||||
@click="$emit('showFilters', true)"
|
||||
><Icon icon="filter" />Filters</label>
|
||||
<label
|
||||
v-show="!sfw"
|
||||
class="toggle"
|
||||
@click="setSfw(true)"
|
||||
><Icon icon="flower" />Enable safe mode</label>
|
||||
|
||||
<label
|
||||
v-show="theme === 'dark'"
|
||||
class="toggle"
|
||||
@click="setTheme('light')"
|
||||
><Icon icon="sun" />Use light theme</label>
|
||||
|
||||
<label
|
||||
v-show="theme === 'light'"
|
||||
class="toggle"
|
||||
@click="setTheme('dark')"
|
||||
><Icon icon="moon" />Use dark theme</label>
|
||||
|
||||
<label
|
||||
class="toggle"
|
||||
@click="$emit('showFilters', true)"
|
||||
><Icon icon="filter" />Filters</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -178,6 +206,14 @@ function theme(state) {
|
|||
return state.ui.theme;
|
||||
}
|
||||
|
||||
function auth(state) {
|
||||
return state.auth.enabled;
|
||||
}
|
||||
|
||||
function me(state) {
|
||||
return state.auth.user;
|
||||
}
|
||||
|
||||
function setTheme(newTheme) {
|
||||
this.$store.dispatch('setTheme', newTheme);
|
||||
}
|
||||
|
@ -198,6 +234,8 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
auth,
|
||||
me,
|
||||
sfw,
|
||||
theme,
|
||||
}),
|
||||
|
@ -312,10 +350,13 @@ export default {
|
|||
}
|
||||
}
|
||||
|
||||
.controls {
|
||||
margin: .5rem 0 0 0;
|
||||
}
|
||||
|
||||
.toggles {
|
||||
flex-shrink: 0;
|
||||
border-top: solid 1px var(--shadow-hint);
|
||||
margin: .5rem 0 0 0;
|
||||
}
|
||||
|
||||
.toggle {
|
||||
|
@ -324,6 +365,10 @@ export default {
|
|||
color: var(--shadow);
|
||||
font-weight: bold;
|
||||
|
||||
&.username {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.icon {
|
||||
fill: var(--shadow);
|
||||
margin: 0 1rem 0 0;
|
||||
|
|
|
@ -82,6 +82,7 @@ export default {
|
|||
align-items: center;
|
||||
height: 100%;
|
||||
padding: 0 .5rem;
|
||||
font-size: .8rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -148,6 +148,10 @@ function curateStash(stash) {
|
|||
}
|
||||
|
||||
function curateUser(user) {
|
||||
if (!user) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const curatedUser = user;
|
||||
|
||||
if (user.stashes) {
|
||||
|
|
|
@ -6,9 +6,9 @@ function initUsersActions(store, _router) {
|
|||
async function fetchUser(context, username) {
|
||||
const { user } = await graphql(`
|
||||
query User(
|
||||
$username: String!
|
||||
$hasAuth: Boolean!
|
||||
$userId: Int
|
||||
$username: String!
|
||||
) {
|
||||
user: userByUsername(username: $username) {
|
||||
id
|
||||
|
@ -55,7 +55,7 @@ function initUsersActions(store, _router) {
|
|||
}
|
||||
`, {
|
||||
hasAuth: !!store.state.auth.user,
|
||||
userId: store.state.auth.user?.id,
|
||||
userId: store.state.auth.user?.id || null,
|
||||
username,
|
||||
});
|
||||
|
||||
|
|
|
@ -1157,7 +1157,8 @@ exports.up = knex => Promise.resolve()
|
|||
// allow vim fold
|
||||
return knex.raw(`
|
||||
CREATE FUNCTION current_user_id() RETURNS INTEGER AS $$
|
||||
SELECT current_setting('user.id', true)::integer;
|
||||
/* if the user ID is undefined, the adapter will pass it as a string, which cannot be cast as NULL by ::integer */
|
||||
SELECT NULLIF(current_setting('user.id', true), '')::integer;
|
||||
$$ LANGUAGE SQL STABLE;
|
||||
|
||||
/* We need both the release entries and their search ranking, and PostGraphile does not seem to allow virtual foreign keys on function results.
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.188.1",
|
||||
"version": "1.188.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "1.188.1",
|
||||
"version": "1.188.2",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@casl/ability": "^5.2.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "traxxx",
|
||||
"version": "1.188.1",
|
||||
"version": "1.188.2",
|
||||
"description": "All the latest porn releases in one place",
|
||||
"main": "src/app.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -14,7 +14,7 @@ const connectionString = `postgres://${config.database.query.user}:${config.data
|
|||
|
||||
async function pgSettings(req) {
|
||||
return {
|
||||
'user.id': req.session.user?.id,
|
||||
'user.id': req.session.user?.id || null, // undefined is passed as an empty string, avoid
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue