4 [% USE TablesSettings %]
6 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 [% IF library %][% SET OpacLibraryInfo = library.opac_info( lang => lang ) %][% END %]
11 <title>[% FILTER collapse %]
12 [% IF op == 'add_form' %]
14 [% tx("Modify library '{library}'", { library = library.branchcode }) | html %]
16 [% t("New library") | html %]
18 [% ELSIF op == 'delete_confirm' %]
19 [% tx("Confirm deletion of library '{library}'", { library = library.branchcode }) | html %] ›
21 [% t("Libraries") | html %] ›
22 [% t("Administration") | html %] ›
23 [% t("Koha") | html %]
25 [% INCLUDE 'doc-head-close.inc' %]
26 [% Asset.css("lib/codemirror/codemirror.min.css") | $raw %]
27 [% Asset.css("lib/codemirror/lint.min.css") | $raw %]
30 <body id="admin_branches" class="admin">
31 [% WRAPPER 'header.inc' %]
32 [% INCLUDE 'prefs-admin-search.inc' %]
35 [% WRAPPER 'sub-header.inc' %]
36 [% WRAPPER breadcrumbs %]
37 [% WRAPPER breadcrumb_item %]
38 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
41 [% IF op == 'add_form' || op == 'delete_confirm' || op == 'view' %]
42 [% WRAPPER breadcrumb_item %]
43 <a href="/cgi-bin/koha/admin/branches.pl">Libraries</a>
46 [% WRAPPER breadcrumb_item bc_active= 1 %]
47 <span>Libraries</span>
51 [% IF op == 'add_form' %]
53 [% WRAPPER breadcrumb_item bc_active= 1 %]
54 [% tx("Modify library '{library}'", { library = library.branchcode }) | html %]
57 [% WRAPPER breadcrumb_item bc_active= 1 %]
58 <span>New library</span>
62 [% ELSIF op == 'delete_confirm' %]
63 [% WRAPPER breadcrumb_item bc_active= 1 %]
64 [% tx("Confirm deletion of library '{library}'", { library = library.branchcode }) | html %]
67 [% ELSIF op == 'view' %]
68 [% WRAPPER breadcrumb_item bc_active= 1 %]
69 [% library.branchname | html %]
73 [% END #/ WRAPPER breadcrumbs %]
74 [% END #/ WRAPPER sub-header.inc %]
76 <div class="main container-fluid">
78 <div class="col-sm-10 col-sm-push-2">
81 [% FOREACH m IN messages %]
82 <div class="dialog [% m.type | html %]">
84 [% CASE 'error_on_update' %]
85 <span>An error occurred when updating this library. Perhaps it already exists.</span>
86 [% CASE 'error_on_insert' %]
87 <span>An error occurred when adding this library. The branchcode might already exist.</span>
88 [% CASE 'error_on_delete' %]
89 <span>An error occurred when deleting this library. Check the logs.</span>
90 [% CASE 'success_on_update' %]
91 <span>Library updated successfully.</span>
92 [% CASE 'success_on_insert' %]
93 <span>Library added successfully.</span>
94 [% CASE 'success_on_delete' %]
95 <span>Library deleted successfully.</span>
96 [% CASE 'cannot_delete_library' %]
97 <span>This library cannot be deleted. Patrons or items are still using it</span>
98 [% IF m.data.patrons_count and m.data.items_count %]
99 <span>([% m.data.patrons_count | html %] patrons and [% m.data.items_count | html %] items).</span>
100 [% ELSIF m.data.patrons_count %]
101 <span>([% m.data.patrons_count | html %] patrons).</span>
102 [% ELSIF m.data.items_count %]
103 <span>([% m.data.items_count | html %] items).</span>
106 <span>[% m.code | html %]</span>
111 [% IF op == 'list' || op == 'view' %]
112 <div id="toolbar" class="btn-toolbar">
113 <a class="btn btn-default" id="newbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form"><i class="fa fa-plus"></i> New library</a>
114 [% IF op == 'view' && library %]
115 <a class="btn btn-default" id="editbranch" href="/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode=[% library.branchcode | uri %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit library</a>
120 [% IF op == 'add_form' %]
123 [% tx("Modify library '{library}'", { library = library.branchcode }) | html %]
128 <form action="/cgi-bin/koha/admin/branches.pl" id="Aform" name="Aform" class="validated" method="post">
129 <fieldset class="rows">
130 <input type="hidden" name="op" value="add_validate" />
132 <input type="hidden" name="is_a_modif" value="1" />
137 <span class="label">Library code: </span>
138 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
139 [% library.branchcode | html %]
141 <label for="branchcode" class="required">Library code: </label>
142 <input type="text" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode | html %]" class="required focus" required="required" />
143 <span class="required">Required</span>
147 <label for="branchname" class="required">Name: </label>
149 <input type="text" name="branchname" id="branchname" size="80" value="[% library.branchname | html %]" class="required focus" required="required" />
151 <input type="text" name="branchname" id="branchname" size="80" value="[% library.branchname | html %]" class="required" required="required" />
153 <span class="required">Required</span>
158 <fieldset class="rows"><legend>Group(s):</legend>
160 [% FOREACH category IN categories %]
162 <label for="[% category.categorycode | html %]">[% category.categoryname | html %]: </label>
163 [% IF category and selected_categorycodes.grep(category.categorycode).size %]
164 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" checked="checked" />
166 <input type="checkbox" id="[% category.categorycode | html %]" name="selected_categorycode_[% category.categorycode | html %]" />
168 <div class="hint">[% category.codedescription | html %]</div>
174 <fieldset class="rows">
176 <li><label for="branchaddress1">Address line 1: </label><input type="text" name="branchaddress1" id="branchaddress1" size="60" value="[% library.branchaddress1 | html %]" /></li>
177 <li><label for="branchaddress2">Address line 2: </label><input type="text" name="branchaddress2" id="branchaddress2" size="60" value="[% library.branchaddress2 | html %]" /></li>
178 <li><label for="branchaddress3">Address line 3: </label><input type="text" name="branchaddress3" id="branchaddress3" size="60" value="[% library.branchaddress3 | html %]" /></li>
179 <li><label for="branchcity">City: </label><input type="text" name="branchcity" id="branchcity" size="60" value="[% library.branchcity | html %]" /></li>
180 <li><label for="branchstate">State: </label><input type="text" name="branchstate" id="branchstate" size="60" value="[% library.branchstate | html %]" /></li>
181 <li><label for="branchzip">ZIP/Postal code: </label><input type="text" name="branchzip" id="branchzip" size="25" maxlength="25" value="[% library.branchzip | html %]" /></li>
182 <li><label for="branchcountry">Country: </label><input type="text" name="branchcountry" id="branchcountry" size="60" value="[% library.branchcountry | html %]" /></li>
183 <li><label for="branchphone">Phone: </label><input type="text" name="branchphone" id="branchphone" size="60" value="[% library.branchphone | html %]" /></li>
184 <li><label for="branchfax">Fax: </label><input type="text" name="branchfax" id="branchfax" size="60" value="[% library.branchfax | html %]" /></li>
185 <li><label for="branchemail">Email: </label><input type="text" name="branchemail" id="branchemail" class="email" size="80" value="[% library.branchemail | html %]" /></li>
186 [% IF (Koha.Preference('ILLModule')) %]
188 <label for="branchillemail">ILL staff email: </label>
189 <input type="text" name="branchillemail" id="branchillemail" class="email" size="80" value="[% library.branchillemail | html %]" />
191 [% IF ( CAN_user_parameters_manage_sysprefs ) %]
192 [% pref_ILLDefaultStaffEmail_link = BLOCK %]<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ILLDefaultStaffEmail">ILLDefaultStaffEmail</a>[% END %]
193 Default: [% pref_ILLDefaultStaffEmail_link | $raw | $KohaSpan %] system preference
195 Default: ILLDefaultStaffEmail system preference
201 <label for="branchreplyto">Reply-To: </label>
202 <input type="text" name="branchreplyto" id="branchreplyto" class="email" size="80" value="[% library.branchreplyto | html %]" />
204 [% IF ( CAN_user_parameters_manage_sysprefs ) %]
205 [% pref_ReplyToDefault_link = BLOCK %]<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReplyToDefault">ReplyToDefault</a>[% END %]
206 Default: [% pref_ReplyToDefault_link | $raw | $KohaSpan %] system preference
208 Default: ReplyToDefault system preference
213 <label for="branchreturnpath">Return-Path: </label>
214 <input type="text" name="branchreturnpath" id="branchreturnpath" class="email" size="80" value="[% library.branchreturnpath | html %]" />
216 [% IF ( CAN_user_parameters_manage_sysprefs ) %]
217 [% pref_ReturnpathDefault_link = BLOCK %]<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=ReturnpathDefault">ReturnpathDefault</a>[% END %]
218 Default: [% pref_ReturnpathDefault_link | $raw | $KohaSpan %] system preference
220 Default: ReturnpathDefault system preference
224 <li><label for="smtp_server">SMTP server: </label>
225 <select name="smtp_server" id="smtp_server">
226 [% IF library AND library.smtp_server.is_system_default %]
227 <option value="*" selected="selected">Default</option>
229 <option value="*">Default</option>
231 [% FOREACH smtp_server IN smtp_servers %]
232 [% IF library AND smtp_server.id == library.smtp_server.id %]
233 <option value="[% smtp_server.id | html %]" selected="selected">[% smtp_server.name | html %]</option>
235 <option value="[% smtp_server.id | html %]">[% smtp_server.name | html %]</option>
240 <li><label for="branchurl">URL: </label><input type="text" name="branchurl" id="branchurl" size="80" value="[% library.branchurl | html %]" class="url" /></li>
241 <li><label for="opac_info">OPAC info: </label>
242 [% IF OpacLibraryInfo %]<!-- opac_info -->
243 <div>[% OpacLibraryInfo.content | $raw %]</div>
244 <div class="hint"><a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations&op=add_form&id=[% OpacLibraryInfo.id | $raw %]&editmode=wysiwyg" target="_blank">Edit HTML content</a></div>
246 <a href="/cgi-bin/koha/tools/additional-contents.pl?category=html_customizations&op=add_form&editmode=wysiwyg" target="_blank">Add HTML content</a>
250 <label for="branchip">IP: </label>
251 <input type="text" name="branchip" id="branchip" size="15" maxlength="15" value="[% library.branchip | html %]" />
252 <div class="hint">Can be entered as a single IP, or a subnet such as 192.168.1.*</div>
255 <label for="marcorgcode">MARC organization code</label>
256 <input type="text" name="marcorgcode" id="marcorgcode" size="16" maxlength="16" value="[% library.marcorgcode | html %]" />
258 [% IF ( CAN_user_parameters_manage_sysprefs ) %]
259 [% pref_MARCOrgCode_link = BLOCK %]<a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=MARCOrgCode">MARCOrgCode</a>[% END %]
260 If not filled in defaults to system preference [% pref_MARCOrgCode_link | $raw | $KohaSpan %].
262 If not filled in defaults to system preference MARCOrgCode.
264 You can obtain your code from <a href="http://www.loc.gov/marc/organizations/orgshome.html" target="_blank">Library of Congress</a>.
267 <li><label for="branchnotes">Notes: </label><input type="text" name="branchnotes" id="branchnotes" size="80" value="[% library.branchnotes | html %]" /></li>
268 <li><label for="pickup_location">Pickup location: </label>
269 <select name="pickup_location" id="pickup_location">
270 [% IF !library || library.pickup_location == 1 %]
271 <option value="1" selected="selected">Yes</option>
272 <option value="0">No</option>
274 <option value="1">Yes</option>
275 <option value="0" selected="selected">No</option>
279 <li><label for="public">Public: </label>
280 <select name="public" id="public">
281 [% IF !library || library.public == 1 %]
282 <option value="1" selected="selected">Yes</option>
283 <option value="0">No</option>
285 <option value="1">Yes</option>
286 <option value="0" selected="selected">No</option>
289 <div class="hint">Set to 'yes' to show this library as a search option and on the libraries page in the OPAC.</div>
292 <label for="UserJS">UserJS: </label>
293 <div style="display:flex; flex-direction:column;">
294 <a class="expand-textarea" id="expand_userjs" data-target="userjs" data-syntax="javascript" href="#">Click to edit</a>
295 <textarea style="display:none" name="userjs" id="userjs" class="codemirror" rows="10" cols="40">[% library.userjs | html %]</textarea>
296 <a class="collapse-textarea" id="collapse_userjs" data-target="userjs" data-syntax="javascript" style="display:none" href="#">Click to collapse</br></a>
300 <label for="UserCSS">UserCSS: </label>
301 <div style="display:flex; flex-direction:column;">
302 <a class="expand-textarea" id="expand_usercss" data-target="usercss" data-syntax="css" href="#">Click to edit</a>
303 <textarea style="display:none" name="usercss" id="usercss" class="" rows="10" cols="40">[% library.usercss | html %]</textarea>
304 <a class="collapse-textarea" id="collapse_usercss" data-target="usercss" data-syntax="css" style="display:none" href="#">Click to collapse</br></a>
310 <fieldset class="action">
311 <input type="submit" class="btn btn-primary" value="Submit" />
312 <a class="cancel" href="/cgi-bin/koha/admin/branches.pl">Cancel</a>
317 [% IF op == 'delete_confirm' and not ( items_count or patrons_count )%]
318 <div class="dialog alert">
319 <form action="/cgi-bin/koha/admin/branches.pl" method="post">
320 <h1>Are you sure you want to delete [% library.branchname | html %] ([% library.branchcode | html %])?</h1>
321 <input type="hidden" name="op" value="delete_confirmed" />
322 <input type="hidden" name="branchcode" value="[% library.branchcode | html %]" />
323 <input type="hidden" name="branchname" value="[% library.branchname | html %]">
324 <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
326 <form action="/cgi-bin/koha/admin/branches.pl" method="get">
327 <button type="submit" class="deny"><i class="fa fa-fw fa-times"></i> No, do not delete</button>
332 [% IF op == 'list' %]
334 [% IF libraries_count > 0 %]
335 <div class="page-section">
336 <table id="libraries">
342 <th>MARC organization code</th>
344 <th>Pickup location</th>
347 <th data-class-name="actions noExport">Actions</th>
353 <div class="dialog message">There are no libraries defined. <a href="/cgi-bin/koha/admin/branches.pl?op=add_form">Start defining libraries</a>.</div>
357 [% IF op == 'view' && library %]
358 <h1>[% library.branchname | html %]</h1>
359 <div class="center-block row page-section">
360 <div class="col-sm-6">
364 <span class="label">Library code: </span>
365 [% library.branchcode | html %]
368 <span class="label">Name: </span>
369 [% library.branchname | html %]
372 <span class="label">Category:</span>
373 [% category.categoryname | html %]
376 <span class="label">Address line 1: </span>
377 [% library.branchaddress1 | html %]
380 <span class="label">Address line 2: </span>
381 [% library.branchaddress2 | html %]
384 <span class="label">Address line 3: </span>
385 [% library.branchaddress3 | html %]
388 <span class="label">City: </span>
389 [% library.branchcity | html %]
392 <span class="label">State: </span>
393 [% library.branchstate | html %]
396 <span class="label">ZIP/Postal code: </span>
397 [% library.branchzip | html %]
400 <span class="label">Country: </span>
401 [% library.branchcountry | html %]
404 <span class="label">Phone: </span>
405 [% library.branchphone | html %]
408 <span class="label">Fax: </span>
409 [% library.branchfax | html %]
414 <div class="col-sm-6">
418 <span class="label">Email: </span>
419 [% IF ( library.branchemail ) %]
420 <a href="mailto:[% library.branchemail | url %]">[% library.branchemail | html %]</a>
424 <span class="label">ILL staff email: </span>
425 [% IF ( library.branchillemail ) %]
426 <a href="mailto:[% library.branchillemail | url %]">[% library.branchillemail | html %]</a>
430 <span class="label">Reply-To: </span>
431 [% IF ( library.branchreplyto ) %]
432 <a href="mailto:[% library.branchreplyto | url %]">[% library.branchreplyto | html %]</a>
436 <span class="label">Return-Path: </span>
437 [% library.branchreturnpath | html %]
440 <span class="label">SMTP server: </span>
441 [% smtp_server.name | html %]
444 <span class="label">URL: </span>
445 [% IF ( library.branchurl ) %]
446 <a href="[% library.branchurl | url %]" target="_blank">[% library.branchurl | html %]</a>
450 <span class="label">IP: </span>
451 [% library.branchip | html %]
454 <span class="label">MARC organization code</span>
455 [% library.marcorgcode | html %]
458 <span class="label">Notes: </span>
459 [% library.branchnotes | html %]
462 <span class="label">Pickup location: </span>
463 [% IF ( library.pickup_location ) %]
470 <span class="label">Public: </span>
471 [% IF ( library.public ) %]
478 </div> <!-- /.rows -->
479 </div> <!-- /.col-sm-6 -->
480 </div> <!-- /.row -->
481 [% IF OpacLibraryInfo %]<!-- opac_info -->
482 <div class="row page-section">
483 <div class="col-sm-12">
484 <h2>OPAC information</h2>
485 <div>[% OpacLibraryInfo.content | $raw %]</div>
489 [% ELSIF op == 'view' %]
490 <div>This library does not exist.</div>
494 </div> <!-- /.col-sm-10.col-sm-push-2 -->
496 <div class="col-sm-2 col-sm-pull-10">
498 [% INCLUDE 'admin-menu.inc' %]
500 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
501 </div> <!-- /.row -->
503 [% MACRO jsinclude BLOCK %]
504 [% Asset.js("js/admin-menu.js") | $raw %]
505 [% INCLUDE 'datatables.inc' %]
506 [% INCLUDE 'columns_settings.inc' %]
507 [% Asset.js( "lib/codemirror/codemirror.min.js" ) | $raw %]
508 [% Asset.js( "lib/codemirror/css.min.js" ) | $raw %]
509 [% Asset.js( "lib/codemirror/javascript.min.js" ) | $raw %]
510 [% Asset.js( "lib/codemirror/xml.min.js" ) | $raw %]
511 [% Asset.js( "lib/codemirror/yaml.min.js" ) | $raw %]
512 [% Asset.js( "lib/codemirror/lint.min.js" ) | $raw %]
513 [% Asset.js( "lib/linters/jshint.min.js" ) | $raw %]
514 [% Asset.js( "lib/linters/htmlhint.min.js" ) | $raw %]
515 [% Asset.js( "lib/linters/csslint.min.js" ) | $raw %]
516 [% Asset.js( "lib/linters/js-yaml.min.js" ) | $raw %]
517 [% Asset.js( "lib/codemirror/html-lint.min.js" ) | $raw %]
518 [% Asset.js( "lib/codemirror/javascript-lint.min.js" ) | $raw %]
519 [% Asset.js( "lib/codemirror/css-lint.min.js" ) | $raw %]
520 [% Asset.js( "lib/codemirror/yaml-lint.min.js" ) | $raw %]
521 [% Asset.css("lib/codemirror/codemirror.css") | $raw %]
524 border: 1px solid #EEE;
525 margin: 1em, 1em, 1em, 0;
531 var table_settings = [% TablesSettings.GetTableSettings( 'admin', 'libraries', 'libraries', 'json' ) | $raw %];
532 var saved_table = localStorage.getItem("DataTables_libraries_/cgi-bin/koha/admin/branches.pl");
533 var updated_settings = get_columns_saved_state(saved_table, table_settings);
535 $(document).ready(function() {
537 var libraries_url = '/api/v1/libraries';
538 var libraries = $("#libraries").kohaTable({
542 'embed': [ 'smtp_server' ],
543 'emptyTable': '<div class="dialog message">'+_("There are no libraries defined.")+' <a href="/cgi-bin/koha/admin/branches.pl?op=add_form">'+_("Start defining libraries")+'</a>.</div>',
546 "targets": [0,1,3,4,7,9,10,11,12,13,14,15,16],
547 "render": function (data, type, row, meta) {
548 if ( type == 'display' ) {
549 if ( data != null ) {
550 return data.escapeHtml();
564 "render": function( data, type, row, meta ) {
565 return "<a href=\"/cgi-bin/koha/admin/branches.pl?op=view&branchcode=" + encodeURIComponent( row.library_id ) + "\">" + row.name.escapeHtml() + "</a>";
569 "data": "library_id",
574 "data": function( row, type, val, meta ) {
575 const library_info = [];
576 if ( row.address1 != null ) library_info.push(row.address1.escapeHtml());
577 if ( row.address2 != null ) library_info.push(row.address2.escapeHtml());
578 if ( row.address3 != null ) library_info.push(row.address3.escapeHtml());
579 // geographical_location = city, state postal_code
580 const locations = [];
581 if ( row.city != null ) locations.push(row.city.escapeHtml());
582 if ( row.state != null ) locations.push(row.state.escapeHtml());
583 const geographical_location = locations.join(', ');
584 if ( geographical_location != '' && row.postal_code != null) {
585 library_info.push(geographical_location+' '+row.postal_code.escapeHtml());
588 library_info.push(geographical_location);
590 if ( row.country != null ) library_info.push(row.country.escapeHtml());
591 if ( row.phone != null ) library_info.push(_("Ph: ") + row.phone.escapeHtml());
592 if ( row.fax != null ) library_info.push(_("Fax: ") + row.fax.escapeHtml());
593 if ( row.email != null ) library_info.push('<a href="mailto:'+encodeURIComponent(row.email)+'">'+row.email.escapeHtml()+'</a>');
594 if ( row.url != null ) library_info.push('<a href="'+encodeURIComponent(row.url)+'">'+row.url.escapeHtml()+'</a>');
595 if ( row.notes != null ) library_info.push(_("Notes")+': '+row.notes.escapeHtml());
596 return library_info.join('<br/>');
602 "data": "marc_org_code",
612 "data": "pickup_location",
615 "render": function( data, type, row, meta ) {
616 return (data) ? _("Yes") : _("No");
623 "render": function( data, type, row, meta ) {
624 return (data) ? _("Yes") : _("No");
628 "data": "smtp_server",
629 "render": function( data, type, row, meta ) {
630 if ( data.smtp_server_id ) {
631 return '<a href="/cgi-bin/koha/admin/smtp_servers.pl?op=edit_form&smtp_server_id='+encodeURIComponent(data.smtp_server_id)+'">'+data.name.escapeHtml()+'</a>';
642 "data": function( row, type, val, meta ) {
644 var result = '<a class="btn btn-default btn-xs" href="/cgi-bin/koha/admin/branches.pl?op=add_form&branchcode='+encodeURIComponent(row.library_id)+'" role="button"><i class="fa-solid fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>';
645 result += '<form action="/cgi-bin/koha/admin/branches.pl" method="post">';
646 result += '<input type="hidden" name="branchcode" value="'+row.library_id.escapeHtml()+'" />'+"\n";
647 result += '<input type="hidden" name="op" value="delete_confirm" />';
648 result += '<button type="submit" id="delete_library_'+row.library_id.escapeHtml()+'" class="btn btn-default btn-xs" role="button"><i class="fa fa-trash-can" aria-hidden="true"></i> '+_("Delete")+'</button></form>';
687 "data": "postal_code",
699 "data": function( row, type, val, meta ) {
700 return ''; // provisional placeholder for opac_info
713 }, updated_settings);
716 $("#Aform").on("submit", function( event ) {
717 if ( $("#branchcode").val().match(/\s/) ) {
718 event.preventDefault();
719 alert(_("The library code entered contains whitespace characters. Please remove any whitespace characters from the library code"));
728 $( ".expand-textarea" ).on("click", function(e){
731 var target = $(this).data("target");
732 var syntax = $(this).data("syntax");
733 $("#collapse_" + target ).show();
735 var editor = CodeMirror.fromTextArea( document.getElementById( target ), {
739 viewportMargin: Infinity,
740 gutters: ["CodeMirror-lint-markers"],
743 editor.on("blur", function(){
751 $( ".collapse-textarea" ).on("click", function(e){
754 var target = $(this).data("target");
755 var syntax = $(this).data("syntax");
756 $("#expand_" + target ).show();
758 var editor = $( "#" + target ).next(".CodeMirror")[0].CodeMirror;
761 $( "#" + target ).hide();
766 [% INCLUDE 'intranet-bottom.inc' %]