Bug 23838: (QA follow-up) Move include files
authorTomas Cohen Arazi <tomascohen@theke.io>
Fri, 22 Jul 2022 15:46:30 +0000 (12:46 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Fri, 22 Jul 2022 15:53:50 +0000 (12:53 -0300)
As talked with Martin, this patches were originally developed before we
added the modals/ and str/ dirs, but we need to align it with current
way of doing it. This patch does that.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal-strings.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal.inc [deleted file]
koha-tmpl/intranet-tmpl/prog/en/includes/modals/checkout_renewals.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/includes/str/checkout_renewals.inc [new file with mode: 0644]
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt
koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt
koha-tmpl/intranet-tmpl/prog/js/checkout-renewal-modal.js [deleted file]
koha-tmpl/intranet-tmpl/prog/js/checkout_renewals_modal.js [new file with mode: 0644]

diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal-strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal-strings.inc
deleted file mode 100644 (file)
index dde6014..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<script>
-    var renewed_prop = _("Note: %s out of %s renewals have been logged");
-    var renewed = _("Renewed by");
-</script>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkout-renewal-modal.inc
deleted file mode 100644 (file)
index baeb67d..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-<div id="checkoutRenewals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="checkoutRenewalsLabel" aria-hidden="true">
-    <div class="modal-dialog">
-        <div class="modal-content">
-            <div class="modal-header">
-                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
-                <h3 id="checkoutRenewalsLabel"> Item renewals</h3>
-            </div>
-            <div class="modal-body">
-                <div id="retrieving" class="alert" style="display:none">Retrieving renewals...</div>
-                <div id="incomplete" class="alert" style="display:none"></div>
-                <ul id="results" style="display:none"></ul>
-            </div>
-            <div class="modal-footer">
-                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
-            </div>
-        </div>
-    </div>
-</div>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/modals/checkout_renewals.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/modals/checkout_renewals.inc
new file mode 100644 (file)
index 0000000..1748ac5
--- /dev/null
@@ -0,0 +1,19 @@
+<!-- Checkout renewals modal -->
+<div id="checkoutRenewals" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="checkoutRenewalsLabel" aria-hidden="true">
+    <div class="modal-dialog">
+        <div class="modal-content">
+            <div class="modal-header">
+                <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
+                <h3 id="checkoutRenewalsLabel"> Item renewals</h3>
+            </div> <!-- /.modal-header -->
+            <div class="modal-body">
+                <div id="retrieving" class="alert" style="display:none">Retrieving renewals...</div>
+                <div id="incomplete" class="alert" style="display:none"></div>
+                <ul id="results" style="display:none"></ul>
+            </div> <!-- /.modal-body -->
+            <div class="modal-footer">
+                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
+            </div> <!-- /.modal-footer -->
+        </div> <!-- /.modal-content -->
+    </div> <!-- /.modal-dialog -->
+</div> <!-- /#checkoutRenewals -->
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/str/checkout_renewals.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/str/checkout_renewals.inc
new file mode 100644 (file)
index 0000000..a8dfcde
--- /dev/null
@@ -0,0 +1,5 @@
+<!-- str/checkout_renewals.inc -->
+<script>
+    var renewed_prop = _("Note: %s out of %s renewals have been logged");
+    var renewed = _("Renewed by");
+</script>
index cdb239e..3bb6dc5 100644 (file)
 
 [% MACRO jsinclude BLOCK %]
     [% INCLUDE 'catalog-strings.inc' %]
-    [% INCLUDE 'checkout-renewal-modal.inc' %]
-    [% INCLUDE 'checkout-renewal-modal-strings.inc' %]
+    [% INCLUDE 'modals/checkout_renewals.inc' %]
+    [% INCLUDE 'str/checkout_renewals.inc' %]
     [% INCLUDE 'js-date-format.inc' %]
     [% INCLUDE 'js-patron-format.inc' %]
     [% Asset.js("js/catalog.js") | $raw %]
     [% Asset.js("js/browser.js") | $raw %]
-    [% Asset.js("js/checkout-renewal-modal.js") | $raw %]
+    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
     <script>
         var browser = KOHA.browser('[% searchid | html %]', parseInt('[% biblionumber | html %]', 10));
         browser.show();
index 5901b2a..f312164 100644 (file)
     [% Asset.js("js/members-menu.js") | $raw %]
     [% INCLUDE 'datatables.inc' %]
     [% INCLUDE 'columns_settings.inc' %]
-    [% INCLUDE 'checkout-renewal-modal.inc' %]
-    [% INCLUDE 'checkout-renewal-modal-strings.inc' %]
+    [% INCLUDE 'modals/checkout_renewals.inc' %]
+    [% INCLUDE 'str/checkout_renewals.inc' %]
     [% INCLUDE 'js-date-format.inc' %]
     [% INCLUDE 'js-patron-format.inc' %]
-    [% Asset.js("js/checkout-renewal-modal.js") | $raw %]
+    [% Asset.js("js/checkout_renewals_modal.js") | $raw %]
     <script id="js">
         $(document).ready(function() {
             var table_settings = [% TablesSettings.GetTableSettings('members', 'checkouthistory', 'checkouthistory-table', 'json') | $raw %];
diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkout-renewal-modal.js b/koha-tmpl/intranet-tmpl/prog/js/checkout-renewal-modal.js
deleted file mode 100644 (file)
index d6448eb..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-$(document).ready(function(){
-    // Display the modal containing checkout renewals details
-    $('.checkout_renewals_view').on('click', function(e) {
-        e.preventDefault();
-        $('#checkoutRenewals #incomplete').html('').hide();
-        $('#checkoutRenewals #results').html('').hide();
-        $('#checkoutRenewals').modal({show:true});
-        var renewals = $(this).data('renewals');
-        var checkoutID = $(this).data('issueid');
-        $('#checkoutRenewals #retrieving').show();
-        $.get({ 'url': '/api/v1/checkouts/'+checkoutID+'/renewals', 'headers': { 'x-koha-embed': 'renewer' } }, function(data) {
-            if (data.length < renewals) {
-                $('#checkoutRenewals #incomplete').append(renewed_prop.format(data.length, renewals)).show();
-            }
-            var items = data.map(function(item) {
-                return createLi(item);
-            });
-            $('#checkoutRenewals #retrieving').hide();
-            $('#checkoutRenewals #results').append(items).show();
-        });
-    });
-    function createLi(renewal) {
-        return '<li><span style="font-weight:bold">' + $datetime(renewal.timestamp) + '</span> ' + renewed + ' <span style="font-weight:bold">' + $patron_to_html(renewal.renewer) + '</span></li>';
-    }
-});
diff --git a/koha-tmpl/intranet-tmpl/prog/js/checkout_renewals_modal.js b/koha-tmpl/intranet-tmpl/prog/js/checkout_renewals_modal.js
new file mode 100644 (file)
index 0000000..d6448eb
--- /dev/null
@@ -0,0 +1,25 @@
+$(document).ready(function(){
+    // Display the modal containing checkout renewals details
+    $('.checkout_renewals_view').on('click', function(e) {
+        e.preventDefault();
+        $('#checkoutRenewals #incomplete').html('').hide();
+        $('#checkoutRenewals #results').html('').hide();
+        $('#checkoutRenewals').modal({show:true});
+        var renewals = $(this).data('renewals');
+        var checkoutID = $(this).data('issueid');
+        $('#checkoutRenewals #retrieving').show();
+        $.get({ 'url': '/api/v1/checkouts/'+checkoutID+'/renewals', 'headers': { 'x-koha-embed': 'renewer' } }, function(data) {
+            if (data.length < renewals) {
+                $('#checkoutRenewals #incomplete').append(renewed_prop.format(data.length, renewals)).show();
+            }
+            var items = data.map(function(item) {
+                return createLi(item);
+            });
+            $('#checkoutRenewals #retrieving').hide();
+            $('#checkoutRenewals #results').append(items).show();
+        });
+    });
+    function createLi(renewal) {
+        return '<li><span style="font-weight:bold">' + $datetime(renewal.timestamp) + '</span> ' + renewed + ' <span style="font-weight:bold">' + $patron_to_html(renewal.renewer) + '</span></li>';
+    }
+});