Skip to content

Commit 818c319

Browse files
authored
Remove unused config options, fix buttons in gallery header (#3439)
1 parent be1ecf0 commit 818c319

5 files changed

Lines changed: 66 additions & 21 deletions

File tree

app/Http/Resources/GalleryConfigs/RootConfig.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class RootConfig extends Data
2727
public AspectRatioCSSType $album_thumb_css_aspect_ratio;
2828

2929
// for now we keep it here. Maybe we should move it to a separate class
30-
public string $login_button_position; // left/right
3130
public bool $back_button_enabled;
3231
public string $back_button_text;
3332
public string $back_button_url;
@@ -46,7 +45,6 @@ public function __construct()
4645

4746
$this->album_thumb_css_aspect_ratio = Configs::getValueAsEnum('default_album_thumb_aspect_ratio', AspectRatioType::class)->css();
4847
$this->show_keybinding_help_button = Configs::getValueAsBool('show_keybinding_help_button');
49-
$this->login_button_position = Configs::getValueAsString('login_button_position');
5048
$this->back_button_enabled = Configs::getValueAsBool('back_button_enabled');
5149
$this->back_button_text = Configs::getValueAsString('back_button_text');
5250
$this->back_button_url = Configs::getValueAsString('back_button_url');
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?php
2+
3+
/**
4+
* SPDX-License-Identifier: MIT
5+
* Copyright (c) 2017-2018 Tobias Reich
6+
* Copyright (c) 2018-2025 LycheeOrg.
7+
*/
8+
9+
use Illuminate\Database\Migrations\Migration;
10+
use Illuminate\Support\Facades\DB;
11+
12+
return new class() extends Migration {
13+
public const CONFIG = 'config';
14+
public const ENUM = 'left|right';
15+
16+
/**
17+
* Run the migrations.
18+
*/
19+
public function up(): void
20+
{
21+
DB::table('configs')->where('key', 'login_button_position')->delete();
22+
DB::table('configs')->where('key', 'force_32bit_ids')->delete();
23+
}
24+
25+
/**
26+
* Reverse the migrations.
27+
*/
28+
public function down(): void
29+
{
30+
DB::table('configs')->insert([
31+
[
32+
'key' => 'login_button_position',
33+
'value' => 'left',
34+
'cat' => self::CONFIG,
35+
'type_range' => self::ENUM,
36+
'description' => 'Position of the login button',
37+
'order' => 32767,
38+
'is_secret' => false,
39+
'level' => 0,
40+
],
41+
[
42+
'key' => 'force_32bit_ids',
43+
'value' => '0',
44+
'cat' => 'Admin',
45+
'type_range' => 'bool',
46+
'description' => 'Force 32 bit legacy identifiers in the database',
47+
'order' => 5,
48+
'is_secret' => false,
49+
'level' => 0,
50+
],
51+
]);
52+
}
53+
};

resources/js/components/headers/AlbumsHeader.vue

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
</template>
1212

1313
<template #center>
14-
<span class="sm:hidden font-bold">
14+
<span class="lg:hidden font-bold">
1515
{{ $t("gallery.albums") }}
1616
</span>
17-
<span class="hidden sm:block font-bold text-sm lg:text-base text-center w-full" @click="is_metrics_open = !is_metrics_open">{{
17+
<span class="hidden lg:block font-bold text-sm lg:text-base text-center w-full" @click="is_metrics_open = !is_metrics_open">{{
1818
props.title
1919
}}</span>
2020
</template>
@@ -27,7 +27,7 @@
2727
severity="secondary"
2828
text
2929
:class="{
30-
'py-2 px-4 rounded-xl hidden md:block': true,
30+
'py-2 px-4 rounded-xl hidden xl:block': true,
3131
'dark:hover:text-surface-100': true,
3232
'hover:text-surface-800': true,
3333
}"
@@ -41,7 +41,7 @@
4141
severity="secondary"
4242
text
4343
:class="{
44-
'py-2 px-4 rounded-xl hidden md:block': true,
44+
'py-2 px-4 rounded-xl mr-12 block lg:mr-0': true,
4545
'dark:hover:text-surface-100 dark:border-surface-400 dark:hover:border-surface-100': true,
4646
'hover:text-surface-800 border-surface-500 hover:border-surface-800': true,
4747
}"
@@ -50,7 +50,7 @@
5050
</Button>
5151
</template>
5252
<!-- Maybe logged in. -->
53-
<div :class="menu.length > 1 ? 'hidden sm:block' : ''">
53+
<div class="hidden lg:block">
5454
<template v-for="item in menu">
5555
<template v-if="item.type === 'link'">
5656
<!-- @vue-ignore -->
@@ -61,13 +61,12 @@
6161
</template>
6262
</template>
6363
<!-- Not logged in. -->
64-
<BackLinkButton v-if="props.user.id === null && isLoginLeft" :config="props.config" />
64+
<BackLinkButton v-if="props.user.id === null" :config="props.config" />
6565
</div>
6666
<SpeedDial
6767
:model="menu"
68-
v-if="menu.length > 1"
6968
direction="down"
70-
class="top-0 mr-4 absolute right-0 sm:hidden"
69+
class="top-0 mr-4 absolute right-0 lg:hidden"
7170
:buttonProps="{ severity: 'help', rounded: true }"
7271
>
7372
<template #button="{ toggleCallback }">
@@ -129,7 +128,6 @@ const props = defineProps<{
129128
back_button_enabled: boolean;
130129
back_button_text: string;
131130
back_button_url: string;
132-
login_button_position: string;
133131
};
134132
hasHidden: boolean;
135133
}>();
@@ -171,7 +169,6 @@ const { addmenu, addMenu } = useContextMenuAlbumsAdd(
171169
);
172170
173171
const canUpload = computed(() => props.user.id !== null);
174-
const isLoginLeft = computed(() => props.config.login_button_position === "left");
175172
176173
function openAddMenu(event: Event) {
177174
addmenu.value.show(event);
@@ -242,7 +239,7 @@ const menu = computed(() =>
242239
to: { name: "favourites" },
243240
type: "link",
244241
icon: "pi pi-heart",
245-
if: is_favourite_enabled.value && (favourites.photos?.length ?? 0) > 0,
242+
if: props.user.id !== null && is_favourite_enabled.value && (favourites.photos?.length ?? 0) > 0,
246243
key: "favourites",
247244
},
248245
{
@@ -266,13 +263,6 @@ const menu = computed(() =>
266263
if: is_se_preview_enabled.value && props.rights.can_see_live_metrics,
267264
key: "se_preview",
268265
},
269-
{
270-
icon: "pi pi-sign-in",
271-
type: "fn",
272-
callback: togglableStore.toggleLogin,
273-
if: props.user.id === null && !isLoginLeft.value,
274-
key: "login",
275-
},
276266
{
277267
icon: "pi pi-question-circle",
278268
type: "fn",

resources/js/lychee.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ declare namespace App.Http.Resources.GalleryConfigs {
306306
is_search_accessible: boolean;
307307
show_keybinding_help_button: boolean;
308308
album_thumb_css_aspect_ratio: App.Enum.AspectRatioType;
309-
login_button_position: string;
310309
back_button_enabled: boolean;
311310
back_button_text: string;
312311
back_button_url: string;

resources/js/views/RegisterPage.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
{{ title }}
1717
</h1>
1818
</div>
19+
<div class="w-full max-w-md px-9 text-right">
20+
<router-link :to="{ name: 'login' }" class="hover:text-primary-emphasis">
21+
{{ $t("left-menu.login") }} <i class="pi pi-angle-double-right ml-1" />
22+
</router-link>
23+
</div>
1924
<Message v-if="errorMessage" severity="error" class="mb-4 text-center">{{ errorMessage }}</Message>
2025
<form v-focustrap class="flex flex-col gap-4 relative max-w-md w-full text-sm rounded-md pt-9">
2126
<div class="inline-flex flex-col gap-4 px-9">

0 commit comments

Comments
 (0)