Ver a proveniência

popup state in session storage for not approved

master
Daniel há 2 anos
ascendente
cometimento
208c913b0f
3 ficheiros alterados com 49 adições e 17 eliminações
  1. +47
    -15
      src/client/app/js/app/state/Home.js
  2. +1
    -1
      src/client/app/tmpl/home-modal-not-activated.html
  3. +1
    -1
      src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php

+ 47
- 15
src/client/app/js/app/state/Home.js Ver ficheiro

@@ -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");
});
}
}
);
};


+ 1
- 1
src/client/app/tmpl/home-modal-not-activated.html Ver ficheiro

@@ -1,4 +1,4 @@
<strong><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <!-- HIER DEN NAMEN DER GRUPPE EINFÜGEN -->.</strong><br /><br />
<strong><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT1' ) %> <%= groupName %>.</strong><br /><br />
<%= _lc( 'HOME_MODAL_NOT_ACTIVATED_TEXT2' ) %>
<div class="button-like-modal-footer">
<a href="#/configuration/profile" class="btn btn-sm btn-secondary" data-id="not-activated"><%= _lc( 'HOME_MODAL_NOT_ACTIVATED_BUTTON' ) %></a>


+ 1
- 1
src/server/shared/ent/teamdata/TB_Shared_Ent_TeamData_Profile.php Ver ficheiro

@@ -484,7 +484,7 @@ class TB_Shared_Ent_TeamData_Profile extends Francis_Db_Row {
'role' => TB_Shared_Ent_TeamData_Profile::ROLE_PLAYER,
'is_anonymous' => 0,
'join_dt' => TB_Server_Utils_Helper::getUTCNowDateTime(),
'status' => self::STATUS_NOT_APPROVED
'status' => self::STATUS_NOT_APPROVED,
);
$this->teams_js = $teamsJson;


Carregando…
Cancelar
Guardar