block.mustache 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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_rss_client/block
  16. Template which defines an RSS Feeds block
  17. Classes required for JS:
  18. * none
  19. Data attributes required for JS:
  20. * none
  21. Context variables required for this template:
  22. * feeds - array: An array of RSS feeds.
  23. Example context (json):
  24. {
  25. "feeds": [
  26. {
  27. "title": "News from around my living room",
  28. "image": {
  29. "url": "https://www.example.com/feeds/news/poster.jpg",
  30. "title": "Example News Logo",
  31. "link": "https://www.example.com/feeds/news/"
  32. },
  33. "items": [
  34. {
  35. "id": "https://www.example.com/node/12",
  36. "link": "https://www.example.com/my-turtle-story.html",
  37. "title": "My Turtle Story",
  38. "description": "This is a story about my turtle.",
  39. "permalink": "https://www.example.com/my-turtle-story.html",
  40. "datepublished": "11 January 2016, 7:11 pm"
  41. },
  42. {
  43. "id": "https://www.example.com/node/12",
  44. "link": "https://www.example.com/my-cat-story.html",
  45. "title": "My Story",
  46. "description": "This is a story about my cats.",
  47. "permalink": "https://www.example.com/my-cat-story.html",
  48. "datepublished": "12 January 2016, 9:12 pm"
  49. }
  50. ]
  51. },
  52. {
  53. "title": "News from around my kitchen",
  54. "image": {
  55. "url": "https://www.example.com/feeds/news/kitchen.jpg",
  56. "title": "Picture of My Kitchen",
  57. "link": "https://www.example.com/feeds/news/kitchen/"
  58. },
  59. "items": [
  60. {
  61. "id": "https://www.example.com/node/10",
  62. "link": "https://www.example.com/oven-smoke.html",
  63. "title": "Why is the Oven Smoking?",
  64. "description": "There is something smoking in the oven.",
  65. "permalink": "https://www.example.com/oven-smoke.html",
  66. "datepublished": "10 January 2016, 1:13 pm"
  67. },
  68. {
  69. "id": "https://www.example.com/node/13",
  70. "link": "https://www.example.com/coffee-is-good.html",
  71. "title": "Why My Coffee Machine is So Great!",
  72. "description": "Don't be fancy; drips are best.",
  73. "permalink": "https://www.example.com/oven-smoke.html",
  74. "datepublished": "13 January 2016, 8:25 pm"
  75. }
  76. ]
  77. }
  78. ]
  79. }
  80. }}
  81. {{#feeds}}
  82. {{> block_rss_client/feed}}
  83. {{/feeds}}