From 9c77f7caeb3098152b98e5e3b8a958c2e92fe920 Mon Sep 17 00:00:00 2001 From: Florrie Date: Wed, 14 Nov 2018 22:05:02 -0400 Subject: Author/remix info --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 7a2d009..1ad3e1f 100755 --- a/index.js +++ b/index.js @@ -366,8 +366,19 @@ const handleRequest = async (request, response) => { return } + let parentProjectText = '' + if (project.remix.parent) { + const parentProject = await getProject(project.remix.parent, cookie.token) + if (parentProject.code === 'NotFound') { + parentProjectText = ` Based on an unshared project.` + } else { + parentProjectText = ` Based on ${templates.project(parentProject.title, parentProject.id)} by ${templates.user(parentProject.author.username)}.` + } + } + await page(request, response, fixWS`

${project.title}

+

Created by ${templates.user(project.author.username)}.${parentProjectText}

The thumbnail for this project

${project.instructions ? fixWS`

Instructions

-- cgit 1.3.0-6-gf8a5