5 <div class="pluginlist">
6 [% FOREACH plugin IN plugins %]
8 <div class="pluginname">
9 [% IF plugin.enabled %]<input type="checkbox" checked="checked" id="checkbox_[% type | html %][% plugin.name | html %]">[% ELSE %]<input type="checkbox" id="checkbox_[% type | html %][% plugin.name | html %]">[% END %]
10 <label class='pluginlabel' for="checkbox_[% type | html %][% plugin.name | html %]">[% plugin.name | html %]</label></div>
11 <div class="plugindesc">
12 [% SWITCH plugin.name %]
13 [% CASE 'AuthorityFile' %]
14 <span>Suggest authorities which are relevant to the term the user searched for.</span>
15 [% CASE 'ExplodedTerms' %]
16 <span>Suggest that patrons expand their searches to include broader/narrower/related terms.</span>
17 [% CASE 'LibrisSpellcheck' %]
18 <span>Use the LIBRIS spellcheck API.</span>
25 [% INCLUDE 'doc-head-open.inc' %]
26 <title>Did you mean? › Administration › Koha</title>
27 [% INCLUDE 'doc-head-close.inc' %]
30 <body id="admin_didyoumean" class="admin">
31 [% INCLUDE 'header.inc' %]
32 [% INCLUDE 'prefs-admin-search.inc' %]
34 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
37 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
40 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
43 <a href="#" aria-current="page">
50 <div class="main container-fluid">
52 <div class="col-sm-10 col-sm-push-2">
55 <h3>Did you mean?</h3>
56 <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
57 Configuring 'Did you mean?' plugins requires Javascript. If
58 you are unable to use Javascript, you may be able to enter the
59 configuration (which is stored in JSON in the OPACdidyoumean system preferences)
60 in the Local preferences tab in
61 the system preference editor, but this is unsupported, not
62 recommended, and likely will not work.</div></noscript>
63 <div id="didyoumeanlegend">
64 Please put the 'Did you mean?' plugins in order by significance, from
65 most significant to least significant, and check the box to enable those
66 plugins that you want to use.
68 <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
69 <fieldset id="didyoumeanopac">
71 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
73 <fieldset class="action"><button class="save-all submit" type="submit">Save configuration</button> <a href="/cgi-bin/koha/admin/didyoumean.pl" class="force_reload cancel">Cancel</a></fieldset>
77 </div> <!-- /.col-sm-10.col-sm-push-2 -->
79 <div class="col-sm-2 col-sm-pull-10">
81 [% INCLUDE 'admin-menu.inc' %]
83 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
86 [% MACRO jsinclude BLOCK %]
87 [% Asset.js("js/admin-menu.js") | $raw %]
89 $(document).ready(function() {
90 $( ".pluginlist" ).sortable();
91 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
92 .find( ".pluginname" )
93 .addClass( "ui-widget-header ui-corner-all" )
95 .find( ".plugindesc" );
96 $(".save-all").on("click",function(e){
100 $(".force_reload").on("click",function(e){
102 window.location.reload(true);
106 function yesimeant() {
107 var OPACdidyoumean = serialize_plugins('opac');
109 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean);
114 url: '/cgi-bin/koha/svc/config/systempreferences/',
115 success: function () { alert(_("Successfully saved configuration")); },
120 function serialize_plugins(interface) {
121 var serializedconfig = '[';
122 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
123 var name = $(this).find('.pluginlabel').text();
124 var enabled = $(this).find('input:checkbox:checked').length ?
125 ', "enabled": 1' : '';
126 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
128 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
129 serializedconfig += ']';
130 return serializedconfig;
134 [% INCLUDE 'intranet-bottom.inc' %]