Skip to content

Commit

Permalink
Merge pull request #703 from chrissawyerfan4/dev
Browse files Browse the repository at this point in the history
Add page titles
  • Loading branch information
Kovah committed Nov 1, 2023
2 parents f734547 + a6bed85 commit 194787b
Show file tree
Hide file tree
Showing 27 changed files with 83 additions and 20 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/App/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public function index(): View
];

return view('dashboard', [
'pageTitle' => trans('linkace.dashboard'),
'recent_links' => $recentLinks,
'recent_tags' => $recentTags,
'recent_lists' => $recentLists,
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/App/ExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/App/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);
}

/**
Expand Down
8 changes: 6 additions & 2 deletions app/Http/Controllers/App/SearchController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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', [
Expand Down Expand Up @@ -47,7 +49,9 @@ public function doSearch(SearchRequest $request): View
$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', [
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/App/SystemSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
]);
}
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/App/TrashController.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public function index(): View
->get();

return view('app.trash.index', [
'pageTitle' => trans('trash.trash'),
'links' => $links,
'lists' => $lists,
'tags' => $tags,
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/App/UserSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public function getUserSettings(): View
$bookmarkletCode = LinkAce::generateBookmarkletCode();

return view('app.settings.user', [
'pageTitle' => trans('settings.user_settings'),
'user' => auth()->user(),
'bookmarklet_code' => $bookmarkletCode,
]);
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Guest/LinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public function index(Request $request): View
}

return view('guest.links.index', [
'pageTitle' => trans('link.links'),
'links' => $links->paginate(getPaginationLimit()),
'route' => $request->getBaseUrl(),
'orderBy' => $request->input('orderBy', 'created_at'),
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Guest/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function index(Request $request): View
->paginate(getPaginationLimit());

return view('guest.lists.index', [
'pageTitle' => trans('list.lists'),
'lists' => $lists,
'orderBy' => $request->input('orderBy', 'name'),
'orderDir' => $this->getOrderDirection($request, 'asc'),
Expand All @@ -54,6 +55,7 @@ public function show(Request $request, int $listID): View
)->paginate(getPaginationLimit());

return view('guest.lists.show', [
'pageTitle' => trans('list.list') . ': ' . $list->name,
'list' => $list,
'listLinks' => $links,
'route' => $request->getBaseUrl(),
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Controllers/Guest/TagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function index(Request $request): View
->paginate(getPaginationLimit());

return view('guest.tags.index', [
'pageTitle' => trans('tag.tags'),
'tags' => $tags,
'route' => $request->getBaseUrl(),
'orderBy' => $request->input('orderBy', 'name'),
Expand All @@ -55,6 +56,7 @@ public function show(Request $request, int $tagID): View
)->paginate(getPaginationLimit());

return view('guest.tags.show', [
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
'tag' => $tag,
'tagLinks' => $links,
'route' => $request->getBaseUrl(),
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Controllers/Models/LinkController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public function index(Request $request): View
}

return view('models.links.index', [
'pageTitle' => trans('link.links'),
'links' => $links->paginate(getPaginationLimit()),
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
Expand All @@ -59,6 +60,7 @@ public function create(): View
session()->forget('bookmarklet.create');

return view('models.links.create', [
'pageTitle' => trans('link.add'),
'existing_link' => null,
]);
}
Expand Down Expand Up @@ -111,6 +113,7 @@ public function store(LinkStoreRequest $request): RedirectResponse
public function show(Link $link): View
{
return view('models.links.show', [
'pageTitle' => trans('link.link') . ': ' . $link->shortTitle(),
'link' => $link,
'history' => $link->revisionHistory()->latest()->get(),
]);
Expand All @@ -125,6 +128,7 @@ public function show(Link $link): View
public function edit(Link $link): View
{
return view('models.links.edit', [
'pageTitle' => trans('link.edit') . ': ' . $link->shortTitle(),
'link' => $link,
'existing_link' => null,
]);
Expand Down
11 changes: 9 additions & 2 deletions app/Http/Controllers/Models/ListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function index(Request $request): View
$lists = $lists->paginate(getPaginationLimit());

return view('models.lists.index', [
'pageTitle' => trans('list.lists'),
'lists' => $lists,
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
Expand All @@ -56,7 +57,9 @@ public function index(Request $request): View
*/
public function create(): View
{
return view('models.lists.create');
return view('models.lists.create', [
'pageTitle' => trans('list.add'),
]);
}

