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 [% WRAPPER 'header.inc' %]
32 [% INCLUDE 'prefs-admin-search.inc' %]
35 [% WRAPPER 'sub-header.inc' %]
36 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
39 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
42 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
45 <a href="#" aria-current="page">
53 <div class="main container-fluid">
55 <div class="col-sm-10 col-sm-push-2">
58 <h1>Did you mean?</h1>
59 <noscript><div class="dialog alert"><strong>Please enable Javascript:</strong>
60 Configuring 'Did you mean?' plugins requires Javascript. If
61 you are unable to use Javascript, you may be able to enter the
62 configuration (which is stored in JSON in the OPACdidyoumean system preferences)
63 in the Local preferences tab in
64 the system preference editor, but this is unsupported, not
65 recommended, and likely will not work.</div></noscript>
66 <div id="didyoumeanlegend">
67 Please put the 'Did you mean?' plugins in order by significance, from
68 most significant to least significant, and check the box to enable those
69 plugins that you want to use.
71 <form action="/cgi-bin/koha/admin/didyoumean.pl" method="post">
72 <fieldset id="didyoumeanopac">
74 [% PROCESS pluginlist plugins=OPACpluginlist type='opac' %]
76 <fieldset class="action">
77 <button class="save-all btn btn-primary" type="submit">Save configuration</button>
78 <a href="/cgi-bin/koha/admin/didyoumean.pl" class="force_reload cancel">Cancel</a>
83 </div> <!-- /.col-sm-10.col-sm-push-2 -->
85 <div class="col-sm-2 col-sm-pull-10">
87 [% INCLUDE 'admin-menu.inc' %]
89 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
92 [% MACRO jsinclude BLOCK %]
93 [% Asset.js("js/admin-menu.js") | $raw %]
95 $(document).ready(function() {
96 $( ".pluginlist" ).sortable();
97 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
98 .find( ".pluginname" )
99 .addClass( "ui-widget-header ui-corner-all" )
101 .find( ".plugindesc" );
102 $(".save-all").on("click",function(e){
106 $(".force_reload").on("click",function(e){
108 window.location.reload(true);
112 function yesimeant() {
113 var OPACdidyoumean = serialize_plugins('opac');
115 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean);
120 url: '/cgi-bin/koha/svc/config/systempreferences/',
121 success: function () { alert(_("Successfully saved configuration")); },
126 function serialize_plugins(interface) {
127 var serializedconfig = '[';
128 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
129 var name = $(this).find('.pluginlabel').text();
130 var enabled = $(this).find('input:checkbox:checked').length ?
131 ', "enabled": 1' : '';
132 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
134 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
135 serializedconfig += ']';
136 return serializedconfig;
140 [% INCLUDE 'intranet-bottom.inc' %]