From fbe589892afc9e96cf6b47fb6aa9047ee3973eb4 Mon Sep 17 00:00:00 2001 From: haszi Date: Wed, 17 Apr 2024 13:48:52 +0200 Subject: [PATCH] Move contribution links to the bottom of the documentation pages (#973) Co-authored-by: haszi --- include/shared-manual.inc | 45 +++++++++++++++++++++++---------------- styles/theme-base.css | 15 ++++++++----- 2 files changed, 37 insertions(+), 23 deletions(-) diff --git a/include/shared-manual.inc b/include/shared-manual.inc index a686b15ce..8bf4552a6 100644 --- a/include/shared-manual.inc +++ b/include/shared-manual.inc @@ -323,19 +323,6 @@ function manual_setup($setup): void { ]; site_header($setup["this"][1] . " - Manual ", $config); - $id = substr($setup['this'][0], 0, -4); - $repo = strtolower($config['lang']); // pt_BR etc. - - $edit_url = "https://github.com/php/doc-{$repo}"; - // If the documentation source information is available (generated using - // doc-base/configure.php and PhD) then try and make a source-specific URL. - if (isset($setup['source'])) { - $source_lang = $setup['source']['lang']; - if ($source_lang === $repo || $source_lang === 'base') { - $edit_url = "https://github.com/php/doc-{$source_lang}/blob/master/{$setup['source']['path']}"; - } - } - $languageChooser = manual_language_chooser($config['lang'], $config['thispage']); echo << {$languageChooser} - PAGE_TOOLS; } @@ -381,9 +364,35 @@ CHANGE_LANG; return trim($r); } -function manual_footer(): void { +function manual_footer($setup): void { global $USERNOTES, $__RELATED; + $id = substr($setup['this'][0], 0, -4); + $repo = strtolower($setup["head"][1]); // pt_BR etc. + + $edit_url = "https://github.com/php/doc-{$repo}"; + // If the documentation source information is available (generated using + // doc-base/configure.php and PhD) then try and make a source-specific URL. + if (isset($setup['source'])) { + $source_lang = $setup['source']['lang']; + if ($source_lang === $repo || $source_lang === 'base') { + $edit_url = "https://github.com/php/doc-{$source_lang}/blob/master/{$setup['source']['path']}"; + } + } + + echo << +

Improve This Page

+ + +CONTRIBUTE; + manual_notes($USERNOTES); site_footer([ 'related_menu' => $__RELATED['toc'], diff --git a/styles/theme-base.css b/styles/theme-base.css index ccf2444ef..b30c7f01f 100644 --- a/styles/theme-base.css +++ b/styles/theme-base.css @@ -419,14 +419,19 @@ hr { .page-tools { text-align: right; } - -.page-tools #changelang-langs, -.page-tools .edit-bug { +.page-tools #changelang-langs { font-size:.75rem; } -.page-tools .edit-bug a { + +.contribute { + border: 1px solid #888; + border-radius: 3px; + margin: 0px -10px 0px -10px; + padding: 0 10px 5px 10px; + background-color: #E2E2E2; +} +.contribute .edit-bug a { border: 0; - margin-left: 1rem; } /**