{{! This file is part of Moodle - http://moodle.org/ Moodle is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Moodle is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Moodle. If not, see . }} {{! @template mod_forum/big_search_form Big search form. Example context (json): { "actionurl": "https://example.com/mod/forum/search.php", "courseid": "2", "words": "apples", "phrase": "Lorem ipsum dolor", "notwords": "Not these words", "showfullwords": [ { "fullwords": "Exactly" } ], "datefromchecked": 1, "datetochecked": "", "forumoptions": [ { "name": "Forum One", "value": "23" }, { "name": "Forum Two", "value": "34" } ], "subject": "Help me please", "user": "Helpy McUser" } }}
{{#showfullwords}} {{/showfullwords}} {{#tagsenabled}} {{/tagsenabled}}
{{#js}} require(['jquery'], function($) { var toggleDateFields = function(prefix, disabled) { $('#searchform select[name^=' + prefix + ']').prop('disabled', disabled); $('#searchform input[name^=h' + prefix + ']').val(disabled ? 1 : 0); }; toggleDateFields('from', !$("#searchform input[name='timefromrestrict']").prop('checked')); $("#searchform input[name='timefromrestrict']").click(function() { toggleDateFields('from', !this.checked); }); toggleDateFields('to', !$("#searchform input[name='timetorestrict']").prop('checked')); $("#searchform input[name='timetorestrict']").click(function() { toggleDateFields('to', !this.checked); }); }); {{/js}}