| 1 | 
           efrain | 
           1 | 
           {{!
  | 
        
        
            | 
            | 
           2 | 
               This file is part of Moodle - http://moodle.org/
  | 
        
        
            | 
            | 
           3 | 
               Moodle is free software: you can redistribute it and/or modify
  | 
        
        
            | 
            | 
           4 | 
               it under the terms of the GNU General Public License as published by
  | 
        
        
            | 
            | 
           5 | 
               the Free Software Foundation, either version 3 of the License, or
  | 
        
        
            | 
            | 
           6 | 
               (at your option) any later version.
  | 
        
        
            | 
            | 
           7 | 
               Moodle is distributed in the hope that it will be useful,
  | 
        
        
            | 
            | 
           8 | 
               but WITHOUT ANY WARRANTY; without even the implied warranty of
  | 
        
        
            | 
            | 
           9 | 
               MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  | 
        
        
            | 
            | 
           10 | 
               GNU General Public License for more details.
  | 
        
        
            | 
            | 
           11 | 
               You should have received a copy of the GNU General Public License
  | 
        
        
            | 
            | 
           12 | 
               along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
  | 
        
        
            | 
            | 
           13 | 
           }}
  | 
        
        
            | 
            | 
           14 | 
           {{!
  | 
        
        
            | 
            | 
           15 | 
               @template mod_data/zero_state
  | 
        
        
            | 
            | 
           16 | 
              | 
        
        
            | 
            | 
           17 | 
               Form containing all database presets displayed within a table.
  | 
        
        
            | 
            | 
           18 | 
              | 
        
        
            | 
            | 
           19 | 
               Context variables required for this template:
  | 
        
        
            | 
            | 
           20 | 
               * noitemsimgurl - The image url.
  | 
        
        
            | 
            | 
           21 | 
               * importpresetbutton stdClass - Import preset single button to be rendered
  | 
        
        
            | 
            | 
           22 | 
               * createfieldbutton stdClass - Create a field action menu to be rendered
  | 
        
        
            | 
            | 
           23 | 
               * usepresetbutton stdClass - Use a preset single button to be rendered
  | 
        
        
            | 
            | 
           24 | 
              | 
        
        
            | 
            | 
           25 | 
               Example context (json):
  | 
        
        
            | 
            | 
           26 | 
               {
  | 
        
        
           | 1441 | 
           ariadna | 
           27 | 
                   "noitemsimgurl": "https://moodlesite/theme/image.php/universe/mod_data/1535727318/nofields",
  | 
        
        
           | 1 | 
           efrain | 
           28 | 
                   "title": "Title",
  | 
        
        
            | 
            | 
           29 | 
                   "importpresetbutton": {
  | 
        
        
            | 
            | 
           30 | 
                       "id" : "id1",
  | 
        
        
            | 
            | 
           31 | 
                       "method" : "get",
  | 
        
        
            | 
            | 
           32 | 
                       "url" : "#",
  | 
        
        
            | 
            | 
           33 | 
                       "primary" : false,
  | 
        
        
            | 
            | 
           34 | 
                       "tooltip" : "This is a tooltip",
  | 
        
        
            | 
            | 
           35 | 
                       "label" : "Button1",
  | 
        
        
            | 
            | 
           36 | 
                       "attributes": [
  | 
        
        
            | 
            | 
           37 | 
                           {
  | 
        
        
            | 
            | 
           38 | 
                             "name": "data-attribute",
  | 
        
        
            | 
            | 
           39 | 
                             "value": "no"
  | 
        
        
            | 
            | 
           40 | 
                           }
  | 
        
        
            | 
            | 
           41 | 
                       ]
  | 
        
        
            | 
            | 
           42 | 
                   },
  | 
        
        
            | 
            | 
           43 | 
                   "createfieldbutton": {
  | 
        
        
            | 
            | 
           44 | 
                       "id" : "id2",
  | 
        
        
            | 
            | 
           45 | 
                       "method" : "get",
  | 
        
        
            | 
            | 
           46 | 
                       "url" : "#",
  | 
        
        
            | 
            | 
           47 | 
                       "primary" : true,
  | 
        
        
            | 
            | 
           48 | 
                       "tooltip" : "This is a tooltip",
  | 
        
        
            | 
            | 
           49 | 
                       "label" : "Button2",
  | 
        
        
            | 
            | 
           50 | 
                       "attributes": [
  | 
        
        
            | 
            | 
           51 | 
                           {
  | 
        
        
            | 
            | 
           52 | 
                             "name": "data-attribute",
  | 
        
        
            | 
            | 
           53 | 
                             "value": "yeah"
  | 
        
        
            | 
            | 
           54 | 
                           }
  | 
        
        
            | 
            | 
           55 | 
                       ]
  | 
        
        
            | 
            | 
           56 | 
                   },
  | 
        
        
            | 
            | 
           57 | 
                   "usepresetbutton": {
  | 
        
        
            | 
            | 
           58 | 
                       "id" : "id3",
  | 
        
        
            | 
            | 
           59 | 
                       "method" : "get",
  | 
        
        
            | 
            | 
           60 | 
                       "url" : "#",
  | 
        
        
            | 
            | 
           61 | 
                       "primary" : false,
  | 
        
        
            | 
            | 
           62 | 
                       "tooltip" : "This is a tooltip",
  | 
        
        
            | 
            | 
           63 | 
                       "label" : "Button3",
  | 
        
        
            | 
            | 
           64 | 
                       "attributes": [
  | 
        
        
            | 
            | 
           65 | 
                           {
  | 
        
        
            | 
            | 
           66 | 
                             "name": "data-attribute",
  | 
        
        
            | 
            | 
           67 | 
                             "value": "perhaps"
  | 
        
        
            | 
            | 
           68 | 
                           }
  | 
        
        
            | 
            | 
           69 | 
                       ]
  | 
        
        
            | 
            | 
           70 | 
                   }
  | 
        
        
            | 
            | 
           71 | 
               }
  | 
        
        
            | 
            | 
           72 | 
           }}
  | 
        
        
            | 
            | 
           73 | 
           <div class="mt-4" data-region="empty-message">
  | 
        
        
            | 
            | 
           74 | 
               <hr />
  | 
        
        
            | 
            | 
           75 | 
               <h3 class="h3 mt-4 mb-0">{{{ title }}}</h5>
  | 
        
        
            | 
            | 
           76 | 
               {{#intro}}
  | 
        
        
            | 
            | 
           77 | 
                   <p class="mt-1 mb-4">{{{ intro }}}</p>
  | 
        
        
            | 
            | 
           78 | 
               {{/intro}}
  | 
        
        
            | 
            | 
           79 | 
               <hr />
  | 
        
        
            | 
            | 
           80 | 
               <div class="mt-5 mb-0 d-flex flex-wrap w-100" id="action_bar">
  | 
        
        
            | 
            | 
           81 | 
                   {{#createfieldbutton}}
  | 
        
        
            | 
            | 
           82 | 
                       {{>core/action_menu}}
  | 
        
        
            | 
            | 
           83 | 
                   {{/createfieldbutton}}
  | 
        
        
            | 
            | 
           84 | 
                   <div class="w-100 mt-3">
  | 
        
        
            | 
            | 
           85 | 
                       {{#importpresetbutton}}
  | 
        
        
            | 
            | 
           86 | 
                       {{>core/single_button}}
  | 
        
        
            | 
            | 
           87 | 
                       {{/importpresetbutton}}
  | 
        
        
            | 
            | 
           88 | 
                       {{#usepresetbutton}}
  | 
        
        
            | 
            | 
           89 | 
                           {{>core/single_button}}
  | 
        
        
            | 
            | 
           90 | 
                       {{/usepresetbutton}}
  | 
        
        
            | 
            | 
           91 | 
                   </div>
  | 
        
        
            | 
            | 
           92 | 
               </div>
  | 
        
        
            | 
            | 
           93 | 
           {{#js}}
  | 
        
        
            | 
            | 
           94 | 
               require(['mod_data/importpresets'], function(importPresetsModal) {
  | 
        
        
            | 
            | 
           95 | 
                   importPresetsModal.init();
  | 
        
        
            | 
            | 
           96 | 
               });
  | 
        
        
            | 
            | 
           97 | 
           {{/js}}
  | 
        
        
            | 
            | 
           98 | 
           </div>
  |