From 8c504189a7ac42a82971000fd2640f33dca34723 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 29 Oct 2024 11:35:39 +0000 Subject: [PATCH] Bug 37910: Update concerns styling to flexbox With the update to bootstrap 5 we loose some of the absolute and relative positioning helpers, namely pull-right, which were used in the catalog concerns pages. This patch updates the table and modal styling to use modern flexbox utlities from bootstrap 5 instead to improve the styling and fix the regressions. Signed-off-by: David Nind Signed-off-by: Aleisha Amohia --- .../prog/en/modules/cataloguing/concerns.tt | 33 +++++++-- .../prog/js/modals/display_ticket.js | 72 +++++++++++-------- 2 files changed, 69 insertions(+), 36 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt index a7452655fe5..25b5ec3b9d2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/concerns.tt @@ -127,13 +127,15 @@ "columns": [{ "data": "reported_date:reporter.firstname", "render": function(data, type, row, meta) { - let reported = '' + $datetime(row.reported_date) + ''; - reported += '' + $patron_to_html(row.reporter, { + let reported = '
'; + reported += '' + $patron_to_html(row.reporter, { display_cardnumber: false, url: true }) + ''; + reported += '' + $datetime(row.reported_date) + ''; + reported += '
'; return reported; - }, + }, "searchable": true, "orderable": true }, @@ -141,11 +143,20 @@ "data": "title:body", "render": function(data, type, row, meta) { let resolved = ( row.resolved_date ) ? true : false; - let result = '' + row.title + ''; + let result = '
'; + + // Title link on the left + result += '' + row.title + ''; + + // Updates count on the right, if it exists if (row.updates_count) { - result += ' ' + row.updates_count + ''; + result += ' ' + row.updates_count + ''; } + + // Hidden detail content + result += '
'; result += ''; + return result; }, "searchable": true, @@ -166,26 +177,34 @@ "render": function(data, type, row, meta) { let result = ''; if (row.resolved_date) { + result += "
"; result += _("Resolved by") + ' ' + $patron_to_html(row.resolver, { display_cardnumber: false, url: true }) + ''; + result += "
"; if (row.status) { + result += '
'; result += ' ' + _("as") + ' '; result += row._strings.status ? escape_str(row._strings.status.str) : ""; + result += '
'; } - result += '' + $datetime(row.resolved_date) + ''; + result += '
' + $datetime(row.resolved_date) + '
'; } else { + result += '
'; if (row.status) { result += row._strings.status ? escape_str(row._strings.status.str) : ""; } else { result += _("Open"); } + result += '
'; if (row.assignee) { - result += '' + _("Assigned to: ") + $patron_to_html(row.assignee, { + result += '
'; + result += _("Assigned to: ") + ' ' + $patron_to_html(row.assignee, { display_cardnumber: false, url: true }) + ''; + result += '
'; } } return result; diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js index 023b1a0b3af..43d32fd83e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js +++ b/koha-tmpl/intranet-tmpl/prog/js/modals/display_ticket.js @@ -22,22 +22,31 @@ $(document).ready(function () { $("#resolveTicket").show(); } + let title = $("#title_" + ticket_id).text(); let detail = $("#detail_" + ticket_id).text(); // Display ticket details let display = '
'; - display += '
'; + display += + '
'; + display += '
'; + display += '
' + title + "
"; + display += '
' + detail + "
"; + display += "
"; if (assignee) { + display += ""; display += - '' + + ': " + + ": " + + "" + assignee + ""; + display += ""; } - display += '' + detail + ""; display += "
"; - display += '
'; + display += + '
'; display += "" + __("Loading updates . . .") + ""; display += "
"; display += "
"; @@ -59,49 +68,54 @@ $(document).ready(function () { data.forEach(function (item, index) { if (item.public) { updates += - '
'; - updates += - '' + - __("Public") + - ""; + '
'; } else { updates += - '
'; - updates += - '' + - __("Private") + - ""; + '
'; } + updates += '
'; updates += - '' + item.message + ""; - updates += - '' + - $patron_to_html(item.user, { - display_cardnumber: false, - url: true, - }) + - " (" + - $datetime(item.date) + - ")"; + '
' + + item.message + + "
"; + updates += '
'; + if (item.public) { + updates += + '' + __("Public") + ""; + } else { + updates += + '' + __("Private") + ""; + } if (item.status) { - updates += ''; + updates += ''; updates += item._strings.status ? escape_str(item._strings.status.str) : ""; updates += ""; } if (item.assignee) { - updates += ''; + updates += ''; updates += $patron_to_html(item.assignee, { display_cardnumber: false, url: true, }); updates += ""; } - updates += ""; + updates += "
"; + updates += "
"; + updates += + '
' + + $patron_to_html(item.user, { + display_cardnumber: false, + url: true, + }) + + " (" + + $datetime(item.date) + + ")" + + "
"; updates += "
"; }); - updates_display.html(updates); + updates_display.replaceWith(updates); }) .error(function () {}); -- 2.39.5