PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/blocks/myoverview/templates/course-action-menu.mustache

http://github.com/moodle/moodle
Mustache | 80 lines | 54 code | 0 blank | 26 comment | 0 complexity | c481ede39cd225ee9f498c903788ed46 MD5 | raw file
Possible License(s): MIT, AGPL-3.0, MPL-2.0-no-copyleft-exception, LGPL-3.0, GPL-3.0, Apache-2.0, LGPL-2.1, BSD-3-Clause
  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 block_myoverview/course-action-menu
  16. This template renders action menu for each course.
  17. Example context (json):
  18. {
  19. "isfavourite": true
  20. }
  21. }}
  22. <div class="ml-auto dropdown">
  23. <button class="btn btn-link btn-icon icon-size-3 coursemenubtn"
  24. type="button"
  25. data-toggle="dropdown"
  26. aria-haspopup="true"
  27. aria-expanded="false">
  28. {{#pix}} i/moremenu, core {{/pix}}
  29. <span class="sr-only">
  30. {{#str}} aria:courseactions, block_myoverview {{/str}} {{{fullname}}}
  31. </span>
  32. </button>
  33. <div class="dropdown-menu dropdown-menu-right">
  34. <a class="dropdown-item {{#isfavourite}}hidden{{/isfavourite}}" href="#"
  35. data-action="add-favourite"
  36. data-course-id="{{id}}"
  37. aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
  38. >
  39. {{#str}} addtofavourites, block_myoverview {{/str}}
  40. <div class="sr-only">
  41. {{#str}} aria:addtofavourites, block_myoverview {{/str}} {{{fullname}}}
  42. </div>
  43. </a>
  44. <a class="dropdown-item {{^isfavourite}}hidden{{/isfavourite}}" href="#"
  45. data-action="remove-favourite"
  46. data-course-id="{{id}}"
  47. aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
  48. >
  49. {{#str}} removefromfavourites, block_myoverview {{/str}}
  50. <div class="sr-only">
  51. {{#str}} aria:removefromfavourites, block_myoverview {{/str}} {{{fullname}}}
  52. </div>
  53. </a>
  54. <a class="dropdown-item {{^hidden}}hidden{{/hidden}}" href="#"
  55. data-action="show-course"
  56. data-course-id="{{id}}"
  57. aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
  58. >
  59. {{#str}} show, block_myoverview {{/str}}
  60. <div class="sr-only">
  61. {{#str}} aria:showcourse, block_myoverview, {{fullname}} {{/str}}
  62. </div>
  63. </a>
  64. <a class="dropdown-item {{#hidden}}hidden{{/hidden}}" href="#"
  65. data-action="hide-course"
  66. data-course-id="{{id}}"
  67. aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
  68. >
  69. {{#str}} hidecourse, block_myoverview {{/str}}
  70. <div class="sr-only">
  71. {{#str}} aria:hidecourse, block_myoverview, {{fullname}} {{/str}}
  72. </div>
  73. </a>
  74. </div>
  75. </div>