Bugzilla – Attachment 93748 Details for
Bug 22882
ItemType translation modal is not consistent with other modals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22882: ItemType translation modal is not consistent with other modals
Bug-22882-ItemType-translation-modal-is-not-consis.patch (text/plain), 5.28 KB, created by
Owen Leonard
on 2019-10-04 14:53:20 UTC
(
hide
)
Description:
Bug 22882: ItemType translation modal is not consistent with other modals
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2019-10-04 14:53:20 UTC
Size:
5.28 KB
patch
obsolete
>From 949027cf45c763e0e8b2f597b851da09f4a56025 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 4 Oct 2019 14:40:39 +0000 >Subject: [PATCH] Bug 22882: ItemType translation modal is not consistent with > other modals > >This patch modifies the itemtypes administration template replacing in >the translation process the Greybox modal with a Bootstrap modal. > >To test you should have at least one translation enabled. > > - Apply the patch and go to Administration -> Item types. > - Edit an existing item type. > - Click the "Translate into other languages" link by the "Description" > field. > - A Bootstrap-styled modal should appear. > - Test the process of adding and deleting a translation. > - Test hiding and redisplaying the modal dialog. >--- > .../prog/en/modules/admin/itemtypes.tt | 30 ++++++++++++++++++++-- > .../prog/en/modules/admin/localization.tt | 4 ++- > 2 files changed, 31 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index 666701f3124..cb6e0c669e6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -118,7 +118,7 @@ Item types administration > <label for="description" class="required">Description: </label> > <input type="text" id="description" name="description" size="48" value="[% itemtype.description | html %]" required="required" /> <span class="required">Required</span> > [% IF can_be_translated %] >- <a href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype | uri %]" title="Translate item type [% itemtype.itemtype | html %]" rel="gb_page_center[600,500]"><i class="fa fa-pencil"></i> Translate into other languages</a> >+ <a id="translate_itemtype" href="/cgi-bin/koha/admin/localization.pl?entity=itemtypes&code=[% itemtype.itemtype | uri %]" title="Translate item type [% itemtype.itemtype | html %]"><i class="fa fa-pencil"></i> Translate into other languages</a> > [% END %] > </li> > <li> >@@ -454,9 +454,26 @@ Item types administration > </div> <!-- /.col-sm-2.col-sm-pull-10 --> > </div> <!-- /.row --> > >+<!-- Modal --> >+<div class="modal" id="translateModal" tabindex="-1" role="dialog" aria-labelledby="translateModalLabel"> >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> >+ <h4 class="modal-title" id="translateModalLabel">Item type translation</h4> >+ </div> >+ <div class="modal-body"> >+ <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div> >+ </div> >+ <div class="modal-footer"> >+ <button type="button" class="btn btn-default deny" data-dismiss="modal">Done</button> >+ </div> >+ </div> <!-- /.modal-content --> >+ </div> <!-- /.modal-dialog --> >+</div> <!-- /#translateModal --> >+ > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/admin-menu.js") | $raw %] >- [% INCLUDE 'greybox.inc' %] > [% INCLUDE 'datatables.inc' %] > <script> > $(document).ready(function() { >@@ -480,6 +497,15 @@ Item types administration > toUC(this); > }); > $(".library_limitation").tooltip(); >+ >+ $("#translate_itemtype").on("click", function(e){ >+ e.preventDefault(); >+ $("#translateModal .modal-body").load( $(this).attr("href") ); >+ $("#translateModal").modal("show"); >+ }); >+ $("#translateModal").on("hidden.bs.modal", function(){ >+ $("#translateModal .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >index 95d2810d526..fe85686514a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/localization.tt >@@ -11,7 +11,7 @@ > <div class="container-fluid"> > <div class="row"> > <div class="col-sm-12"> >-<form id="add_translation" method="post"> >+<form id="add_translation" method="post" action="/cgi-bin/koha/admin/localization.pl"> > <input type="hidden" name="entity" value="[% entity | html %]" /> > <input type="hidden" name="code" value="[% code | html %]" /> > <input type="hidden" name="interface" value="[% interface_side | html %]" /> >@@ -57,6 +57,7 @@ > > <div class="row"> > <div class="col-sm-12"> >+[% IF ( translations ) %] > <table id="localization"> > <thead> > <tr> >@@ -81,6 +82,7 @@ > [% END %] > </tbody> > </table> >+[% END %] > </div> <!-- /.col-sm-12 --> > </div> <!-- /.row --> > </div> <!-- /.container-fluid --> >-- >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 22882
: 93748