| 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 tool_dataprivacy/defaults_display
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Renders the current default category and purpose.
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Classes required for JS:
 | 
        
           |  |  | 23 |   | 
        
           |  |  | 24 |     Data attributes required for JS:
 | 
        
           |  |  | 25 |   | 
        
           |  |  | 26 |     Context variables required for this template:
 | 
        
           |  |  | 27 |     * contextlevel Number - The context level.
 | 
        
           |  |  | 28 |     * categoryid Number - The category ID.
 | 
        
           |  |  | 29 |     * purposeid Number - The purpose ID.
 | 
        
           |  |  | 30 |     * category String - The category name.
 | 
        
           |  |  | 31 |     * purpose String - The purpose name.
 | 
        
           |  |  | 32 |     * canedit Boolean - Whether this is being rendered for editing purposes.
 | 
        
           |  |  | 33 |   | 
        
           |  |  | 34 |     Example context (json):
 | 
        
           |  |  | 35 |     {
 | 
        
           |  |  | 36 |         "category": "Awesome default category",
 | 
        
           |  |  | 37 |         "categoryid": 1,
 | 
        
           |  |  | 38 |         "purpose": "Awesome default purpose",
 | 
        
           |  |  | 39 |         "purposeid": 2,
 | 
        
           |  |  | 40 |         "canedit": true,
 | 
        
           |  |  | 41 |         "contextlevel": 70
 | 
        
           |  |  | 42 |     }
 | 
        
           |  |  | 43 | }}
 | 
        
           |  |  | 44 | <div class="row rtl-compatible mt-1 mb-1">
 | 
        
           |  |  | 45 |     <div class="col-md-9">
 | 
        
           |  |  | 46 |         <div class="row rtl-compatible mt-1 mb-1">
 | 
        
           |  |  | 47 |             <div class="col-md-3">
 | 
        
           |  |  | 48 |                 <strong>{{#str}}category, tool_dataprivacy{{/str}}</strong>
 | 
        
           |  |  | 49 |             </div>
 | 
        
           |  |  | 50 |             <div class="col-md-9">
 | 
        
           |  |  | 51 |                 {{category}}
 | 
        
           |  |  | 52 |             </div>
 | 
        
           |  |  | 53 |         </div>
 | 
        
           |  |  | 54 |         <div class="row rtl-compatible mt-1 mb-1">
 | 
        
           |  |  | 55 |             <div class="col-md-3">
 | 
        
           |  |  | 56 |                 <strong>{{#str}}purpose, tool_dataprivacy{{/str}}</strong>
 | 
        
           |  |  | 57 |             </div>
 | 
        
           |  |  | 58 |             <div class="col-md-9">
 | 
        
           |  |  | 59 |                 {{purpose}}
 | 
        
           |  |  | 60 |             </div>
 | 
        
           |  |  | 61 |         </div>
 | 
        
           |  |  | 62 |     </div>
 | 
        
           |  |  | 63 |     <div class="col-md-3 align-self-center">
 | 
        
           |  |  | 64 |     {{#canedit}}
 | 
        
           |  |  | 65 |         <button class="btn btn-secondary" {{!
 | 
        
           |  |  | 66 |             }}data-action="edit-level-defaults" {{!
 | 
        
           |  |  | 67 |             }}data-contextlevel="{{contextlevel}}" {{!
 | 
        
           |  |  | 68 |             }}data-category="{{categoryid}}" {{!
 | 
        
           |  |  | 69 |             }}data-purpose="{{purposeid}}">
 | 
        
           |  |  | 70 |             {{#str}}edit{{/str}}
 | 
        
           |  |  | 71 |         </button>
 | 
        
           |  |  | 72 |     {{/canedit}}
 | 
        
           |  |  | 73 |     </div>
 | 
        
           |  |  | 74 | </div>
 |