Bugzilla – Attachment 162112 Details for
Bug 36084
Pass CSRF token to SVC scripts (1/2)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36084: Add a global #messages div
Bug-36084-Add-a-global-messages-div.patch (text/plain), 6.38 KB, created by
Jonathan Druart
on 2024-02-13 14:25:16 UTC
(
hide
)
Description:
Bug 36084: Add a global #messages div
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-02-13 14:25:16 UTC
Size:
6.38 KB
patch
obsolete
>From 3e7bbc99617feafdd8d1be0383d37d56512f574a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 13 Feb 2024 15:16:38 +0100 >Subject: [PATCH] Bug 36084: Add a global #messages div > >--- > .../intranet-tmpl/prog/en/includes/messages.inc | 10 ++++++---- > .../prog/en/modules/tools/quotes-upload.tt | 17 +++++++++-------- > .../prog/en/modules/tools/upload-images.tt | 5 +++-- > .../intranet-tmpl/prog/js/upload-images.js | 6 +++--- > 4 files changed, 21 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messages.inc >index 3a0d205ddd3..58021386165 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messages.inc >@@ -1,4 +1,6 @@ >-[% INCLUDE 'blocking_errors.inc' %] >-[% IF dev_install && debug_programming_error %] >- <div class="dialog alert">Programming error: [% debug_programming_error %]</div> >-[% END %] >+<div id="messages"> >+ [% INCLUDE 'blocking_errors.inc' %] >+ [% IF dev_install && debug_programming_error %] >+ <div class="dialog alert">Programming error: [% debug_programming_error %]</div> >+ [% END %] >+</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >index a099d3ba6ba..8f85e6337d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >@@ -53,7 +53,8 @@ > > <h1>Quote uploader</h1> > >- <div id="messages" style="display: none;"> >+ [%# FIXME Remove the following div and use #message instead %] >+ <div id="messages_2" style="display: none;"> > <div class="import_success dialog message" style="display: none;"></div> > <div class="import_error dialog alert" style="display: none;"></div> > </div> >@@ -242,7 +243,7 @@ > if ( arrData[ arrData.length - 1 ] ) { > arrData[ arrData.length - 1 ].push( strMatchedValue ); > } else { >- $("#messages .import_error").text(_("Something went wrong, check your CSV file.")); >+ $("#messages_2 .import_error").text(_("Something went wrong, check your CSV file.")); > } > } > >@@ -389,24 +390,24 @@ > data : JSON.stringify(data), > dataType : "application/json", > success : function(data) { >- $("#messages").addClass("message").show(); >- var import_success = $("#messages .import_success"); >+ $("#messages_2").addClass("message").show(); >+ var import_success = $("#messages_2 .import_success"); > import_success.show(); > import_success.data("nb") > nb_success = import_success.data("nb") || 0; > nb_success++; >- $("#messages .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success)); >+ $("#messages_2 .import_success").text(MSG_IMPORT_SUCCESS.format(nb_success)); > import_success.data("nb", nb_success); > }, > error : function(xhr) { > if (xhr.status==201) { this.success(null, "Created", xhr); return; } >- $("#messages").addClass("alert").show(); >- var import_error = $("#messages .import_error"); >+ $("#messages_2").addClass("alert").show(); >+ var import_error = $("#messages_2 .import_error"); > import_error.show(); > import_error.data("nb") > nb_error = import_error.data("nb") || 0; > nb_error++; >- $("#messages .import_error").text(MSG_IMPORT_ERROR.format(nb_error)); >+ $("#messages_2 .import_error").text(MSG_IMPORT_ERROR.format(nb_error)); > import_error.data("nb", nb_error); > }, > }); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >index 3942d60f19f..30ff32172bc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload-images.tt >@@ -54,7 +54,7 @@ > background-color: #fff; > } > >- #messages { >+ #messages_2 { > font-weight: normal; > } > .cover_preview { >@@ -192,7 +192,8 @@ > > <div id="filedrag"> > <a id="click_to_select" href="#">Drop files here or click to select a file</a> >- <div id="messages"></div> >+ [%# FIXME Remove the following div and use #message instead %] >+ <div id="messages_2"></div> > </div> > > <div id="uploadpanel"> >diff --git a/koha-tmpl/intranet-tmpl/prog/js/upload-images.js b/koha-tmpl/intranet-tmpl/prog/js/upload-images.js >index 2871a22dcb8..ee478e60477 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/upload-images.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/upload-images.js >@@ -23,7 +23,7 @@ $(document).ready(function(){ > > $("#filedrag").on("click", ".cancel_image", function(){ > $("#click_to_select").show(); >- $("#messages").html(""); >+ $("#messages_2").html(""); > $("#fileToUpload").prop( "disabled", false ); > $("#process_images, #fileuploadstatus").hide(); > return false; >@@ -78,7 +78,7 @@ $(document).ready(function(){ > > function prepUpLoad( event ){ > $("#click_to_select,#upload_results").hide(); >- $("#messages").html(""); >+ $("#messages_2").html(""); > var file; > if( event ){ > file = event.originalEvent.dataTransfer.files[0]; >@@ -185,7 +185,7 @@ function ParseFile(file) { > > // output information > function Output(msg) { >- var m = document.getElementById("messages"); >+ var m = document.getElementById("messages_2"); > m.innerHTML = msg + m.innerHTML; > } > >-- >2.34.1
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 36084
:
162108
|
162109
|
162110
|
162111
|
162112
|
162133
|
162147
|
162150
|
162712