Bugzilla – Attachment 97591 Details for
Bug 24341
Add support for more complex markup in OPAC confirmation dialogs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24341: Allow for more complex markup in OPAC confirmation dialogs
Bug-24341-Allow-for-more-complex-markup-in-OPAC-co.patch (text/plain), 3.63 KB, created by
Katrin Fischer
on 2020-01-19 21:44:22 UTC
(
hide
)
Description:
Bug 24341: Allow for more complex markup in OPAC confirmation dialogs
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2020-01-19 21:44:22 UTC
Size:
3.63 KB
patch
obsolete
>From e38fa41ab5b5d80f29c981740b494864f8dd95f8 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 3 Jan 2020 17:40:34 +0000 >Subject: [PATCH] Bug 24341: Allow for more complex markup in OPAC confirmation > dialogs > >This patch changes the globally-available confirmModal() function in the >OPAC so that it uses jQuery's html() function for adding information to >the confirmation modal's body. This will allow for more than just plain >text to be added. > >This patch also removes some obsolete lines from the JavaScript in >opac-user.tt and renames some variable for clarity. > >To test, apply the patch log in to the OPAC as a user who has holds and >article requests. > > - Test the following interactions, both the confirmation and cancel > options for each: > - Cancel a hold > - Suspend all holds > - Resume all holds > - Cancel an article request > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 ++---- > koha-tmpl/opac-tmpl/bootstrap/js/global.js | 2 +- > 2 files changed, 3 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 96c494c949..879867af0a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -750,7 +750,6 @@ > e.preventDefault(); > var hold_title = $(this).data("title"); > var reserve_id = $(this).data("reserve_id"); >- var body = "<p><strong>" + hold_title + "</strong></p>"; > confirmModal( hold_title, _("Are you sure you want to cancel this hold?"), _("Yes, cancel hold"), _("No, do not cancel hold"), function( result ){ > if( result ){ > $("#delete_hold_" + reserve_id ).submit(); >@@ -761,10 +760,9 @@ > > $(".btn-delete-article-request").on("click", function(e){ > e.preventDefault(); >- var hold_title = $(this).data("title"); >+ var article_request = $(this).data("title"); > var article_request_id = $(this).data("article-request_id"); >- var body = "<p><strong>" + hold_title + "</strong></p>"; >- confirmModal( hold_title, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), function( result ){ >+ confirmModal( article_request, _("Are you sure you want to cancel this article request?"), _("Yes, cancel article request"), _("No, do not cancel article request"), function( result ){ > if( result ){ > $("#delete_article_request_" + article_request_id ).submit(); > } >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/global.js b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >index 7f95b324ff..84ee7e844b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/global.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/global.js >@@ -82,7 +82,7 @@ function confirmModal(message, title, yes_label, no_label, callback) { > } > > $("#bootstrap-confirm-box-modal .modal-header h4").text( title || "" ); >- $("#bootstrap-confirm-box-modal .modal-body p").text( message || "" ); >+ $("#bootstrap-confirm-box-modal .modal-body").html( message || "" ); > $("#bootstrap-confirm-box-modal-submit").text( yes_label || 'Confirm' ); > $("#bootstrap-confirm-box-modal-cancel").text( no_label || 'Cancel' ); > $("#bootstrap-confirm-box-modal").modal('show'); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24341
:
96796
|
97420
| 97591