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 Suggest authorities which are relevant to the term the user searched for.
15 [% CASE 'ExplodedTerms' %]
16 Suggest that patrons expand their searches to include
17 broader/narrower/related terms.
18 [% CASE 'LibrisSpellcheck' %]
19 Use the LIBRIS spellcheck API.
26 [% INCLUDE 'doc-head-open.inc' %]
27 <title>Did you mean? › Administration › Koha</title>
28 [% INCLUDE 'doc-head-close.inc' %]
31 <body id="admin_didyoumean" class="admin">
32 [% INCLUDE 'header.inc' %]
33 [% INCLUDE 'prefs-admin-search.inc' %]
35 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
38 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
41 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
44 <a href="#" aria-current="page">
51 <div class="main container-fluid">
53 <div class="col-sm-10 col-sm-push-2">
56 <h3>Did you mean?</h3>
57 <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
58 Configuring 'Did you mean?' plugins requires Javascript. If
59 you are unable to use Javascript, you may be able to enter the
60 configuration (which is stored in JSON in the OPACdidyoumean system preferences)
61 in the Local preferences tab in
62 the system preference editor, but this is unsupported, not
63 recommended, and likely will not work.</div></noscript>
64 <div id="didyoumeanlegend">
65 Please put the 'Did you mean?' plugins in order by significance, from
66 most significant to least significant, and check the box to enable those
67 plugins that you want to use.
69 <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
70 <fieldset id="didyoumeanopac">
72 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
74 <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>
78 </div> <!-- /.col-sm-10.col-sm-push-2 -->
80 <div class="col-sm-2 col-sm-pull-10">
82 [% INCLUDE 'admin-menu.inc' %]
84 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
87 [% MACRO jsinclude BLOCK %]
88 [% Asset.js("js/admin-menu.js") | $raw %]
90 $(document).ready(function() {
91 $( ".pluginlist" ).sortable();
92 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
93 .find( ".pluginname" )
94 .addClass( "ui-widget-header ui-corner-all" )
96 .find( ".plugindesc" );
97 $(".save-all").on("click",function(e){
101 $(".force_reload").on("click",function(e){
103 window.location.reload(true);
107 function yesimeant() {
108 var OPACdidyoumean = serialize_plugins('opac');
110 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean);
115 url: '/cgi-bin/koha/svc/config/systempreferences/',
116 success: function () { alert(_("Successfully saved configuration")); },
121 function serialize_plugins(interface) {
122 var serializedconfig = '[';
123 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
124 var name = $(this).find('.pluginlabel').text();
125 var enabled = $(this).find('input:checkbox:checked').length ?
126 ', "enabled": 1' : '';
127 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
129 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
130 serializedconfig += ']';
131 return serializedconfig;
135 [% INCLUDE 'intranet-bottom.inc' %]