From dd9a991f4ba6f9d2681c7a71510af1320ea162a2 Mon Sep 17 00:00:00 2001 From: Jaimos Skriletz Date: Tue, 3 Mar 2026 15:17:22 -0700 Subject: [PATCH] ProblemSets: Place set description in info button. Move the set description from a tooltip on the link to the set to a tooltip on an info button located just right of the set link if the set description is not empty. This adds an additional option to the `set-id-tooltip` class JavaScript that if `data-fallback-placements` is set as a spaced separated list list, that list will be passed to the bootstrap Tooltip on creation. --- htdocs/js/System/system.js | 3 ++- .../ContentGenerator/ProblemSets/set_list_row.html.ep | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/js/System/system.js b/htdocs/js/System/system.js index 634f07a87c..4b32aca942 100644 --- a/htdocs/js/System/system.js +++ b/htdocs/js/System/system.js @@ -74,7 +74,8 @@ // FIXME: These are really general purpose tooltips and not just in the homework sets editor. So the class name // should be chosen to better reflect this. document.querySelectorAll('.set-id-tooltip').forEach((el) => { - if (el.dataset.bsTitle) new bootstrap.Tooltip(el, { fallbackPlacements: [] }); + if (el.dataset.bsTitle) + new bootstrap.Tooltip(el, { fallbackPlacements: el.dataset.fallbackPlacements?.split(' ') || [] }); }); // Hardcopy tooltips shown on the Problem Sets page. diff --git a/templates/ContentGenerator/ProblemSets/set_list_row.html.ep b/templates/ContentGenerator/ProblemSets/set_list_row.html.ep index 1e1d7f13a2..9e9852a58f 100644 --- a/templates/ContentGenerator/ProblemSets/set_list_row.html.ep +++ b/templates/ContentGenerator/ProblemSets/set_list_row.html.ep @@ -17,9 +17,16 @@
<%= link_to $display_name => $c->systemLink(url_for('problem_list', setID => $set->set_id)), - class => 'fw-bold set-id-tooltip', - data => { bs_toggle => 'tooltip', bs_placement => 'right', bs_title => $set->description } + class => 'fw-bold' =%> + % if ($set->description =~ /\S/) { + + + <%= maketext('Assignment Description') =%> + + % }
<%= $status_msg %>
% if (!$set->visible && $authz->hasPermissions(param('user'), 'view_unopened_sets')) {