diff --git a/modules/default/newsfeed/newsfeed.css b/modules/default/newsfeed/newsfeed.css
index 6f32b2e5..ea65eca2 100644
--- a/modules/default/newsfeed/newsfeed.css
+++ b/modules/default/newsfeed/newsfeed.css
@@ -12,3 +12,12 @@ iframe.newsfeed-fullarticle {
bottom: inherit;
top: -90px;
}
+
+.newsfeed-list {
+ list-style: none;
+}
+
+.newsfeed-list li {
+ text-align: justify;
+ margin-bottom: 0.5em;
+}
diff --git a/modules/default/newsfeed/newsfeed.js b/modules/default/newsfeed/newsfeed.js
index 6bd9b3cc..f33fd4cd 100644
--- a/modules/default/newsfeed/newsfeed.js
+++ b/modules/default/newsfeed/newsfeed.js
@@ -129,6 +129,10 @@ Module.register("newsfeed", {
}
const item = this.newsItems[this.activeItem];
+ const items = this.newsItems.map(function (item) {
+ item.publishDate = moment(new Date(item.pubdate)).fromNow();
+ return item;
+ });
return {
loaded: true,
@@ -137,7 +141,7 @@ Module.register("newsfeed", {
publishDate: moment(new Date(item.pubdate)).fromNow(),
title: item.title,
description: item.description,
- items: this.newsItems
+ items: items
};
},
@@ -247,7 +251,6 @@ Module.register("newsfeed", {
this.sendNotification("NEWS_FEED_UPDATE", { items: updatedItems });
}
- Log.warn(newsItems);
this.newsItems = newsItems;
},
diff --git a/modules/default/newsfeed/newsfeed.njk b/modules/default/newsfeed/newsfeed.njk
index 70071923..39062721 100644
--- a/modules/default/newsfeed/newsfeed.njk
+++ b/modules/default/newsfeed/newsfeed.njk
@@ -1,56 +1,56 @@
{% if loaded %}
-{% if config.showAsList %}
-
-{% for item in items %}
- -
-{% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
-
- {% if item.sourceTitle and config.showSourceTitle %}
- {{ item.sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
- {% endif %}
- {% if config.showPublishDate %}
- {{ item.publishDate }}:
- {% endif %}
-
- {% endif %}
-
- {{ item.title }}
-
-
- {% if config.truncDescription %}
- {{ item.description | truncate(config.lengthDescription) }}
- {% else %}
- {{ item.description }}
- {% endif %}
-
-
-
-{% endfor %}
-
+ {% if config.showAsList %}
+
+ {% for item in items %}
+ -
+ {% if (config.showSourceTitle and item.sourceTitle) or config.showPublishDate %}
+
+ {% if item.sourceTitle and config.showSourceTitle %}
+ {{ item.sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
+ {% endif %}
+ {% if config.showPublishDate %}
+ {{ item.publishDate }}:
+ {% endif %}
+
+ {% endif %}
+
+ {{ item.title }}
+
+
+ {% if config.truncDescription %}
+ {{ item.description | truncate(config.lengthDescription) }}
+ {% else %}
+ {{ item.description }}
+ {% endif %}
+
+
+
+ {% endfor %}
+
{% else %}
{% if (config.showSourceTitle and sourceTitle) or config.showPublishDate %}
- {% if sourceTitle and config.showSourceTitle %}
- {{ sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
- {% endif %}
- {% if config.showPublishDate %}
- {{ publishDate }}:
+ {% if sourceTitle and config.showSourceTitle %}
+ {{ sourceTitle }}{% if config.showPublishDate %}, {% else %}: {% endif %}
+ {% endif %}
+ {% if config.showPublishDate %}
+ {{ publishDate }}:
+ {% endif %}
+
+ {% endif %}
+
+ {{ title }}
+
+
+ {% if config.truncDescription %}
+ {{ description | truncate(config.lengthDescription) }}
+ {% else %}
+ {{ description }}
{% endif %}
- {% endif %}
-
- {{ title }}
-
- {% if config.truncDescription %}
- {{ description | truncate(config.lengthDescription) }}
- {% else %}
- {{ description }}
- {% endif %}
-
-
-{% endif %}
+ {% endif %}
{% elseif error %}
{{ "MODULE_CONFIG_ERROR" | translate({MODULE_NAME: "Newsfeed", ERROR: error}) | safe }}