| 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_reportbuilder/local/dynamictabs/audience
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Template for report audience
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Example context (json):
 | 
        
           |  |  | 23 |     {
 | 
        
           |  |  | 24 |         "reportid": 1,
 | 
        
           |  |  | 25 |         "contextid": 1,
 | 
        
           |  |  | 26 |         "hasinstances": 1,
 | 
        
           |  |  | 27 |         "instances": [{
 | 
        
           |  |  | 28 |             "instanceid": 1,
 | 
        
           |  |  | 29 |             "heading": "Title",
 | 
        
           |  |  | 30 |             "headingeditable": "Title (edit me)",
 | 
        
           |  |  | 31 |             "showormessage": 1,
 | 
        
           |  |  | 32 |             "canedit": 1,
 | 
        
           |  |  | 33 |             "candelete": 1,
 | 
        
           |  |  | 34 |             "description": "description",
 | 
        
           |  |  | 35 |             "form": "form"
 | 
        
           |  |  | 36 |         }],
 | 
        
           |  |  | 37 |         "sidebarmenucards": [{
 | 
        
           |  |  | 38 |             "menucards": [{
 | 
        
           |  |  | 39 |                 "name": "General",
 | 
        
           |  |  | 40 |                 "items": [{
 | 
        
           |  |  | 41 |                     "name": "Manually added users",
 | 
        
           |  |  | 42 |                     "identifier": "core_reportbuilder:users"
 | 
        
           |  |  | 43 |                 }]
 | 
        
           |  |  | 44 |             }]
 | 
        
           |  |  | 45 |         }]
 | 
        
           |  |  | 46 |     }
 | 
        
           |  |  | 47 | }}
 | 
        
           |  |  | 48 | <h2 class="sr-only">{{#str}} audience, core_reportbuilder {{/str}}</h2>
 | 
        
           |  |  | 49 | <div class="audiences-wrapper d-flex flex-column flex-lg-row">
 | 
        
           |  |  | 50 |     <div id="audiences-menu">
 | 
        
           |  |  | 51 |         {{! Sidebar }}
 | 
        
           |  |  | 52 |         {{> core_reportbuilder/local/sidebar-menu/area}}
 | 
        
           |  |  | 53 |     </div>
 | 
        
           |  |  | 54 |     <div id="audiences-container" class="reportbuilder-audiences-container d-flex flex-column flex-fill" data-region="audiences">
 | 
        
           |  |  | 55 |         {{! No audience container }}
 | 
        
           |  |  | 56 |         <div class="justify-content-center {{#hasinstances}}hidden{{/hasinstances}}" data-region="no-instances-message">
 | 
        
           |  |  | 57 |             <div class="alert alert-info mb-0">{{#str}} noaudiences, core_reportbuilder {{/str}}</div>
 | 
        
           |  |  | 58 |         </div>
 | 
        
           |  |  | 59 |         {{#instances}}
 | 
        
           |  |  | 60 |             {{> core_reportbuilder/local/audience/form}}
 | 
        
           |  |  | 61 |         {{/instances}}
 | 
        
           |  |  | 62 |     </div>
 | 
        
           |  |  | 63 | </div>
 | 
        
           |  |  | 64 | {{#js}}
 | 
        
           |  |  | 65 |     require(['core_reportbuilder/audience'], function(audience) {
 | 
        
           |  |  | 66 |         audience.init({{reportid}}, {{contextid}});
 | 
        
           |  |  | 67 |     });
 | 
        
           |  |  | 68 | {{/js}}
 |