Bugzilla – Attachment 51093 Details for
Bug 16369
Clean up and improve plugins template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16369 - Clean up and improve plugins template
Bug-16369---Clean-up-and-improve-plugins-template.patch (text/plain), 13.17 KB, created by
Jonathan Druart
on 2016-05-02 12:08:18 UTC
(
hide
)
Description:
Bug 16369 - Clean up and improve plugins template
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-05-02 12:08:18 UTC
Size:
13.17 KB
patch
obsolete
>From e3890cc4bd3fad342a192915773571143b11d83b Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 26 Apr 2016 14:54:23 -0400 >Subject: [PATCH] Bug 16369 - Clean up and improve plugins template > >This patch makes multiple changes to the plugins home page template to >bring it up to date with current interface patterns. > >Test the following changes: > >- Breacrumb links have been corrected to include "Tools" in the path. > Verify that this link is correct. >- A toolbar has been added for an "Upload plugin" button. Uploading is > an action, not a view, so it should be displayed in a toolbar. Verify > that the button works correctly. >- Messages are now formatted as messages rather than as headings. To > test, trigger a message by, for instance, uninstalling all plugins or > passing an invalid "method" parameter with the URL. >- Incorrect capitalization corrected. >- Plugin actions are moved to a single "Actions" dropdown menu. This > includes 'Run report,' 'Run tool,' 'Configure,' and 'Uninstall.' Test > that all these menu options work correctly. >- The standard "Tools" sidebar menu has been added. >- An "onclick" attribute has been removed in favor of defining the event > in JavaScript. Test by choosing the 'Uninstall' menu item for a > plugin. Test both confirm and cancel actions. > >Also changed: > >- Corrected capitalization on the tools home page. >- Adding missing plugins link to the tools sidebar menu. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > .../intranet-tmpl/prog/en/includes/tools-menu.inc | 3 + > .../prog/en/modules/plugins/plugins-home.tt | 111 ++++++++++++--------- > .../prog/en/modules/tools/tools-home.tt | 2 +- > 3 files changed, 68 insertions(+), 48 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >index 25de0b1..9a2b1bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >@@ -117,6 +117,9 @@ > [% IF ( CAN_user_tools_edit_quotes ) %] > <li><a href="/cgi-bin/koha/tools/quotes.pl">Quote editor</a></li> > [% END %] >+ [% IF ( UseKohaPlugins && CAN_user_plugins_tool ) %] >+ <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></li> >+ [% END %] > [% IF ( CAN_user_tools_upload_general_files ) %] > <li><a href="/cgi-bin/koha/tools/upload.pl">Upload any file</a></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >index 830309b..e4adb7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt >@@ -3,14 +3,25 @@ > <title>Koha › Tools › Plugins </title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] >+<script type="text/javascript"> >+ $(document).ready(function(){ >+ $(".uninstall_plugin").on("click", function(){ >+ $(".dropdown").removeClass("open"); >+ var plugin_name = $(this).data("plugin-name"); >+ return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) ); >+ }); >+ }); >+</script> > </head> > > <body id="plugins_plugins_home" class="plugins"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'circ-search.inc' %] > >-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> >-› Plugins >+<div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> › >+ <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › >+ Plugins > </div> > > <div id="doc3" class="yui-t1"> >@@ -18,52 +29,46 @@ > <div id="yui-main"> > <div class="yui-b"> > <div class="details"> >+ >+ [% IF ( CAN_user_plugins_manage ) %] >+ <div class="btn-toolbar" id="toolbar"> >+ <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-small"><i class="fa fa-upload"></i> Upload plugin</a> >+ </div> >+ [% END %] >+ > <h1>Plugins</h1> > > [% UNLESS ( plugins ) %] > [% UNLESS ( method ) %] >- <h3>No plugins installed</h3> >+ <div class="dialog message">No plugins installed</div> > [% ELSE %] > [% IF method == 'tool' %] >- <h3>No plugins that can be used as a tool are installed</h3> >+ <div class="dialog message">No plugins that can be used as a tool are installed</div> > [% ELSIF method == 'report' %] >- <h3>No plugins that can create a report are installed</h3> >+ <div class="dialog message">No plugins that can create a report are installed</div> > [% ELSE %] >- <h3>Unknown plugin type <i>[% method %]</i> >+ <div class="dialog message">Unknown plugin type <i>[% method %]</i></div> > [% END %] > [% END %] > [% ELSE %] > <table> > <tr> > <th>Name</th> >- <th> </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 ) %]<th>Configure</th>[% END %] >- [% IF ( CAN_user_plugins_manage ) %]<th>Uninstall</th>[% END %] >+ <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>Actions</th> >+ [% END %] > </tr> > > [% FOREACH plugin IN plugins %] > <tr> > <td><strong>[% plugin.metadata.name %]</strong></td> > <td> >- [% IF ( CAN_user_plugins_report ) %] >- [% IF plugin.can('report') %] >- <p style="white-space:nowrap"><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=report">Run report</a></p> >- [% END %] >- [% END %] >- >- [% IF ( CAN_user_plugins_tool ) %] >- [% IF plugin.can('tool') %] >- <p style="white-space:nowrap"><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=tool">Run tool</a></p> >- [% END %] >- [% END %] >- </td> >- <td> > [% plugin.metadata.description %] > > [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %] >@@ -79,18 +84,37 @@ > <td>[% plugin.metadata.minimum_version %]</td> > <td>[% plugin.metadata.maximum_version %]</td> > <td>[% plugin.metadata.date_updated | $KohaDates %]</td> >- [% IF ( CAN_user_plugins_configure ) %] >- <td> >- [% IF plugin.can('configure') %] >- <a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=configure">Configure</a> >- [% END %] >- </td> >- [% END %] >- [% IF ( CAN_user_plugins_manage ) %] >- <td> >- [% IF plugin.can('uninstall') %] >- <a href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class %]" onclick="return confirm('Are you sure you want to uninstall the plugin [% plugin.metadata.name %]?')">Uninstall</a> >- [% END %] >+ [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %] >+ <td class="actions"> >+ <div class="dropdown"> >+ <a class="btn btn-mini dropdown-toggle" id="pluginactions[% plugin.class %]" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class %]"> >+ [% IF ( CAN_user_plugins_report ) %] >+ [% IF plugin.can('report') %] >+ <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=report"><i class="fa fa-table"></i> Run report</a></li> >+ [% END %] >+ [% END %] >+ >+ [% IF ( CAN_user_plugins_tool ) %] >+ [% IF plugin.can('tool') %] >+ <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=tool"><i class="fa fa-wrench"></i> Run tool</a></li> >+ [% END %] >+ [% END %] >+ >+ [% IF ( CAN_user_plugins_configure ) %] >+ [% IF plugin.can('configure') %] >+ <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=configure"><i class="fa fa-cog"></i> Configure</a></li> >+ [% END %] >+ [% END %] >+ [% IF ( CAN_user_plugins_manage ) %] >+ [% IF plugin.can('uninstall') %] >+ <li><a class="uninstall_plugin" data-plugin-name="[% plugin.metadata.name %]" href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class %]"><i class="fa fa-trash"></i> Uninstall</a></li> >+ [% END %] >+ [% END %] >+ </ul> >+ </div> > </td> > [% END %] > [% END %] >@@ -100,15 +124,8 @@ > </div> > </div> > >- <div class="yui-b noprint"> >- <div id="navmenu"> >- <ul id="navmenulist"> >- [% IF ( CAN_user_plugins_manage ) %] >- <li><a href="plugins-upload.pl">Upload a plugin</a></li> >- [% END %] >- </ul> >- </div> >- </div> >+ <div class="yui-b noprint"> >+ [% INCLUDE 'tools-menu.inc' %] > </div> > </div> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index 085e154..a8f8ff4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -100,7 +100,7 @@ > [% END %] > > [% IF ( UseKohaPlugins && CAN_user_plugins_tool ) %] >- <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool Plugins</a></dt> >+ <dt><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">Tool plugins</a></dt> > <dd>Use tool plugins</dd> > [% END %] > >-- >2.7.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 16369
:
50823
|
50910
| 51093