Skip to content

Commit 98ce985

Browse files
cubercslmeisterT
authored andcommitted
fix(frontend): The line break in the tooltips
Fix the line break in the tooltips of public statistics. Bootstrap5 uses data-bs-* instead of data-*, so `data-html` should be replaced by `data-bs-html`. After that, <br/> can be shown as a line break correctly. Also, all the tooltips should be initialized by js. This is already done in `domjudge.js`, but it's also outdated. See also: https://getbootstrap.com/docs/5.0/migration/#javascript Closes #2613 Signed-off-by: cubercsl <[email protected]>
1 parent d0e01fa commit 98ce985

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

webapp/public/js/domjudge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ function setupPreviewClarification($input, $previewDiv, previewInitial) {
823823
}
824824

825825
$(function () {
826-
$('[data-toggle="tooltip"]').tooltip();
826+
$('[data-bs-toggle="tooltip"]').tooltip();
827827
});
828828

829829
function initializeKeyboardShortcuts() {

webapp/templates/jury/analysis/contest_overview.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ table tr a {
3636
Contest Stats
3737
</div>
3838
<div class="card-body">
39-
<abbr data-bs-toggle="popover" data-placement="bottom" data-bs-title="Misery Index" data-bs-content="
39+
<abbr data-bs-toggle="popover" data-bs-placement="bottom" data-bs-title="Misery Index" data-bs-content="
4040
This is a measure of how 'bored' contestants are. It is the average number of
4141
people-minutes spent fruitlessly trying to solve problems at the end of the contest.
4242
<br>

webapp/templates/jury/entity_id_badge.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<span class="badge text-bg-secondary id-badge" data-bs-toggle="tooltip" data-placement="top" title="{% if label is defined and label | length %}Label: {{ label }}, {% endif %}{% if externalId is not null %}External ID: {{ externalId }}, {% endif %}Internal ID: {{ idPrefix }}{{ id }}">
1+
<span class="badge text-bg-secondary id-badge" data-bs-toggle="tooltip" data-bs-placement="top" title="{% if label is defined and label | length %}Label: {{ label }}, {% endif %}{% if externalId is not null %}External ID: {{ externalId }}, {% endif %}Internal ID: {{ idPrefix }}{{ id }}">
22
{% if label is defined and label | length %}
33
{{ label }}
44
{% elseif externalId is not null %}

webapp/templates/partials/problem_list.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@
9292
<div
9393
class="problem-stats-item {{ itemClass }}"
9494
data-bs-toggle="tooltip"
95-
data-placement="top"
96-
data-html="true"
95+
data-bs-placement="top"
96+
data-bs-html="true"
9797
title="Between {{ stat.start.timestamp | printtime(null, contest) }} and {{ stat.end.timestamp | printtime(null, contest) }}:<br/>{{ label }}">
9898
</div>
9999
{% endfor %}

0 commit comments

Comments
 (0)