Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

newsfeed.njk 2.9KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. {% if loaded %}
  2. {% if config.showAsList %}
  3. <ul class="newsfeed-list">
  4. {% for item in items %}
  5. <li>
  6. {% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
  7. <div class="newsfeed-source light small dimmed">
  8. {% if item.sourceTitle and config.showSourceTitle %}
  9. {{ item.sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
  10. {% endif %}
  11. {% if config.showPublishDate %}
  12. {{ item.publishDate }}:
  13. {% endif %}
  14. </div>
  15. {% endif %}
  16. <div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
  17. {{ item.title }}
  18. </div>
  19. {% if config.showDescription %}
  20. <div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
  21. {% if config.truncDescription %}
  22. {{ item.description | truncate(config.lengthDescription) }}
  23. {% else %}
  24. {{ item.description }}
  25. {% endif %}
  26. </div>
  27. {% endif %}
  28. </li>
  29. {% endfor %}
  30. </ul>
  31. {% else %}
  32. <div>
  33. {% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
  34. <div class="newsfeed-source light small dimmed">
  35. {% if sourceTitle and config.showSourceTitle %}
  36. {{ sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
  37. {% endif %}
  38. {% if config.showPublishDate %}
  39. {{ publishDate }}:
  40. {% endif %}
  41. </div>
  42. {% endif %}
  43. <div class="newsfeed-title bright medium light{{ ' no-wrap' if not config.wrapTitle }}">
  44. {{ title }}
  45. </div>
  46. {% if config.showDescription %}
  47. <div class="newsfeed-desc small light{{ ' no-wrap' if not config.wrapDescription }}">
  48. {% if config.truncDescription %}
  49. {{ description | truncate(config.lengthDescription) }}
  50. {% else %}
  51. {{ description }}
  52. {% endif %}
  53. </div>
  54. {% endif %}
  55. </div>
  56. {% endif %}
  57. {% elseif error %}
  58. <div class="small dimmed">
  59. {{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}
  60. </div>
  61. {% else %}
  62. <div class="small dimmed">
  63. {{ "LOADING" | translate | safe }}
  64. </div>
  65. {% endif %}