From 5d5ee9980cd046221975b2d9b990e33bc933aa89 Mon Sep 17 00:00:00 2001 From: Srivarshan-T Date: Sat, 19 Jul 2025 13:37:14 +0530 Subject: [PATCH] Add clickable title for issues --- package-lock.json | 6 ++++++ scripts/list_item.js | 19 +++++++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..0be495b8 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,6 @@ +{ + "name": "goodfirstissues", + "lockfileVersion": 3, + "requires": true, + "packages": {} +} diff --git a/scripts/list_item.js b/scripts/list_item.js index 85f5bee4..99ffbd91 100644 --- a/scripts/list_item.js +++ b/scripts/list_item.js @@ -51,14 +51,25 @@ function createListGroupItemForIssue(issue) { heading_div.setAttribute("class", "d-flex justify-content-between"); // Issue's title + // Create the h5 container let heading_h5 = document.createElement("h5"); - heading_h5.setAttribute("class", - "issue-title mb-0 d-inline-block text-truncate"); + heading_h5.setAttribute("class", "issue-title mb-0 d-inline-block text-truncate"); heading_h5.setAttribute("aria-label", `Issue: ${issue_title}`); - let issue_title_textnode = document.createTextNode(issue_title); - heading_h5.appendChild(issue_title_textnode); + + // Create the anchor tag for the clickable issue title + let issue_link = document.createElement("a"); + issue_link.setAttribute("href", issue_url); + issue_link.setAttribute("target", "_blank"); + issue_link.setAttribute("class", "text-decoration-none text-dark"); // Optional styling + issue_link.textContent = issue_title; + + // Append the link inside the h5 + heading_h5.appendChild(issue_link); + + // Append the h5 to its container heading_div.appendChild(heading_h5); + // Time of issue let time_of_issue = document.createElement("p"); time_of_issue.setAttribute("class", "mb-1 text-justify font-weight-light");