Merge branch 'wip_MDL-57590_master_forum_search' of https://github.com/mchurchward...
[moodle.git] / mod / forum / templates / big_search_form.mustache
CommitLineData
10deddd3
FM
1{{!
2 This file is part of Moodle - http://moodle.org/
3
4 Moodle is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 Moodle is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16}}
17{{!
d679a45f
MC
18 @template mod_forum/big_search_form
19
10deddd3 20 Big search form.
d679a45f
MC
21
22 Example context (json):
23 {
24 "scripturl": "https://example.com/mod/forum/forum.js",
25 "actionurl": "https://example.com/mod/forum/search.php",
26 "courseid": "2",
27 "words": "apples",
28 "phrase": "Lorem ipsum dolor",
29 "notwords": "Not these words",
30 "showfullwords": [
31 {
32 "fullwords": "Exactly"
33 }
34 ],
35 "datefromchecked": 1,
36 "datetochecked": "",
37 "forumoptions": [
38 {
39 "name": "Forum One",
40 "value": "23"
41 },
42 {
43 "name": "Forum Two",
44 "value": "34"
45 }
46 ],
47 "subject": "Help me please",
48 "user": "Helpy McUser"
49 }
10deddd3
FM
50}}
51<div id="intro" class="box searchbox boxaligncenter">
52 {{#str}}searchforumintro, forum{{/str}}
53</div>
54<div class="box generalbox boxaligncenter">
55 <script type="text/javascript" src="{{scripturl}}"></script>
56 <form id="searchform" action="{{actionurl}}" method="get">
57 <table class="searchbox" id="form" cellpadding="10">
58 <tr>
59 <td class="c0">
60 <label for="words">{{#str}}searchwords, forum{{/str}}</label>
61 <input type="hidden" value="{{courseid}}" name="id">
62 </td>
63 <td class="c1">
64 <input type="text" size="35" name="words" id="words" value="{{words}}">
65 </td>
66 </tr>
67 <tr>
68 <td class="c0">
69 <label for="phrase">{{#str}}searchphrase, forum{{/str}}</label>
70 </td>
71 <td class="c1">
72 <input type="text" size="35" name="phrase" id="phrase" value="{{phrase}}">
73 </td>
74 </tr>
75 <tr>
76 <td class="c0">
77 <label for="notwords">{{#str}}searchnotwords, forum{{/str}}</label>
78 </td>
79 <td class="c1">
80 <input type="text" size="35" name="notwords" id="notwords" value="{{notwords}}">
81 </td>
82 </tr>
83 {{#showfullwords}}
84 <tr>
85 <td class="c0">
86 <label for="fullwords">{{#str}}searchfullwords, forum{{/str}}</label>
87 </td>
88 <td class="c1">
89 <input type="text" size="35" name="fullwords" id="fullwords" value="{{fullwords}}">
90 </td>
91 </tr>
92 {{/showfullwords}}
93 <tr>
94 <td class="c0">
95 {{#str}}searchdatefrom, forum{{/str}}
96 </td>
97 <td class="c1">
98 <input type="checkbox" name="timefromrestrict" value="1" onclick="return lockoptions('searchform', 'timefromrestrict', timefromitems)" {{#datefromchecked}}checked{{/datefromchecked}}>
99 {{{datefromfields}}}
100 <input type="hidden" name="hfromday" value="0">
101 <input type="hidden" name="hfrommonth" value="0">
102 <input type="hidden" name="hfromyear" value="0">
103 <input type="hidden" name="hfromhour" value="0">
104 <input type="hidden" name="hfromminute" value="0">
105 </td>
106 </tr>
107 <tr>
108 <td class="c0">
109 {{#str}}searchdateto, forum{{/str}}
110 </td>
111 <td class="c1">
112 <input type="checkbox" name="timetorestrict" value="1" onclick="return lockoptions('searchform', 'timetorestrict', timetoitems)" {{#datetochecked}}checked{{/datetochecked}}>
113 {{{datetofields}}}
114 <input type="hidden" name="htoday" value="0">
115 <input type="hidden" name="htomonth" value="0">
116 <input type="hidden" name="htoyear" value="0">
117 <input type="hidden" name="htohour" value="0">
118 <input type="hidden" name="htominute" value="0">
119 </td>
120 </tr>
121 <tr>
122 <td class="c0">
123 <label for="menuforumid">{{#str}}searchwhichforums, forum{{/str}}</label>
124 </td>
125 <td class="c1">
d679a45f 126 <select name="forumid" id="menuforumid">
10deddd3
FM
127 {{#forumoptions}}
128 <option value="{{value}}">{{name}}</option>
129 {{/forumoptions}}
130 </select>
131 </td>
132 </tr>
133 <tr>
134 <td class="c0">
135 <label for="subject">{{#str}}searchsubject, forum{{/str}}</label>
136 </td>
137 <td class="c1">
138 <input type="text" size="35" name="subject" id="subject" value="{{subject}}">
139 </td>
140 </tr>
141 <tr>
142 <td class="c0">
143 <label for="user">{{#str}}searchuser, forum{{/str}}</label>
144 </td>
145 <td class="c1">
146 <input type="text" size="35" name="user" id="user" value="{{user}}">
147 </td>
148 </tr>
149 <tr>
150 <td colspan="2" class="submit" align="center">
151 <input type="submit" value={{#quote}}{{#str}}searchforums, forum{{/str}}{{/quote}}>
152 </td>
153 </tr>
154 </table>
155 </form>
156 {{#js}}
157 lockoptions_timetoitems();
158 lockoptions_timefromitems();
159 {{/js}}
160</div>