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"><i class="fa fa-home"></i></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"><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>
80 </div> <!-- /.col-sm-10.col-sm-push-2 -->
82 <div class="col-sm-2 col-sm-pull-10">
84 [% INCLUDE 'admin-menu.inc' %]
86 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
89 [% MACRO jsinclude BLOCK %]
90 [% Asset.js("js/admin-menu.js") | $raw %]
92 $(document).ready(function() {
93 $( ".pluginlist" ).sortable();
94 $( ".plugin" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
95 .find( ".pluginname" )
96 .addClass( "ui-widget-header ui-corner-all" )
98 .find( ".plugindesc" );
99 $(".save-all").on("click",function(e){
103 $(".force_reload").on("click",function(e){
105 window.location.reload(true);
109 function yesimeant() {
110 var OPACdidyoumean = serialize_plugins('opac');
112 var data = "pref_OPACdidyoumean=" + encodeURIComponent(OPACdidyoumean);
117 url: '/cgi-bin/koha/svc/config/systempreferences/',
118 success: function () { alert(_("Successfully saved configuration")); },
123 function serialize_plugins(interface) {
124 var serializedconfig = '[';
125 $('#didyoumean' + interface + ' .pluginlist .plugin').each(function(index) {
126 var name = $(this).find('.pluginlabel').text();
127 var enabled = $(this).find('input:checkbox:checked').length ?
128 ', "enabled": 1' : '';
129 serializedconfig += '{ "name": "' + name + '"' + enabled + '}, ';
131 serializedconfig = serializedconfig.substring(0, serializedconfig.length - 2);
132 serializedconfig += ']';
133 return serializedconfig;
137 [% INCLUDE 'intranet-bottom.inc' %]