item.mustache 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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/item
  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. * id - string: A unique id for the feed item.
  23. * link - string: The URL of the feed item. Must already be escaped.
  24. * title - string: The title of the feed item.
  25. * description - string: The text description of the feed item.
  26. * permalink - string: The permalink of the feed item. Must already be escaped.
  27. * datepublished - string: The date the feed item was published.
  28. Example context (json):
  29. {
  30. "id": "https://www.example.com/node",
  31. "link": "https://www.example.com/my-cat-story.html",
  32. "title": "My Story",
  33. "description": "This is a story about my cats.",
  34. "permalink": "https://www.example.com/my-cat-story.html",
  35. "datepublished": "12 January 2016, 9:12 pm"
  36. }
  37. }}
  38. <li>
  39. {{$title}}
  40. <div class="link">
  41. <a href="{{{link}}}" onclick='this.target="_blank"'>{{title}}</a>
  42. </div>
  43. {{/title}}
  44. {{$content}}
  45. {{#description}}
  46. <div class="description">
  47. {{{description}}}
  48. </div>
  49. {{/description}}
  50. {{/content}}
  51. </li>