Merge branch 'MDL-77259-401' of https://github.com/paulholden/moodle into MOODLE_401_...
[moodle.git] / my / templates / dropdown.mustache
blob6afe6ea8bcdd911d60f9193932712d2213eb3231
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/>.
17 {{!
18     @template my/dropdown
20     Simple dropdown for the my/courses page
22     Example context (json):
23     {
24         "newcourseurl": "https://moodle.test/course/edit.php?category=1",
25         "manageurl": "https://moodle.test/course/management.php?categoryid=1",
26         "courserequesturl": "https://moodle.test/course/request.php?categoryid=1"
27     }
29 <div class="btn-group{{#manageurl}} course-manage{{/manageurl}}{{#courserequesturl}} course-request{{/courserequesturl}}">
30     <!-- Set as a link to appease Goutte behat. -->
31     <a href="#" class="btn btn-link btn-icon icon-size-3 rounded-circle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{#str}}coursemanagementoptions, my{{/str}}">
32         <i class="fa fa-ellipsis-v text-dark  py-2" aria-hidden="true"></i>
33     </a>
34     <div class="dropdown-menu dropdown-menu-right">
35         {{#newcourseurl}}
36             <a class="dropdown-item" href="{{newcourseurl}}">{{#str}}newcourse, core{{/str}}</a>
37         {{/newcourseurl}}
38         {{#manageurl}}
39             <a class="dropdown-item" href="{{manageurl}}">{{#str}}managecourses, core{{/str}}</a>
40         {{/manageurl}}
41         {{#courserequesturl}}
42             <a class="dropdown-item" href="{{courserequesturl}}">{{#str}}requestcourse, core{{/str}}</a>
43         {{/courserequesturl}}
44     </div>
45 </div>