From 6588b3d13ac23495a219ebb2f254d751635aedc8 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sun, 2 Sep 2018 14:20:32 +0200 Subject: [PATCH] Add a notice when the user does not belong to any group. --- assets/css/pages/groups/pages/main.css | 5 +++++ assets/js/pages/groups/pages/main.js | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/assets/css/pages/groups/pages/main.css b/assets/css/pages/groups/pages/main.css index 69160c38..11dff9b0 100644 --- a/assets/css/pages/groups/pages/main.css +++ b/assets/css/pages/groups/pages/main.css @@ -11,6 +11,11 @@ padding-top: 50px; } +.groups-main-page .no-group-notice { + margin-top: 10px; + text-align: center; +} + .groups-main-page .group-item { text-align: justify; margin-top: 10px; diff --git a/assets/js/pages/groups/pages/main.js b/assets/js/pages/groups/pages/main.js index 40f69e75..936e93b2 100644 --- a/assets/js/pages/groups/pages/main.js +++ b/assets/js/pages/groups/pages/main.js @@ -86,14 +86,25 @@ ComunicWeb.pages.groups.pages.main = { */ _display_list: function(target, list){ + var has_group = false; + for (const i in list) { if (list.hasOwnProperty(i)) { const group = list[i]; - + has_group = true; ComunicWeb.pages.groups.pages.main._display_group(group, target); } } + //Check if the user does not belong to any groups + if(!has_group){ + createElem2({ + appendTo: target, + type: "div", + class: "no-group-notice", + innerHTML:"You do not belong to any group yet." + }); + } }, /**