Bug 18430 - Plugins page should have a link to viewing other types
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / plugins / plugins-home.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; Plugins </title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
6 <script type="text/javascript">
7     $(document).ready(function(){
8         $(".uninstall_plugin").on("click", function(){
9             $(".dropdown").removeClass("open");
10             var plugin_name = $(this).data("plugin-name");
11             return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) );
12         });
13     });
14 </script>
15 </head>
16
17 <body id="plugins_plugins_home" class="plugins">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'prefs-admin-search.inc' %]
20
21 <div id="breadcrumbs">
22     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
23     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
24     Plugins
25 </div>
26
27 <div id="doc3" class="yui-t1">
28     <div id="bd">
29         <div id="yui-main">
30             <div class="yui-b">
31                 <div class="details">
32
33                     [% IF ( CAN_user_plugins_manage ) %]
34                         <div class="btn-toolbar" id="toolbar">
35                             <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-default btn-sm"><i class="fa fa-upload"></i> Upload plugin</a>
36                             <div class="btn-group">
37                                 <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-eye"></i> View plugins by class <span class="caret"></span></button>
38                                 <ul class="dropdown-menu">
39                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl">View all plugins</a></li>
40                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">View report plugins</a></li>
41                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">View tool plugins</a></li>
42                                 </ul>
43                             </div>
44                         </div>
45                     [% END %]
46                     <h1>Plugins</h1>
47
48                     [% UNLESS ( plugins ) %]
49                         [% UNLESS ( method ) %]
50                             <div class="dialog message">No plugins installed</div>
51                         [% ELSE %]
52                             [% IF method == 'tool' %]
53                                 <div class="dialog message">No plugins that can be used as a tool are installed</div>
54                             [% ELSIF method == 'report' %]
55                                 <div class="dialog message">No plugins that can create a report are installed</div>
56                             [% ELSE %]
57                                 <div class="dialog message">Unknown plugin type <i>[% method %]</i></div>
58                             [% END %]
59                         [% END %]
60                     [% ELSE %]
61                         <table>
62                             <tr>
63                                 <th>Name</th>
64                                 <th>Description</th>
65                                 <th>Author</th>
66                                 <th>Plugin version</th>
67                                 <th>Minimum Koha version</th>
68                                 <th>Maximum Koha version</th>
69                                 <th>Last updated</th>
70                                 [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
71                                     <th>Actions</th>
72                                 [% END %]
73                             </tr>
74
75                             [% FOREACH plugin IN plugins %]
76                                 <tr>
77                                     <td><strong>[% plugin.metadata.name %]</strong></td>
78                                     <td>
79                                         [% plugin.metadata.description %]
80
81                                         [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
82                                             <div class="error">Warning: This report was written for a newer version of Koha. Run at your own risk.</div>
83                                         [% END %]
84
85                                         [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
86                                             <div class="error">Warning: This report was written for an older version of Koha. Run at your own risk.</div>
87                                         [% END %]
88                                     </td>
89                                     <td>[% plugin.metadata.author %]</td>
90                                     <td>[% plugin.metadata.version %]</td>
91                                     <td>[% plugin.metadata.minimum_version %]</td>
92                                     <td>[% plugin.metadata.maximum_version %]</td>
93                                     <td>[% plugin.metadata.date_updated | $KohaDates %]</td>
94                                     [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
95                                         <td class="actions">
96                                             <div class="dropdown">
97                                                 <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class %]" role="button" data-toggle="dropdown" href="#">
98                                                    Actions <b class="caret"></b>
99                                                 </a>
100                                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class %]">
101                                                     [% IF ( CAN_user_plugins_report ) %]
102                                                         [% IF plugin.can('report') %]
103                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=report"><i class="fa fa-table"></i> Run report</a></li>
104                                                         [% END %]
105                                                     [% END %]
106
107                                                     [% IF ( CAN_user_plugins_tool ) %]
108                                                         [% IF plugin.can('tool') %]
109                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=tool"><i class="fa fa-wrench"></i> Run tool</a></li>
110                                                         [% END %]
111                                                     [% END %]
112
113                                                     [% IF ( CAN_user_plugins_configure ) %]
114                                                         [% IF plugin.can('configure') %]
115                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=configure"><i class="fa fa-cog"></i> Configure</a></li>
116                                                         [% END %]
117                                                     [% END %]
118                                                     [% IF ( CAN_user_plugins_manage ) %]
119                                                         [% IF plugin.can('uninstall') %]
120                                                             <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>
121                                                         [% END %]
122                                                     [% END %]
123                                                 </ul>
124                                             </div>
125                                         </td>
126                                     [% END %]
127                             [% END %]
128                         </table>
129                     [% END %]
130                 </div>
131             </div>
132         </div>
133
134     <div class="yui-b noprint">
135         [% INCLUDE 'tools-menu.inc' %]
136     </div>
137 </div>
138
139
140 [% INCLUDE 'intranet-bottom.inc' %]