| 1 | efrain | 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 | {{!
 | 
        
           |  |  | 18 |     @template core/local/choicelist
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Default template for a choicelist object.
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Classes required for JS:
 | 
        
           |  |  | 23 |     * none
 | 
        
           |  |  | 24 |   | 
        
           |  |  | 25 |     Context variables required for this template:
 | 
        
           |  |  | 26 |     * buttoncontent String - the dropdown trigger button content.
 | 
        
           |  |  | 27 |     * choices Array - the status options.
 | 
        
           |  |  | 28 |   | 
        
           |  |  | 29 |     Example context (json):
 | 
        
           |  |  | 30 |     {
 | 
        
           |  |  | 31 |         "hasoptions": true,
 | 
        
           |  |  | 32 |         "dialogcontent": "Dialog content",
 | 
        
           |  |  | 33 |         "options": [
 | 
        
           |  |  | 34 |             {
 | 
        
           |  |  | 35 |                 "optionid": "option1",
 | 
        
           |  |  | 36 |                 "value": "value1",
 | 
        
           |  |  | 37 |                 "name": "First option",
 | 
        
           |  |  | 38 |                 "description": "First option description",
 | 
        
           |  |  | 39 |                 "hasicon": false,
 | 
        
           |  |  | 40 |                 "first": true,
 | 
        
           |  |  | 41 |                 "optionnumber": 1,
 | 
        
           |  |  | 42 |                 "optionuniqid": "option1uniqid",
 | 
        
           |  |  | 43 |                 "selected": true
 | 
        
           |  |  | 44 |             },
 | 
        
           |  |  | 45 |             {
 | 
        
           |  |  | 46 |                 "optionid": "option2",
 | 
        
           |  |  | 47 |                 "value": "value2",
 | 
        
           |  |  | 48 |                 "name": "Second option",
 | 
        
           |  |  | 49 |                 "description": "Second option description",
 | 
        
           |  |  | 50 |                 "icon": {
 | 
        
           |  |  | 51 |                     "extraclasses": "iconhelp",
 | 
        
           |  |  | 52 |                     "attributes": [
 | 
        
           |  |  | 53 |                         {"name": "src", "value": "../../../pix/help.svg"},
 | 
        
           |  |  | 54 |                         {"name": "alt", "value": "Help icon"}
 | 
        
           |  |  | 55 |                     ]
 | 
        
           |  |  | 56 |                 },
 | 
        
           |  |  | 57 |                 "hasicon": true,
 | 
        
           |  |  | 58 |                 "optionnumber": 2,
 | 
        
           |  |  | 59 |                 "optionuniqid": "option2uniqid"
 | 
        
           |  |  | 60 |             },
 | 
        
           |  |  | 61 |             {
 | 
        
           |  |  | 62 |                 "optionid": "option3",
 | 
        
           |  |  | 63 |                 "value": "value3",
 | 
        
           |  |  | 64 |                 "name": "Third option",
 | 
        
           |  |  | 65 |                 "description": "Third option description",
 | 
        
           |  |  | 66 |                 "icon": {
 | 
        
           |  |  | 67 |                     "extraclasses": "iconhelp",
 | 
        
           |  |  | 68 |                     "attributes": [
 | 
        
           |  |  | 69 |                         {"name": "src", "value": "../../../pix/help.svg"},
 | 
        
           |  |  | 70 |                         {"name": "alt", "value": "Help icon"}
 | 
        
           |  |  | 71 |                     ]
 | 
        
           |  |  | 72 |                 },
 | 
        
           |  |  | 73 |                 "hasicon": true,
 | 
        
           |  |  | 74 |                 "disabled": true,
 | 
        
           |  |  | 75 |                 "optionnumber": 3,
 | 
        
           |  |  | 76 |                 "optionuniqid": "option3uniqid"
 | 
        
           |  |  | 77 |             }
 | 
        
           |  |  | 78 |         ]
 | 
        
           |  |  | 79 |     }
 | 
        
           |  |  | 80 | }}
 | 
        
           |  |  | 81 | <div class="d-flex flex-column choicelist p-1" role="listbox">
 | 
        
           |  |  | 82 |     {{#options}}
 | 
        
           |  |  | 83 |         {{> core/local/choicelist/option}}
 | 
        
           |  |  | 84 |     {{/options}}
 | 
        
           |  |  | 85 | </div>
 |