feed.mustache 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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/feed
  16. Template which defines an item in an RSS Feed
  17. Classes required for JS:
  18. * none
  19. Data attributes required for JS:
  20. * none
  21. Context variables required for this template:
  22. * channel_image - object: URL, title and link for the channel image.
  23. * title - string: The title of the feed.
  24. * items - array: An array of feed items.
  25. Example context (json):
  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. "feeditems": [
  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. {{$image}}
  54. {{#image}}
  55. {{> block_rss_client/channel_image}}
  56. {{/image}}
  57. {{/image}}
  58. {{$title}}
  59. {{#title}}
  60. <div class="title">{{title}}</div>
  61. {{/title}}
  62. {{/title}}
  63. {{$items}}
  64. <ul class="list no-overflow">
  65. {{#items}}
  66. {{> block_rss_client/item}}
  67. {{/items}}
  68. </ul>
  69. {{/items}}