From 8e9652665fc24390c6f79da6701a6192cbfac129 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 29 Feb 2024 18:37:54 +0000 Subject: [PATCH] Bug 36207: Use confirmation modal when removing tags from titles in the OPAC This patch changes the process of removing a tag from a title on the user's tag list. It now uses a confirmation modal dialog instead of a JavaScript alert. The patch also makes some minor tweaks to CSS to correct style on "remove" links. To test, apply the patch and rebuild the OPAC CSS. - Log in to the OPAC as a user who has submitted multiple tags or tags on multiple items. - Open the "Tags" link in the sidebar of the user summary page. - Click the "Remove tag" link next to one of the titles in the table of the user's tags. - You should see a modal confirmation message, "Are you sure you want to remove the selected tag from this title?" It should show the title and the tag which will be removed. - Test both the "Yes, remove tag" and "No, do not remove tag" choices. - Check the box next to one of the tagged titles and click the "Remove selected tags" button at the bottom of the table. - You should see a modal confirmation message, "Are you sure you want to remove this item from the list?" It should show the title and the tag which will be removed. - Test boh the "Yes" and "No" choices. - Check the box next to multiple tagged titles and click the "Remove selected tags" button at the bottom of the table. - You should see a modal confirmation message, "Are you sure you want to remove the selected tags from these titles" It should show the titles of all the records you selected and the corresponding tags to be removed. - Test both the "Yes" and "No" choices. Signed-off-by: Lucas Gass Signed-off-by: Martin Renvoize (cherry picked from commit e834a575ae6ac2aacfd135c25c24438d0aa021e1) Signed-off-by: Lucas Gass --- .../opac-tmpl/bootstrap/css/src/opac.scss | 23 ++- .../bootstrap/en/modules/opac-tags.tt | 166 +++++++++++------- 2 files changed, 117 insertions(+), 72 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss index f0e99ebf61..da3a8c4206 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss +++ b/koha-tmpl/opac-tmpl/bootstrap/css/src/opac.scss @@ -129,15 +129,21 @@ a { &.incart { color: #666; } +} + +a, +button { + &.remove, + &.removeitems { + i.fa { + color: #C60000; + } - &.remove { &:hover { color: #900; - i { - .fa { - color: #C60000; - } + i.fa { + color: #C60000; } } } @@ -550,7 +556,12 @@ th { } } - &.remove { + &.remove, + &.removeitems { + i.fa { + color: #900; + } + &:hover { color: #900; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt index 01d6fd5726..b103319c6e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-tags.tt @@ -119,68 +119,74 @@ [% END # / TAGLOOP%] [% IF ( add_op ) %] [% IF ( added_count ) %] -
[% added_count | html %] [% IF ( added_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully added.
+
[% added_count | html %] [% IF ( added_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully added.
[% END %] [% IF ( deleted_count ) %] -
[% deleted_count | html %] [% IF ( deleted_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully deleted.
+
[% deleted_count | html %] [% IF ( deleted_count == 1 ) %]tag[% ELSE %]tags[% END %] successfully deleted.
[% END %] [% END # /add_op %] [% IF ( MY_TAGS ) %] -
- [% INCLUDE 'csrf-token.inc' %] - - - - - - - - - - - - - [% FOREACH MY_TAG IN MY_TAGS %] - [% IF MY_TAG.visible %] + +
Your tags
 TermTitleDate added
+ + - - - - - + + + + + + + + + [% FOREACH MY_TAG IN MY_TAGS %] + [% IF MY_TAG.visible %] + + + + + + + + + [% END %] [% END %] - [% END %] - -
Your tags
- - - Tag: - [% IF MY_TAG.approved == 1 %] - [% MY_TAG.term | html %] - [% ELSE %] - [% MY_TAG.term | html %] (not approved) - [% END %] - - [% IF ( MY_TAG.XSLTBloc ) %] - [% MY_TAG.XSLTBloc | $raw %] - [% ELSE %] - Title: - [% INCLUDE 'biblio-title.inc' biblio=MY_TAG link=> 1 %] - [% IF ( MY_TAG.author ) %] - by [% MY_TAG.author | html %] - [% END %] - [% END # /IF MY_TAG.XSLTBloc %] - - [% INCLUDE 'title-actions-menu.inc' items=MY_TAG %] - - Date added: - [% MY_TAG.date_created | $KohaDates %] -  TermTitleDate added
+ + + Tag: + [% IF MY_TAG.approved == 1 %] + [% MY_TAG.term | html %] + [% ELSE %] + [% MY_TAG.term | html %] (not approved) + [% END %] + + [% IF ( MY_TAG.XSLTBloc ) %] + [% MY_TAG.XSLTBloc | $raw %] + [% ELSE %] + Title: + [% INCLUDE 'biblio-title.inc' biblio=MY_TAG link=> 1 %] + [% IF ( MY_TAG.author ) %] + by [% MY_TAG.author | html %] + [% END %] + [% END # /IF MY_TAG.XSLTBloc %] + + [% INCLUDE 'title-actions-menu.inc' items=MY_TAG %] + + Date added: + [% MY_TAG.date_created | $KohaDates %] + + +
- - -
+ + + + +
+ [% INCLUDE 'csrf-token.inc' %] + +
[% END # /MY_TAGS %] @@ -193,21 +199,49 @@ [% INCLUDE 'datatables.inc' %]