| 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_courseformat/local/content/addsection
  | 
        
        
            | 
            | 
           19 | 
              | 
        
        
            | 
            | 
           20 | 
               Displays the add section button inside a course.
  | 
        
        
            | 
            | 
           21 | 
              | 
        
        
            | 
            | 
           22 | 
               Example context (json):
  | 
        
        
            | 
            | 
           23 | 
               {
  | 
        
        
            | 
            | 
           24 | 
                   "showaddsection": true,
  | 
        
        
            | 
            | 
           25 | 
                   "id": 42,
  | 
        
        
            | 
            | 
           26 | 
                   "insertafter": true,
  | 
        
        
            | 
            | 
           27 | 
                   "num": 0,
  | 
        
        
            | 
            | 
           28 | 
                   "increase": {
  | 
        
        
            | 
            | 
           29 | 
                       "url": "#"
  | 
        
        
            | 
            | 
           30 | 
                   },
  | 
        
        
            | 
            | 
           31 | 
                   "decrease": {
  | 
        
        
            | 
            | 
           32 | 
                       "url": "#"
  | 
        
        
            | 
            | 
           33 | 
                   },
  | 
        
        
            | 
            | 
           34 | 
                   "addsections": {
  | 
        
        
            | 
            | 
           35 | 
                       "url": "#",
  | 
        
        
            | 
            | 
           36 | 
                       "title": "Add section",
  | 
        
        
            | 
            | 
           37 | 
                       "newsection": 3
  | 
        
        
            | 
            | 
           38 | 
                   }
  | 
        
        
            | 
            | 
           39 | 
               }
  | 
        
        
            | 
            | 
           40 | 
           }}
  | 
        
        
            | 
            | 
           41 | 
           {{#showaddsection}}
  | 
        
        
            | 
            | 
           42 | 
           <div class="mdl-left py-2 changenumsections bulk-hidden">
  | 
        
        
            | 
            | 
           43 | 
               {{#increase}}
  | 
        
        
            | 
            | 
           44 | 
               <a href="{{{url}}}" class="increase-sections btn btn-success">
  | 
        
        
            | 
            | 
           45 | 
                   {{#pix}}t/switch_plus, moodle, {{#str}} increasesections, moodle {{/str}}{{/pix}}
  | 
        
        
            | 
            | 
           46 | 
               </a>
  | 
        
        
            | 
            | 
           47 | 
               {{/increase}}
  | 
        
        
            | 
            | 
           48 | 
               {{#decrease}}
  | 
        
        
            | 
            | 
           49 | 
               <a href="{{{url}}}" class="reduce-sections btn btn-danger">
  | 
        
        
            | 
            | 
           50 | 
                   {{#pix}}t/switch_minus, moodle, {{#str}} reducesections, moodle {{/str}}{{/pix}}
  | 
        
        
            | 
            | 
           51 | 
               </a>
  | 
        
        
            | 
            | 
           52 | 
               {{/decrease}}
  | 
        
        
            | 
            | 
           53 | 
               {{#addsections}}
  | 
        
        
            | 
            | 
           54 | 
               <a
  | 
        
        
            | 
            | 
           55 | 
                   href="{{{url}}}"
  | 
        
        
            | 
            | 
           56 | 
                   class="add-sections w-100 btn btn-primary"
  | 
        
        
            | 
            | 
           57 | 
                   data-add-sections="{{title}}"
  | 
        
        
            | 
            | 
           58 | 
                   data-new-sections="{{newsection}}"
  | 
        
        
            | 
            | 
           59 | 
                   data-action="addSection"
  | 
        
        
            | 
            | 
           60 | 
                   {{#insertafter}} data-id="{{id}}" {{/insertafter}}
  | 
        
        
            | 
            | 
           61 | 
               >
  | 
        
        
            | 
            | 
           62 | 
                   {{title}}
  | 
        
        
            | 
            | 
           63 | 
               </a>
  | 
        
        
            | 
            | 
           64 | 
               {{/addsections}}
  | 
        
        
            | 
            | 
           65 | 
           </div>
  | 
        
        
            | 
            | 
           66 | 
           {{/showaddsection}}
  |