diff options
author | Simon L <szaimen@e.mail.de> | 2023-10-05 13:05:22 +0200 |
---|---|---|
committer | Simon L <szaimen@e.mail.de> | 2023-10-05 15:42:47 +0200 |
commit | 6439fdf5b61d982838daf3c5b553577e5d54392c (patch) | |
tree | 4f463713b808762a1a066a0a1d74d329ce198e65 /apps | |
parent | f3f2d9b9784ef3a9304543969a0a88cd1f1054d8 (diff) | |
download | nextcloud-server-6439fdf5b61d982838daf3c5b553577e5d54392c.tar.gz nextcloud-server-6439fdf5b61d982838daf3c5b553577e5d54392c.zip |
Move inline docs to online documentation
Signed-off-by: Simon L <szaimen@e.mail.de>
Diffstat (limited to 'apps')
-rw-r--r-- | apps/settings/appinfo/routes.php | 2 | ||||
-rw-r--r-- | apps/settings/css/help.css | 36 | ||||
-rw-r--r-- | apps/settings/lib/Controller/HelpController.php | 21 | ||||
-rw-r--r-- | apps/settings/templates/help.php | 60 |
4 files changed, 51 insertions, 68 deletions
diff --git a/apps/settings/appinfo/routes.php b/apps/settings/appinfo/routes.php index e238510b1a7..d13984e315e 100644 --- a/apps/settings/appinfo/routes.php +++ b/apps/settings/appinfo/routes.php @@ -77,7 +77,7 @@ return [ ['name' => 'TwoFactorSettings#update', 'url' => '/settings/api/admin/twofactorauth', 'verb' => 'PUT' , 'root' => ''], ['name' => 'AISettings#update', 'url' => '/settings/api/admin/ai', 'verb' => 'PUT' , 'root' => ''], - ['name' => 'Help#help', 'url' => '/settings/help/{mode}', 'verb' => 'GET', 'defaults' => ['mode' => ''] , 'root' => ''], + ['name' => 'Help#help', 'url' => '/settings/help', 'verb' => 'GET', 'root' => ''], ['name' => 'WebAuthn#startRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'GET' , 'root' => ''], ['name' => 'WebAuthn#finishRegistration', 'url' => '/settings/api/personal/webauthn/registration', 'verb' => 'POST' , 'root' => ''], diff --git a/apps/settings/css/help.css b/apps/settings/css/help.css index a18538c20e6..e5fdd04af7f 100644 --- a/apps/settings/css/help.css +++ b/apps/settings/css/help.css @@ -1,16 +1,32 @@ -.help-includes { - overflow: hidden !important; -} - .help-list__text { margin-left: 24px; } -.help-iframe { - width: 100%; +.help-wrapper { + display: flex; + justify-content: center; + align-items: center; height: 100%; - margin: 0; - padding: 0; - border: 0; - overflow: auto; + width: 100%; +} + +.help-content__heading { + text-align: center; + padding: 20px; +} + +.help-content { + display: block; + padding: 20px; +} + +.help-content__body { + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; +} + +.help-content__body > .button { + margin: 20px; } diff --git a/apps/settings/lib/Controller/HelpController.php b/apps/settings/lib/Controller/HelpController.php index aa850b7d42e..cf202c28d98 100644 --- a/apps/settings/lib/Controller/HelpController.php +++ b/apps/settings/lib/Controller/HelpController.php @@ -79,32 +79,19 @@ class HelpController extends Controller { * @NoAdminRequired * @NoSubAdminRequired */ - public function help(string $mode = 'user'): TemplateResponse { + public function help(): TemplateResponse { $this->navigationManager->setActiveEntry('help'); - $pageTitle = $this->l10n->t('Administrator documentation'); - if ($mode !== 'admin') { - $pageTitle = $this->l10n->t('User documentation'); - $mode = 'user'; - } + $pageTitle = $this->l10n->t('Nextcloud help overview'); - $documentationUrl = $this->urlGenerator->getAbsoluteURL( - $this->urlGenerator->linkTo('', 'core/doc/' . $mode . '/index.html') - ); - - $urlUserDocs = $this->urlGenerator->linkToRoute('settings.Help.help', ['mode' => 'user']); - $urlAdminDocs = $this->urlGenerator->linkToRoute('settings.Help.help', ['mode' => 'admin']); + $urlUserDocs = $this->urlGenerator->linkToDocs('user'); + $urlAdminDocs = $this->urlGenerator->linkToDocs('admin'); $response = new TemplateResponse('settings', 'help', [ 'admin' => $this->groupManager->isAdmin($this->userId), - 'url' => $documentationUrl, 'urlUserDocs' => $urlUserDocs, 'urlAdminDocs' => $urlAdminDocs, - 'mode' => $mode, 'pageTitle' => $pageTitle, ]); - $policy = new ContentSecurityPolicy(); - $policy->addAllowedFrameDomain('\'self\''); - $response->setContentSecurityPolicy($policy); return $response; } } diff --git a/apps/settings/templates/help.php b/apps/settings/templates/help.php index 18cba18559a..58e38feb64c 100644 --- a/apps/settings/templates/help.php +++ b/apps/settings/templates/help.php @@ -1,48 +1,28 @@ <?php \OC_Util::addStyle('settings', 'help'); ?> -<div id="app-navigation" role="navigation" tabindex="0"> - <ul> - <li> - <a class="icon-user <?php if ($_['mode'] === 'user') { - p('active'); -} ?>" <?php if ($_['mode'] === 'user') { print_unescaped('aria-current="page"'); } ?> - href="<?php print_unescaped($_['urlUserDocs']); ?>"> - <span class="help-list__text"> - <?php p($l->t('User documentation')); ?> - </span> - </a> - </li> - <?php if ($_['admin']) { ?> - <li> - <a class="icon-user-admin <?php if ($_['mode'] === 'admin') { - p('active'); -} ?>" <?php if ($_['mode'] === 'admin') { print_unescaped('aria-current="page"'); } ?> + +<div id="app-content"> + <div class="help-wrapper"> + <div class="help-content"> + <h2 class="help-content__heading"> + <?php p($l->t('Nextcloud help overview')); ?> + </h2> + <div class="help-content__body"> + <a class="button" target="_blank" rel="noreferrer noopener" href="<?php print_unescaped($_['urlAdminDocs']); ?>"> - <span class="help-list__text"> - <?php p($l->t('Administrator documentation')); ?> - </span> + <?php p($l->t('Administration documentation')); ?> ↗ </a> - </li> - <?php } ?> - - <li> - <a href="https://docs.nextcloud.com" class="icon-category-office" target="_blank" rel="noreferrer noopener"> - <span class="help-list__text"> - <?php p($l->t('Documentation')); ?> ↗ - </span> + <a class="button" target="_blank" rel="noreferrer noopener" + href="<?php print_unescaped($_['urlUserDocs']); ?>"> + <?php p($l->t('Account documentation')); ?> ↗ </a> - </li> - <li> - <a href="https://help.nextcloud.com" class="icon-comment" target="_blank" rel="noreferrer noopener"> - <span class="help-list__text"> - <?php p($l->t('Forum')); ?> ↗ - </span> + <a href="https://docs.nextcloud.com" class="button" target="_blank" rel="noreferrer noopener"> + <?php p($l->t('General documentation')); ?> ↗ </a> - </li> -</div> - -<div id="app-content" class="help-includes"> - <iframe src="<?php print_unescaped($_['url']); ?>" class="help-iframe" tabindex="0"> - </iframe> + <a href="https://help.nextcloud.com" class="button" target="_blank" rel="noreferrer noopener"> + <?php p($l->t('Forum')); ?> ↗ + </a> + </div> + </div> </div> |