diff --git a/src/client/app/js/app/state/Home.js b/src/client/app/js/app/state/Home.js index b2cf2a3..f0ff159 100644 --- a/src/client/app/js/app/state/Home.js +++ b/src/client/app/js/app/state/Home.js @@ -1036,21 +1036,53 @@ app.state.Home = function() } ); - // TODO: Nur, wenn nicht aktiviert - app.core.View.showModal({ - title: _lc('HOME_MODAL_NOT_ACTIVATED_TITLE'), - body: app.core.View.getTemplate('home-modal-not-activated'), - hideButtons: true, - hideCloseBtn: true, - cancelButtonText: _lc('HOME_MODAL_NOT_ACTIVATED_BUTTON') - }); - - $("body").on( 'click', '[data-id="not-activated"]', function(e) - { - e.preventDefault(); - app.core.View.closeModal(); - window.location.href = $(this).attr("href"); - }); + let profile = app.model.SessionUser.getUserProfile(); + let groupId = null; + let groupName = null; + let status = null; + let showPopup = false; + let deleteStorageValues = true; + let storageGroupIds = JSON.parse(sessionStorage.getItem("g_ids_popup_shown")); + if (storageGroupIds === null) { + storageGroupIds = []; + } + + for (let i = 0; i < userGroups.length; i++) { + groupId = userGroups[i].getId(); + status = profile.getGroupData(groupId).status; + + if (status === 'not_approved') { + deleteStorageValues = false; + if (!storageGroupIds.includes(groupId)) { + groupName = userGroups[i].getName(); + showPopup = true; + storageGroupIds.push(groupId); + window.sessionStorage.setItem("g_ids_popup_shown", JSON.stringify(storageGroupIds)); + break; + } + } + } + if (deleteStorageValues) { + sessionStorage.removeItem("g_ids_popup_shown"); + } + + if (showPopup) { + app.core.View.showModal({ + title: _lc('HOME_MODAL_NOT_ACTIVATED_TITLE'), + body: app.core.View.getTemplate('home-modal-not-activated', { groupName: groupName }), + hideButtons: true, + hideCloseBtn: true, + cancelButtonText: _lc('HOME_MODAL_NOT_ACTIVATED_BUTTON') + }); + + $("body").on( 'click', '[data-id="not-activated"]', function(e) + { + e.preventDefault(); + app.core.View.closeModal(); + window.location.href = $(this).attr("href"); + }); + } + } ); }; diff --git a/src/client/app/tmpl/home-modal-not-activated.html b/src/client/app/tmpl/home-modal-not-activated.html index 23c4f68..827eb12 100644 --- a/src/client/app/tmpl/home-modal-not-activated.html +++ b/src/client/app/tmpl/home-modal-not-activated.html @@ -1,4 +1,4 @@ -<%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> .

+<%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <%= groupName %>.

<%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT2' ) %>