Bugzilla – Attachment 153080 Details for
Bug 29825
Preview of authority record on edit mode as MARC formatted view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29825: (follow-up) Some style fixes and modal correction
Bug-29825-follow-up-Some-style-fixes-and-modal-cor.patch (text/plain), 7.34 KB, created by
Phil Ringnalda
on 2023-07-05 21:32:05 UTC
(
hide
)
Description:
Bug 29825: (follow-up) Some style fixes and modal correction
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2023-07-05 21:32:05 UTC
Size:
7.34 KB
patch
obsolete
>From b13b42390f1c2fcce104c9d67e78631fb2ef8ebc Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 30 Jun 2023 19:48:04 +0000 >Subject: [PATCH] Bug 29825: (follow-up) Some style fixes and modal correction > >This patch makes a few coding style changes to the new JavaScript and >updates the Bootstrap modal markup to be in line with current standards. > >The previous patches lacked a trigger for the preview modal, so I added >that. Since the content of the modal uses spaces for formatting I added >monospace formatting to the modal body. > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > .../modals/edit_authority_preview.inc | 12 ++- > .../en/modules/authorities/authorities.tt | 79 ++++++++++--------- > 2 files changed, 50 insertions(+), 41 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_authority_preview.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_authority_preview.inc >index c4f9aae3fc..75742999ea 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_authority_preview.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/edit_authority_preview.inc >@@ -1,11 +1,15 @@ >-<div id="auEditPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="auEditPreview" aria-hidden="true"> >- <div class="modal-dialog"> >+<div class="modal" id="auEditPreview" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> >+ <div class="modal-dialog modal-wide" role="document"> > <div class="modal-content"> > <div class="modal-header"> >- <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">Ã</button> >- <h3 id="avCreateLabel">Preview based on MARC structure</h3> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span >+ aria-hidden="true">×</span></button> >+ <h3 class="modal-title" id="avCreateLabel">Preview based on MARC structure</h3> > </div> > <div class="modal-body" id="auloadpreview"></div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> >+ </div> > </div> <!-- /.modal-content --> > </div> <!-- /.modal-dialog --> > </div> <!-- /#auEditPreview --> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >index 0da900975f..fdef4340e7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/authorities.tt >@@ -91,56 +91,59 @@ > f.authtypecode.value = authtypecode; > f.submit(); > }); >- $('#preview').click(function (){ >- var content="<h3>Authority #: [% authid %]</h3><hr>"; >- content+="<div style='color:#004d99;'>"; >- var line=1; >- var has_input=0; >- var sf_has_input=0; >- $("#authoritytabs").find("[id^=tag_]").each(function(){ >+ $("#preview").click(function () { >+ var content = "<h3>Authority #: [% authid | html %]</h3><hr>"; >+ content += "<div style=\"color:#004d99;\">"; >+ var line = 1; >+ var has_input = 0; >+ var sf_has_input = 0; >+ $("#authoritytabs").find("[id^=tag_]").each(function () { > //check if tag has content >- has_input=0; >- $(this).find(".input_marceditor").each(function(){ >- if($(this).val()) has_input=1; >+ has_input = 0; >+ $(this).find(".input_marceditor").each(function () { >+ if ($(this).val()) has_input = 1; > }); > >- if(has_input){ >- line=1; >+ if (has_input) { >+ line = 1; > //tag > var $tag = $(this).find(".tagnum").text(); >- content += $tag.replace("*",") +" "; >+ content += $tag.replace("*", "") + " "; > //indicators >- $(this).find(".indicator").each(function(){ >- if( $(this).val() ) content += $(this).val(); >+ $(this).find(".indicator").each(function () { >+ if ($(this).val()) content += $(this).val(); > else content += "_"; > }); > content += " "; > //subfields >- $(this).find(".subfield_line").each(function(){ >+ $(this).find(".subfield_line").each(function () { > //check if subfield has content >- sf_has_input=0; >- $(this).find(".input_marceditor").each(function(){ >- if($(this).val()) sf_has_input=1; >- }); >- if(sf_has_input){ >- if(line>1) content += " "; >- //code >- $(this).find(".subfieldcode").each(function(){ >- $(this).find(".flat").each(function(){ >- if($(this).val()!="00") >- content += "\$"+$(this).val()+" "; >- }); >- }); >- //value >- $(this).find(".input_marceditor").each(function(){ >- content += "<span style='color:#000;'>"+$(this).val()+"</span>"; >+ sf_has_input = 0; >+ $(this).find(".input_marceditor").each(function () { >+ if ($(this).val()) sf_has_input = 1; > }); >- content+="</br>"; >- line+=1; >- } >+ if (sf_has_input) { >+ if (line > 1) content += " "; >+ //code >+ $(this).find(".subfieldcode").each(function () { >+ $(this).find(".flat").each(function () { >+ if ($(this).val() != "00") >+ content += "\$" + $(this).val() + " "; >+ }); >+ }); >+ //value >+ $(this).find(".input_marceditor").each(function () { >+ content += "<span style=\"color:#000;\">" + $(this).val() + "</span>"; >+ }); >+ content += "</br>"; >+ line += 1; >+ } >+ }); > } > }); >- }); >+ $("#auloadpreview").html( content ); >+ $("#auEditPreview").modal(); >+ }); > }); > > function selectTab( tablink ){ >@@ -305,7 +308,9 @@ > } > </script> > [% Asset.css("css/addbiblio.css") | $raw %] >- >+<style> >+ #auloadpreview { font-family: monospace; } >+</style> > </head> > <body id="auth_authorities" class="auth"> > >-- >2.40.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 29825
:
140063
|
140115
|
140180
|
140181
|
140182
|
140183
|
140184
|
140185
|
140186
|
152915
|
152916
|
152917
|
153078
|
153079
|
153080
|
159200
|
159201
|
164126
|
164127