1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Solr config</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/tablednd.js"></script>
5 <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.textarea-expander.js"></script>
6 <script type="text/javascript" language="javascript">
7 function clean_line( line ) {
8 $(line).find('input[type="text"]').val("");
9 $(line).find('input[type="checkbox"]').attr("checked", false);
10 $(line).find('textarea').val("");
11 $(line).find('select').find('option:first').attr("selected", "selected");
14 function clone_line( line ) {
15 var new_line = $(line).clone();
16 $(new_line).removeClass("nodrag nodrop");
17 $(new_line).find('td:last-child>a').removeClass("add").addClass("delete").html(_("Delete"));
18 $(new_line).find('[data-id]').each( function() {
19 $(this).attr({ name: $(this).attr('data-id') }).removeAttr('data-id');
21 $(new_line).find("select").each( function() {
22 var attr = $(this).attr('name');
23 var val = $(line).find('[data-id="' + attr + '"]').val();
24 $(this).find('option[value="' + val + '"]').attr("selected", "selected");
29 $(document).ready(function() {
30 $('.delete').click(function() {
31 $(this).parents('tr').remove();
34 $(".indexes").tableDnD( {
35 onDragClass: "dragClass",
37 $("textarea").TextAreaExpander();
38 $('.add').click(function() {
39 var table = $(this).closest('table');
40 var ressource_type = $(table).attr('data-ressource_type');
41 var code = $(table).find('input[data-id="code"]').val();
42 var label = $(table).find('input[data-id="label"]').val();
43 if ( code.length > 0 && label.length > 0 ) {
44 var line = $(this).closest("tr");
45 var mappings = $(line).find('textarea').val();
46 var new_line = clone_line( line );
47 $(new_line).find('textarea').val(mappings);
48 $(new_line).find("input:checkbox").val(code);
49 new_line.appendTo($('table[data-ressource_type="'+ressource_type+'"]>tbody'));
50 $('.delete').click(function() {
51 $(this).parents('tr').remove();
56 onDragClass: "dragClass",
63 <body id="admin_searchengine_indexes" class="admin">
64 [% INCLUDE 'header.inc' %]
65 [% INCLUDE 'cat-search.inc' %]
67 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Search engine configuration</div>
69 <div id="doc3" class="yui-t1">
74 <h1>Search engine configuration</h1>
76 Warning: Any modification in these configurations will need a total reindexation to be fully taken into account !
80 Errors occurred, Modifications does not apply. Please check following values:
82 [% FOREACH e IN errors %]
84 [% IF ( e.type == "malformed_mapping" ) %]
85 The value "[% e.value %]" is not supported for mappings
86 [% ELSIF ( e.type == "no_mapping" ) %]
87 There is no mapping for the index [% e.value %]
96 <input type="hidden" name="op" value="edit" />
97 [% FOREACH rt IN indexloop %]
98 <h2>[% rt.ressource_type %]</h2>
99 [% IF ( rt.ressource_type == 'authority' ) %]
100 This part is not yet implemented
102 <table id="pouet" class="indexes" data-ressource_type="[% rt.ressource_type %]">
104 <tr class="nodrag nodrop">
115 [% FOREACH index IN rt.indexes %]
118 [% IF ( index.mandatory ) %]
119 <input name="code" type="text" maxlength="25" value="[% index.code %]" disabled="disabled" />
120 <input name="code" type="hidden" maxlength="25" value="[% index.code %]" />
122 <input name="code" type="text" maxlength="25" value="[% index.code %]" />
124 <input name="mandatory" type="hidden" maxlength="1" value="[% index.mandatory %]" />
125 <input name="ressource_type" type="hidden" value="[% index.ressource_type %]" />
127 <td><input name="label" type="text" maxlength="25" value="[% index.label %]" /></td>
129 [% IF ( index.mandatory ) %]
130 <input type="hidden" name="type" value="[% index.type %]" />
132 [% IF ( index.mandatory ) %]
133 <select name="type" disabled="disabled">
137 [% IF ( index.type == 'str' ) %]
138 <option value="str" selected="selected">String</option>
140 <option value="str">String</option>
142 [% IF ( index.type == 'ste' ) %]
143 <option value="ste" selected="selected">Simple Text</option>
145 <option value="ste">Simple Text</option>
147 [% IF ( index.type == 'txt' ) %]
148 <option value="txt" selected="selected">Text</option>
150 <option value="txt">Text</option>
152 [% IF ( index.type == 'int' ) %]
153 <option value="int" selected="selected">Integer</option>
155 <option value="int">Integer</option>
157 [% IF ( index.type == 'date' ) %]
158 <option value="date" selected="selected">Date</option>
160 <option value="date">Date</option>
165 [% IF ( index.sortable ) %]
166 <input name="sortable" type="checkbox" checked="checked" value="[% index.code %]" />
168 <input name="sortable" type="checkbox" value="[% index.code %]" />
172 [% IF ( index.facetable ) %]
173 <input name="facetable" type="checkbox" checked="checked" value="[% index.code %]" />
175 <input name="facetable" type="checkbox" value="[% index.code %]" />
179 <textarea name="mappings" class="contentEditable">[% FOREACH m IN index.mappings %][% m %]
180 [% END %]</textarea> <!-- Don't indent this line -->
182 <td>[% UNLESS ( index.mandatory ) %]<a class="delete">Delete</a>[% END %]</td>
187 <tr class="nodrag nodrop">
189 <input data-id="code" type="text" maxlength="25" />
190 <input data-id="ressource_type" type="hidden" value="[% rt.ressource_type %]" />
191 <input data-id="mandatory" type="hidden" value="0" />
193 <td><input data-id="label" type="text" maxlength="25" /></td>
195 <select data-id="type">
196 <option value="str">String</option>
197 <option value="ste">Simple Text</option>
198 <option value="txt">Text</option>
199 <option value="int">Integer</option>
200 <option value="date">Date</option>
203 <td><input data-id="sortable" type="checkbox" /></td>
204 <td><input data-id="facetable" type="checkbox" /></td>
206 <textarea data-id="mappings" class="contentEditable"></textarea>
208 <td><a class="add">Add</a></td>
213 <p><input type="submit" value="Save" /></p>
219 [% INCLUDE 'admin-menu.inc' %]
222 [% INCLUDE 'intranet-bottom.inc' %]