1
0
mirror of https://github.com/Kovah/LinkAce.git synced 2025-01-17 05:08:21 +01:00

Add page titles, fixes #584 and #691

This commit is contained in:
chrissawyerfan4 2023-10-15 16:56:37 +02:00
parent 0c2cdd668d
commit 1da2d58bc5
27 changed files with 83 additions and 20 deletions

View File

@ -58,6 +58,7 @@ class DashboardController extends Controller
];
return view('dashboard', [
'pageTitle' => trans('linkace.dashboard'),
'recent_links' => $recentLinks,
'recent_tags' => $recentTags,
'recent_lists' => $recentLists,

View File

@ -21,7 +21,9 @@ class ExportController extends Controller
*/
public function getExport(): View
{
return view('app.export.export');
return view('app.export.export', [
'pageTitle' => trans('export.export'),
]);
}
/**

View File

@ -18,7 +18,9 @@ class ImportController extends Controller
*/
public function getImport(): View
{
return view('app.import.import');
return view('app.import.import', [
'pageTitle' => trans('import.import'),
]);
}
/**

View File

@ -18,7 +18,9 @@ class SearchController extends Controller
*/
public function getSearch(): View
{
return view('app.search.search')
return view('app.search.search', [
'pageTitle' => trans('search.search'),
])
->with('results', collect([]))
->with('order_by_options', $this->orderByOptions)
->with('query_settings', [
@ -47,7 +49,9 @@ class SearchController extends Controller
$search = $this->buildDatabaseQuery($request);
$results = $search->paginate(getPaginationLimit());
return view('app.search.search')
return view('app.search.search', [
'pageTitle' => trans('search.results_for') . ' ' . $this->searchQuery,
])
->with('results', $results)
->with('order_by_options', $this->orderByOptions)
->with('query_settings', [

View File

@ -22,6 +22,7 @@ class SystemSettingsController extends Controller
public function getSystemSettings(): View
{
return view('app.settings.system', [
'pageTitle' => trans('settings.system_settings'),
'linkaceVersion' => UpdateHelper::currentVersion(),
]);
}

View File

@ -39,6 +39,7 @@ class TrashController extends Controller
->get();
return view('app.trash.index', [
'pageTitle' => trans('trash.trash'),
'links' => $links,
'lists' => $lists,
'tags' => $tags,

View File

@ -27,6 +27,7 @@ class UserSettingsController extends Controller
$bookmarkletCode = LinkAce::generateBookmarkletCode();
return view('app.settings.user', [
'pageTitle' => trans('settings.user_settings'),
'user' => auth()->user(),
'bookmarklet_code' => $bookmarkletCode,
]);

View File

@ -32,6 +32,7 @@ class LinkController extends Controller
}
return view('guest.links.index', [
'pageTitle' => trans('link.links'),
'links' => $links->paginate(getPaginationLimit()),
'route' => $request->getBaseUrl(),
'orderBy' => $request->input('orderBy', 'created_at'),

View File

@ -29,6 +29,7 @@ class ListController extends Controller
->paginate(getPaginationLimit());
return view('guest.lists.index', [
'pageTitle' => trans('list.lists'),
'lists' => $lists,
'orderBy' => $request->input('orderBy', 'name'),
'orderDir' => $this->getOrderDirection($request, 'asc'),
@ -54,6 +55,7 @@ class ListController extends Controller
)->paginate(getPaginationLimit());
return view('guest.lists.show', [
'pageTitle' => trans('list.list') . ': ' . $list->name,
'list' => $list,
'listLinks' => $links,
'route' => $request->getBaseUrl(),

View File

@ -29,6 +29,7 @@ class TagController extends Controller
->paginate(getPaginationLimit());
return view('guest.tags.index', [
'pageTitle' => trans('tag.tags'),
'tags' => $tags,
'route' => $request->getBaseUrl(),
'orderBy' => $request->input('orderBy', 'name'),
@ -55,6 +56,7 @@ class TagController extends Controller
)->paginate(getPaginationLimit());
return view('guest.tags.show', [
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
'tag' => $tag,
'tagLinks' => $links,
'route' => $request->getBaseUrl(),

View File

@ -41,6 +41,7 @@ class LinkController extends Controller
}
return view('models.links.index', [
'pageTitle' => trans('link.links'),
'links' => $links->paginate(getPaginationLimit()),
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
@ -59,6 +60,7 @@ class LinkController extends Controller
session()->forget('bookmarklet.create');
return view('models.links.create', [
'pageTitle' => trans('link.add'),
'existing_link' => null,
]);
}
@ -111,6 +113,7 @@ class LinkController extends Controller
public function show(Link $link): View
{
return view('models.links.show', [
'pageTitle' => trans('link.link') . ': ' . $link->shortTitle(),
'link' => $link,
'history' => $link->revisionHistory()->latest()->get(),
]);
@ -125,6 +128,7 @@ class LinkController extends Controller
public function edit(Link $link): View
{
return view('models.links.edit', [
'pageTitle' => trans('link.edit') . ': ' . $link->shortTitle(),
'link' => $link,
'existing_link' => null,
]);

View File

@ -42,6 +42,7 @@ class ListController extends Controller
$lists = $lists->paginate(getPaginationLimit());
return view('models.lists.index', [
'pageTitle' => trans('list.lists'),
'lists' => $lists,
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
@ -56,7 +57,9 @@ class ListController extends Controller
*/
public function create(): View
{
return view('models.lists.create');
return view('models.lists.create', [
'pageTitle' => trans('list.add'),
]);
}
/**
@ -98,6 +101,7 @@ class ListController extends Controller
)->paginate(getPaginationLimit());
return view('models.lists.show', [
'pageTitle' => trans('list.list') . ': ' . $list->name,
'list' => $list,
'listLinks' => $links,
'route' => $request->getBaseUrl(),
@ -114,7 +118,10 @@ class ListController extends Controller
*/
public function edit(LinkList $list): View
{
return view('models.lists.edit', ['list' => $list]);
return view('models.lists.edit', [
'pageTitle' => trans('list.edit') . ': ' . $list->name,
'list' => $list,
]);
}
/**

View File

@ -48,7 +48,10 @@ class NoteController extends Controller
abort(403);
}
return view('models.notes.edit', ['note' => $note]);
return view('models.notes.edit', [
'pageTitle' => trans('note.edit'),
'note' => $note,
]);
}
/**

View File

@ -42,6 +42,7 @@ class TagController extends Controller
$tags = $tags->paginate(getPaginationLimit());
return view('models.tags.index', [
'pageTitle' => trans('tag.tags'),
'tags' => $tags,
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
@ -57,7 +58,9 @@ class TagController extends Controller
*/
public function create(): View
{
return view('models.tags.create');
return view('models.tags.create', [
'pageTitle' => trans('tag.add'),
]);
}
/**
@ -99,6 +102,7 @@ class TagController extends Controller
->paginate(getPaginationLimit());
return view('models.tags.show', [
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
'tag' => $tag,
'tagLinks' => $links,
'route' => $request->getBaseUrl(),
@ -115,7 +119,10 @@ class TagController extends Controller
*/
public function edit(Tag $tag): View
{
return view('models.tags.edit', ['tag' => $tag]);
return view('models.tags.edit', [
'pageTitle' => trans('tag.edit') . ': ' . $tag->name,
'tag' => $tag,
]);
}
/**

View File

@ -24,7 +24,9 @@ class AccountController extends Controller
*/
public function index(): View
{
return view('setup.account');
return view('setup.account', [
'pageTitle' => trans('setup.account_setup'),
]);
}
/**

View File

@ -25,7 +25,9 @@ class DatabaseController extends Controller
*/
public function index(): View
{
return view('setup.database');
return view('setup.database', [
'pageTitle' => trans('setup.database_configure'),
]);
}
/**

View File

@ -17,7 +17,9 @@ class MetaController extends Controller
*/
public function welcome(): View
{
return view('setup.welcome');
return view('setup.welcome', [
'pageTitle' => trans('setup.setup'),
]);
}
/**
@ -30,6 +32,8 @@ class MetaController extends Controller
Setting::create(['key' => 'system_setup_completed', 'value' => true]);
Cache::forget('systemsettings');
return view('setup.complete');
return view('setup.complete', [
'pageTitle' => trans('setup.complete'),
]);
}
}

View File

@ -18,6 +18,7 @@ class RequirementsController extends Controller
[$success, $results] = $this->checkRequirements();
return view('setup.requirements', [
'pageTitle' => trans('setup.setup_requirements'),
'success' => $success,
'results' => $results,
]);

View File

@ -34,23 +34,33 @@ class FortifyServiceProvider extends ServiceProvider
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
Fortify::loginView(function () {
return view('auth.login');
return view('auth.login', [
'pageTitle' => trans('linkace.login'),
]);
});
Fortify::requestPasswordResetLinkView(function () {
return view('auth.passwords.email');
return view('auth.passwords.email', [
'pageTitle' => trans('linkace.reset_password'),
]);
});
Fortify::resetPasswordView(function () {
return view('auth.passwords.reset');
return view('auth.passwords.reset', [
'pageTitle' => trans('linkace.reset_password'),
]);
});
Fortify::confirmPasswordView(function () {
return view('auth.confirm-password');
return view('auth.confirm-password', [
'pageTitle' => trans('linkace.password_confirm'),
]);
});
Fortify::twoFactorChallengeView(function () {
return view('auth.two-factor-challenge');
return view('auth.two-factor-challenge', [
'pageTitle' => trans('auth.two_factor'),
]);
});
}
}

View File

@ -11,6 +11,7 @@ return [
'logout' => 'Abmelden',
'remember_me' => 'Angemeldet bleiben',
'go_to_dashboard' => 'Zur Übersicht gehen',
'dashboard' => 'Übersicht',
'system_logs' => 'System Logs',
'reset_password' => 'Passwort zurücksetzen',

View File

@ -25,6 +25,7 @@ return [
'order_by.random' => 'Zufällig',
'no_results' => 'Keine Ergebnisse gefunden.',
'results_for' => 'Ergebnisse für',
'validation_query_missing' => 'Es muss entweder eine Suchanfrage eingeben oder eine Liste oder ein Tag ausgewählt werden, oder die Suche nach kaputten Links muss aktiviert sein.',
];

View File

@ -11,6 +11,7 @@ return [
'intro.step2' => 'Richten Sie eine Datenbank ein und prüfen Sie, ob die Verbindung erfolgreich ist.',
'intro.step3' => 'Erstellen Sie Ihr Benutzerkonto.',
'setup_requirements' => 'Setup-Anforderungen',
'check_requirements' => 'Anforderungen prüfen',
'requirements.php_version' => 'PHP-Version >= 7.4.0',
'requirements.extension_bcmath' => 'PHP Extension: BCMath',

View File

@ -11,6 +11,7 @@ return [
'logout' => 'Logout',
'remember_me' => 'Remember me',
'go_to_dashboard' => 'Go to the Dashboard',
'dashboard' => 'Dashboard',
'system_logs' => 'System Logs',
'reset_password' => 'Reset Password',

View File

@ -25,6 +25,7 @@ return [
'order_by.random' => 'Random',
'no_results' => 'No results found.',
'results_for' => 'Search results for',
'validation_query_missing' => 'You must either enter a search query, or select a list, a tag or enable searching for broken links.',
];

View File

@ -11,6 +11,7 @@ return [
'intro.step2' => 'Setup up a database and check if the connection is successful.',
'intro.step3' => 'Create your user account.',
'setup_requirements' => 'Setup Requirements',
'check_requirements' => 'Check Requirements',
'requirements.php_version' => 'PHP version >= 7.4.0',
'requirements.extension_bcmath' => 'PHP Extension: BCMath',

View File

@ -7,7 +7,7 @@
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>{{ config('app.name', 'LinkAce') }}</title>
<title>@isset($pageTitle){{$pageTitle}} - @endisset{{ config('app.name', 'LinkAce') }}</title>
<link href="{{ mix('assets/dist/css/app.css') }}" rel="stylesheet">

View File

@ -2,7 +2,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ systemsettings('system_page_title') ?: config('app.name', 'LinkAce') }}</title>
<title>@isset($pageTitle){{$pageTitle}} - @endisset{{ systemsettings('system_page_title') ?: config('app.name', 'LinkAce') }}</title>
@stack('html-header')
@include('partials.favicon')