From 7bc6ff8c348b051abf67054617fdc6ba045a3136 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Tue, 18 Apr 2023 12:46:31 -0400 Subject: [PATCH] feat: pre-fill location to Unit URL in Studio sidebar Studio has a panel on the right side in the Unit view that shows authors how to create a jump_to_id link to that Unit from HTML components that are elsewhere in the course. However, that link was the literal text: "/jump_to_id/" The expectation was that people would then copy the location ID as well, and construct the link manually. This commit is a minor tweak that just displays the link address with the location ID pre-filled. Doing this does cause a little bit of text overflow, which is why this commit also removes the quotes surrounding the URL. It's still doesn't always fit perfectly, but the increased usability is worth the small visual issue. --- cms/templates/container.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cms/templates/container.html b/cms/templates/container.html index 17de3d20ea..d1a743b128 100644 --- a/cms/templates/container.html +++ b/cms/templates/container.html @@ -203,7 +203,9 @@ from openedx.core.djangolib.markup import HTML, Text
${_("Location ID")}

${unit.location.block_id} - Tip: ${Text(_('To create a link to this unit from an HTML component in this course, enter "/jump_to_id/" as the URL value.'))} + Tip: ${Text(_('To create a link to this unit from an HTML component in this course, enter {unit_link} as the URL value.')).format( + unit_link="/jump_to_id/{}".format(unit.location.block_id) + )}