d003f7628f317015f4fb14d781e17bd6bca4b943
[moodle.git] / theme / bootstrapbase / templates / block_myoverview / course-action-menu.mustache
1 {{!
2     This file is part of Moodle - http://moodle.org/
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.
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.
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 block_myoverview/course-action-menu
20     This template renders action menu for each course.
22     Example context (json):
23     {
24         "isfavourite": true,
25         "hidden": true
26     }
27 }}
28 <div class="ml-auto dropdown">
29     <button class="btn btn-link btn-icon icon-size-3 coursemenubtn"
30         type="button"
31         data-toggle="dropdown"
32         aria-haspopup="true"
33         aria-expanded="false"
34         aria-label="{{#str}} aria:courseactions, block_myoverview {{/str}}">
35         {{#pix}} i/moremenu, core {{/pix}}
36     </button>
37     <div class="dropdown-menu pull-right">
38         <ul class="list-unstyled">
39             <li class="{{#isfavourite}}hidden{{/isfavourite}}" data-action="add-favourite" data-course-id="{{id}}">
40                 <a class="dropdown-item p-a-1" href="#">
41                     {{#pix}} i/star, core, {{#str}} starred, block_myoverview {{/str}} {{/pix}}
42                     {{#str}} addtofavourites, block_myoverview {{/str}}
43                 </a>
44             </li>
45             <li class="{{^isfavourite}}hidden{{/isfavourite}}" data-action="remove-favourite" data-course-id="{{id}}">
46                 <a class="dropdown-item p-a-1" href="#">
47                     {{#str}} removefromfavourites, block_myoverview {{/str}}
48                 </a>
49             </li>
50             <li class="{{^hidden}}hidden{{/hidden}}" data-action="show-course" data-course-id="{{id}}">
51                 <a class="dropdown-item p-a-1" href="#">
52                     {{#pix}} i/show, core, {{#str}} hidden, block_myoverview {{/str}} {{/pix}}
53                     {{#str}} show, block_myoverview {{/str}}
54                 </a>
55             </li>
56             <li class="{{#hidden}}hidden{{/hidden}}" data-action="hide-course" data-course-id="{{id}}">
57                 <a class="dropdown-item p-a-1" href="#">
58                     {{#pix}} i/hide, core, {{#str}} hidden, block_myoverview {{/str}} {{/pix}}
59                     {{#str}} hidecourse, block_myoverview {{/str}}
60                 </a>
61             </li>
62         </ul>
63     </div>
64 </div>