Author: haszi (haszi)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2024-04-17T12:48:52+01:00

Commit: 
https://github.com/php/web-php/commit/fbe589892afc9e96cf6b47fb6aa9047ee3973eb4
Raw diff: 
https://github.com/php/web-php/commit/fbe589892afc9e96cf6b47fb6aa9047ee3973eb4.diff

Move contribution links to the bottom of the documentation pages (#973)

Co-authored-by: haszi <haszik...@gmail.com>

Changed paths:
  M  include/shared-manual.inc
  M  styles/theme-base.css


Diff:

diff --git a/include/shared-manual.inc b/include/shared-manual.inc
index a686b15cef..8bf4552a64 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 <<<PAGE_TOOLS
@@ -343,10 +330,6 @@ function manual_setup($setup): void {
     <div class="change-language">
       {$languageChooser}
     </div>
-    <div class="edit-bug">
-      <a href="{$edit_url}">Submit a Pull Request</a>
-      <a 
href="https://github.com/php/doc-{$repo}/issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F$id%0A%0A---";>Report
 a Bug</a>
-    </div>
   </div>
 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 <<<CONTRIBUTE
+    <div class="contribute">
+      <h3 class="title">Improve This Page</h3>
+      <div class="edit-bug">
+        <a href="https://github.com/php/doc-base/blob/master/README.md"; 
title="This will take you to our contribution guidelines on GitHub." 
target="_blank" rel="noopener noreferrer">Learn how improve this page</a>
+        •
+        <a href="{$edit_url}">Submit a Pull Request</a>
+        •
+        <a 
href="https://github.com/php/doc-{$repo}/issues/new?body=From%20manual%20page:%20https:%2F%2Fphp.net%2F$id%0A%0A---";>Report
 a Bug</a>
+      </div>
+    </div>
+CONTRIBUTE;
+
     manual_notes($USERNOTES);
     site_footer([
         'related_menu' => $__RELATED['toc'],
diff --git a/styles/theme-base.css b/styles/theme-base.css
index ccf2444ef0..b30c7f01f5 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;
 }
 
 /**

Reply via email to