Merge branch 'MDL-50547-master' of git://github.com/jleyva/moodle
[moodle.git] / theme / boost / templates / mod_forum / big_search_form.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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 {{!
18     @template mod_forum/big_search_form
20     Big search form.
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     }
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 table table-striped" id="form" cellpadding="10">
58             <tr>
59                 <td class="c0 text-xs-right">
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" class="form-control" name="words" id="words" value="{{words}}">
65                 </td>
66             </tr>
67             <tr>
68                 <td class="c0 text-xs-right">
69                     <label for="phrase">{{#str}}searchphrase, forum{{/str}}</label>
70                 </td>
71                 <td class="c1">
72                     <input type="text" class="form-control" name="phrase" id="phrase" value="{{phrase}}">
73                 </td>
74             </tr>
75             <tr>
76                 <td class="c0 text-xs-right">
77                     <label for="notwords">{{#str}}searchnotwords, forum{{/str}}</label>
78                 </td>
79                 <td class="c1">
80                     <input type="text" class="form-control" name="notwords" id="notwords" value="{{notwords}}">
81                 </td>
82             </tr>
83             {{#showfullwords}}
84                 <tr>
85                     <td class="c0 text-xs-right">
86                         <label for="fullwords">{{#str}}searchfullwords, forum{{/str}}</label>
87                     </td>
88                     <td class="c1">
89                         <input type="text" class="form-control" name="fullwords" id="fullwords" value="{{fullwords}}">
90                     </td>
91                 </tr>
92             {{/showfullwords}}
93             <tr>
94                 <td class="c0 text-xs-right">
95                     {{#str}}searchdatefrom, forum{{/str}}
96                 </td>
97                 <td class="c1 text-nowrap form-inline">
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 text-xs-right">
109                     {{#str}}searchdateto, forum{{/str}}
110                 </td>
111                 <td class="c1 text-nowrap form-inline">
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 text-xs-right">
123                     <label for="menuforumid">{{#str}}searchwhichforums, forum{{/str}}</label>
124                 </td>
125                 <td class="c1">
126                     <select name="forumid" id="menuforumid" class="form-control">
127                         {{#forumoptions}}
128                             <option value="{{value}}">{{name}}</option>
129                         {{/forumoptions}}
130                     </select>
131                 </td>
132             </tr>
133             <tr>
134                 <td class="c0 text-xs-right">
135                     <label for="subject">{{#str}}searchsubject, forum{{/str}}</label>
136                 </td>
137                 <td class="c1">
138                     <input type="text" class="form-control" name="subject" id="subject" value="{{subject}}">
139                 </td>
140             </tr>
141             <tr>
142                 <td class="c0 text-xs-right">
143                     <label for="user">{{#str}}searchuser, forum{{/str}}</label>
144                 </td>
145                 <td class="c1">
146                     <input type="text" class="form-control" name="user" id="user" value="{{user}}">
147                 </td>
148             </tr>
149             <tr>
150                 <td> </td>
151                 <td class="submit">
152                     <button type="submit" class="btn btn-primary">{{#str}}searchforums, forum{{/str}}</button>
153                 </td>
154             </tr>
155         </table>
156     </form>
157     {{#js}}
158         lockoptions_timetoitems();
159         lockoptions_timefromitems();
160     {{/js}}
161 </div>