From 0cfcda6cf3d1f84b1662c59fc53218c04585263a Mon Sep 17 00:00:00 2001
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: Fri, 24 May 2024 12:16:01 +0200
Subject: [PATCH] Split the install script in download/linux/debian
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Per Matthias Hörmann
---
 media/js/download.js                       |  5 +++++
 templates/pages/download/linux/debian.html | 12 +++++++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/media/js/download.js b/media/js/download.js
index 8493ef06..60bc9f6e 100644
--- a/media/js/download.js
+++ b/media/js/download.js
@@ -27,6 +27,11 @@ function setupHandlers() {
             copyScript(this, 'script-box2');
         });
     }
+    if (document.getElementById("copy-btn3") && document.getElementById("script-box3")) {
+        document.getElementById('copy-btn3').addEventListener('click', function () {
+            copyScript(this, 'script-box3');
+        });
+    }
 }
 
 document.addEventListener("DOMContentLoaded", setupHandlers);
diff --git a/templates/pages/download/linux/debian.html b/templates/pages/download/linux/debian.html
index 8f628deb..e5e9d04b 100644
--- a/templates/pages/download/linux/debian.html
+++ b/templates/pages/download/linux/debian.html
@@ -76,12 +76,18 @@ sudo curl -o /usr/share/postgresql-common/pgdg/apt.postgresql.org.asc --fail htt
 sudo sh -c 'echo "deb [signed-by=/usr/share/postgresql-common/pgdg/apt.postgresql.org.asc] https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
 
 # Update the package lists:
-sudo apt update
+sudo apt update</pre>
+    <button id="copy-btn2" class="pg-script-copy-btn">Copy Script</button>
+</div>
 
-# Install the latest version of PostgreSQL:
+<p>
+After the repository has been configured, packages can be installed with:
+</p>
+<div class="pg-script-container">
+    <pre id="script-box3" class="code"># Install the latest version of PostgreSQL:
 # If you want a specific version, use 'postgresql-16' or similar instead of 'postgresql'
 sudo apt -y install postgresql</pre>
-    <button id="copy-btn2" class="pg-script-copy-btn">Copy Script</button>
+    <button id="copy-btn3" class="pg-script-copy-btn">Copy Script</button>
 </div>
 
 <p>
-- 
2.39.2

