| 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/process_monitor/process
 | 
        
           |  |  | 19 |   | 
        
           |  |  | 20 |     Template to render a process inside the process monitor.
 | 
        
           |  |  | 21 |   | 
        
           |  |  | 22 |     Example context (json):
 | 
        
           |  |  | 23 |     {
 | 
        
           |  |  | 24 |         "id": 42,
 | 
        
           |  |  | 25 |         "name": "Sample",
 | 
        
           |  |  | 26 |         "percentage": 30,
 | 
        
           |  |  | 27 |         "error": "Something goes wrong"
 | 
        
           |  |  | 28 |     }
 | 
        
           |  |  | 29 | }}
 | 
        
           |  |  | 30 | <div
 | 
        
           |  |  | 31 |     class="queue-process d-flex flex-column p-2"
 | 
        
           |  |  | 32 |     data-for="queue-process"
 | 
        
           |  |  | 33 |     data-id="{{id}}"
 | 
        
           |  |  | 34 | >
 | 
        
           |  |  | 35 |     <div class="d-flex flex-row align-items-center">
 | 
        
           |  |  | 36 |         <div class="p-2 uploadname text-truncate" data-for="name"> {{name}} </div>
 | 
        
           | 1441 | ariadna | 37 |         <div class="ms-auto p-2 progressbar">
 | 
        
           | 1 | efrain | 38 |             <progress value="{{percentage}}" max="100"></progress>
 | 
        
           |  |  | 39 |             <button
 | 
        
           |  |  | 40 |                 type="button"
 | 
        
           | 1441 | ariadna | 41 |                 class="d-none btn-close"
 | 
        
           | 1 | efrain | 42 |                 data-action="closeProcess"
 | 
        
           |  |  | 43 |                 aria-label="{{#str}}closebuttontitle, core{{/str}}"
 | 
        
           | 1441 | ariadna | 44 |             ></button>
 | 
        
           | 1 | efrain | 45 |         </div>
 | 
        
           |  |  | 46 |     </div>
 | 
        
           |  |  | 47 |     <div class="d-none alert alert-danger" role="alert" data-for="error">
 | 
        
           |  |  | 48 |         {{error}}
 | 
        
           |  |  | 49 |     </div>
 | 
        
           |  |  | 50 | </div>
 | 
        
           |  |  | 51 | {{#js}}
 | 
        
           |  |  | 52 | require(['core/local/process_monitor/process'], function(component) {
 | 
        
           |  |  | 53 |     component.init('[data-for="queue-process"][data-id="{{id}}"]');
 | 
        
           |  |  | 54 | });
 | 
        
           |  |  | 55 | {{/js}}
 |