Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor projects page #294

Merged
merged 24 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Updated project card url
Signed-off-by: Natalia Luzuriaga <natalia.luzuriaga@cms.hhs.gov>
  • Loading branch information
natalialuzuriaga committed Dec 6, 2024
commit 09257914223705ec242f34bc0f523cf57b222506
3 changes: 2 additions & 1 deletion app/src/js/projects.js
DinneK marked this conversation as resolved.
Show resolved Hide resolved
DinneK marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function createProjectCards() {
projectSectionsTemplate.appendChild(projectCards);

groupedByOrg[org].forEach(repoData => {
repoData.url = siteData.baseurl;
repoData.baseurl = siteData.baseurl;
const projectCard = document.createElement('li');
projectCard.className = 'usa-card project-card tablet:grid-col-12';
projectCard.id = repoData.name;
Expand Down Expand Up @@ -333,6 +333,7 @@ function renderPaginatedProjects(projects = parsedProjectsData) {
projectCards.className = "usa-card-group flex-align-stretch";

groupedByOrg[org].forEach(repoData => {
repoData.baseurl = siteData.baseurl;
const projectCard = document.createElement('li');
projectCard.className = 'usa-card project-card tablet:grid-col-12';
projectCard.id = repoData.name;
Expand Down
3 changes: 1 addition & 2 deletions app/src/js/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export const reportHeadingTemplate = function(data) {


export function projectCardTemplate(data) {
const baseUrl = window.location.hostname.includes("dsacms.github.io") || window.location.hostname === "localhost" ? '/metrics' : "";
const projectUrl = `${baseUrl}/${ data.owner }/${ data.name }/`;
const projectUrl = `${data.baseurl}/${ data.owner }/${ data.name }/`;
const description = data.description !== null ? data.description : "";

return `
Expand Down
Loading