From 996d0207ab7580f1aab88c2c1787810e589c1e40 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Feb 2018 16:04:53 +0100 Subject: [PATCH] Display a message when the user does not have latest post. --- assets/js/pages/latestPosts/main.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/assets/js/pages/latestPosts/main.js b/assets/js/pages/latestPosts/main.js index cbc5ca22..6707e644 100644 --- a/assets/js/pages/latestPosts/main.js +++ b/assets/js/pages/latestPosts/main.js @@ -73,10 +73,16 @@ ComunicWeb.pages.latestPosts.main = { //Process the list of posts for (let index = 0; index < list.length; index++) { - //Display the post ComunicWeb.components.posts.ui.display_post(list[index], boxBody); + } + //Check if there aren't any post to display + if(list.length == 0){ + + var message = ComunicWeb.common.messages.createCalloutElem("No post to display", "Posts from you and your friend will appear here...", "info"); + message.className += " noLatestPosts"; + boxBody.appendChild(message); } } } \ No newline at end of file