/**
Expand Down Expand Up @@ -98,6 +101,7 @@ public function show(Request $request, LinkList $list): View
)->paginate(getPaginationLimit());

return view('models.lists.show', [
'pageTitle' => trans('list.list') . ': ' . $list->name,
'list' => $list,
'listLinks' => $links,
'route' => $request->getBaseUrl(),
Expand All @@ -114,7 +118,10 @@ public function show(Request $request, LinkList $list): View
*/
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,
]);
}

/**
Expand Down
5 changes: 4 additions & 1 deletion app/Http/Controllers/Models/NoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ public function edit(Note $note): View
abort(403);
}

return view('models.notes.edit', ['note' => $note]);
return view('models.notes.edit', [
'pageTitle' => trans('note.edit'),
'note' => $note,
]);
}

/**
Expand Down
11 changes: 9 additions & 2 deletions app/Http/Controllers/Models/TagController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function index(Request $request): View
$tags = $tags->paginate(getPaginationLimit());

return view('models.tags.index', [
'pageTitle' => trans('tag.tags'),
'tags' => $tags,
'route' => $request->getBaseUrl(),
'orderBy' => $orderBy,
Expand All @@ -57,7 +58,9 @@ public function index(Request $request): View
*/
public function create(): View
{
return view('models.tags.create');
return view('models.tags.create', [
'pageTitle' => trans('tag.add'),
]);
}

/**
Expand Down Expand Up @@ -99,6 +102,7 @@ public function show(Request $request, Tag $tag): View
->paginate(getPaginationLimit());

return view('models.tags.show', [
'pageTitle' => trans('tag.tag') . ': ' . $tag->name,
'tag' => $tag,
'tagLinks' => $links,
'route' => $request->getBaseUrl(),
Expand All @@ -115,7 +119,10 @@ public function show(Request $request, Tag $tag): View
*/
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,
]);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Setup/AccountController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ protected function redirectTo(): string
*/
public function index(): View
{
return view('setup.account');
return view('setup.account', [
'pageTitle' => trans('setup.account_setup'),
]);
}

/**
Expand Down
4 changes: 3 additions & 1 deletion app/Http/Controllers/Setup/DatabaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
]);
}

/**
Expand Down
8 changes: 6 additions & 2 deletions app/Http/Controllers/Setup/MetaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class MetaController extends Controller
*/
public function welcome(): View
{
return view('setup.welcome');
return view('setup.welcome', [
'pageTitle' => trans('setup.setup'),
]);
}

/**
Expand All @@ -30,6 +32,8 @@ public function complete(): View
Setting::create(['key' => 'system_setup_completed', 'value' => true]);
Cache::forget('systemsettings');

return view('setup.complete');
return view('setup.complete', [
'pageTitle' => trans('setup.complete'),
]);
}
}
1 change: 1 addition & 0 deletions app/Http/Controllers/Setup/RequirementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function index(): View
[$success, $results] = $this->checkRequirements();

return view('setup.requirements', [
'pageTitle' => trans('setup.setup_requirements'),
'success' => $success,
'results' => $results,
]);
Expand Down
20 changes: 15 additions & 5 deletions app/Providers/FortifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,33 @@ public function boot(): void
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'),
]);
});
}
}
1 change: 1 addition & 0 deletions lang/de_DE/linkace.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'logout' => 'Abmelden',
'remember_me' => 'Angemeldet bleiben',
'go_to_dashboard' => 'Zur Übersicht gehen',
'dashboard' => 'Übersicht',
'system_logs' => 'System Logs',

'reset_password' => 'Passwort zurücksetzen',
Expand Down
1 change: 1 addition & 0 deletions lang/de_DE/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'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.',
];
1 change: 1 addition & 0 deletions lang/de_DE/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'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',
Expand Down
1 change: 1 addition & 0 deletions lang/en_US/linkace.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'logout' => 'Logout',
'remember_me' => 'Remember me',
'go_to_dashboard' => 'Go to the Dashboard',
'dashboard' => 'Dashboard',
'system_logs' => 'System Logs',

'reset_password' => 'Reset Password',
Expand Down
1 change: 1 addition & 0 deletions lang/en_US/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'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.',
];
1 change: 1 addition & 0 deletions lang/en_US/setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
'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',
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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">

Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 194787b

Please sign in to comment.