Bug 31603: Add search option for plugin page

This patch converts the table of plugins to a DataTable so that
it will have dynamic sorting, export options, and the quick search
field at the top of the table.

To test you should have more than one plugin installed.

- Apply the patch and go to Administration -> Manage plugins.
- The table should be styled as a DataTable, with the first column
  sorted by default.
- At the top of the table you should see the number of entries,
  a quick search form, and an export button.
- Confirm that the quick search form works to filter plugins by
  name, description, author, etc.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Owen Leonard 2022-09-22 14:44:50 +00:00 committed by Tomas Cohen Arazi
parent aa49b1bed9
commit 01f1eb311e
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
1 changed files with 20 additions and 12 deletions

View File

@ -114,18 +114,20 @@
[% END %]
[% ELSE %]
<table id="installed_plugins">
<tr>
<th>Name</th>
<th>Description</th>
<th>Author</th>
<th>Plugin version</th>
<th>Minimum Koha version</th>
<th>Maximum Koha version</th>
<th>Last updated</th>
[% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
<th class="noExport">Actions</th>
[% END %]
</tr>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Author</th>
<th>Plugin version</th>
<th>Minimum Koha version</th>
<th>Maximum Koha version</th>
<th>Last updated</th>
[% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
<th class="noExport">Actions</th>
[% END %]
</tr>
</thead>
[% FOREACH plugin IN plugins %]
[% IF plugin.error %]
@ -226,6 +228,8 @@
[% MACRO jsinclude BLOCK %]
[% Asset.js("js/tools-menu.js") | $raw %]
[% INCLUDE 'calendar.inc' %]
[% INCLUDE 'datatables.inc' %]
[% INCLUDE 'columns_settings.inc' %]
<script>
$(document).ready(function(){
$(".uninstall_plugin").on("click", function(){
@ -237,6 +241,10 @@
$("#plugin-search-button").on("click", function(){
$("#plugin-search-form").submit();
});
KohaTable("installed_plugins", {
"bPaginate": false
});
});
</script>
[% END %]