Skip to content

Commit

Permalink
Set initial value for additional param pageTitle on Users and Apps se…
Browse files Browse the repository at this point in the history
…ttings pages

Signed-off-by: julia.kirschenheuter <julia.kirschenheuter@nextcloud.com>
  • Loading branch information
JuliaKirschenheuter committed Feb 13, 2023
1 parent 0f73b90 commit d334342
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/settings/lib/Controller/AppSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public function viewApps(): TemplateResponse {
$params['bundles'] = $this->getBundles();
$this->navigationManager->setActiveEntry('core_apps');

$templateResponse = new TemplateResponse('settings', 'settings-vue', ['serverData' => $params]);
$templateResponse = new TemplateResponse('settings', 'settings-vue', ['serverData' => $params, 'pageTitle' => $this->l10n->t('Apps')]);
$policy = new ContentSecurityPolicy();
$policy->addAllowedImageDomain('https://usercontent.apps.nextcloud.com');
$templateResponse->setContentSecurityPolicy($policy);
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/lib/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public function usersList(): TemplateResponse {
$serverData['newUserRequireEmail'] = $this->config->getAppValue('core', 'newUser.requireEmail', 'no') === 'yes';
$serverData['newUserSendEmail'] = $this->config->getAppValue('core', 'newUser.sendEmail', 'yes') === 'yes';

return new TemplateResponse('settings', 'settings-vue', ['serverData' => $serverData]);
return new TemplateResponse('settings', 'settings-vue', ['serverData' => $serverData, 'pageTitle' => $this->l10n->t('Users')]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/settings/src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ router.afterEach(async (to) => {
const metaTitle = await to.meta.title?.(to)
if (metaTitle) {
document.title = `${metaTitle} - ${baseTitle}`
document.getElementById('pageHeadingLevel2').textContent = `${t('settings', 'Subsection: ')} ${metaTitle}`
// document.getElementById('pageHeadingLevel1').textContent = metaTitle
} else {
document.title = baseTitle
}
Expand Down
7 changes: 2 additions & 5 deletions core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,9 @@
</div>

<header role="banner" id="header">
<h1 class="hidden-visually">
<?php p($l->t('Section').': ').p(!empty($_['application'])?$_['application']:''); ?>
<h1 class="hidden-visually" id="pageHeadingLevel1">
<?php p(!empty($_['pageTitle'])?$_['pageTitle']:''); ?>
</h1>
<h2 class="hidden-visually" id="pageHeadingLevel2">
<?php p($l->t('Subsection').': ').p(!empty($_['pageTitle'])?$_['pageTitle']:''); ?>
</h2>
<div class="header-left">
<a href="<?php print_unescaped($_['logoUrl'] ?: link_to('', 'index.php')); ?>"
id="nextcloud">
Expand Down

0 comments on commit d334342

Please sign in to comment.