(function (document, window, $) { function deleteUser(page, id, name) { var msg = Globalize.translate('DeleteUserConfirmation').replace('{0}', name); Dashboard.confirm(msg, Globalize.translate('DeleteUser'), function (result) { if (result) { Dashboard.showLoadingMsg(); ApiClient.deleteUser(id).done(function () { loadUsers(page); }); } }); } function getUserHtml(user) { var html = ''; html += "
"; html += '
'; html += '"; html += '
'; html += '
'; html += ''; html += "
"; html += '
'; html += user.Name; html += "
"; // cardFooter html += "
"; // cardBox html += "
"; // card html += "
"; //html += "
  • "; //html += ""; //if (user.PrimaryImageTag) { // var url = ApiClient.getUserImageUrl(user.Id, { // width: 80, // tag: user.PrimaryImageTag, // type: "Primary" // }); // html += ""; //} else { // html += ""; //} //html += "

    " + user.Name; //html += "

    "; //html += "

    "; //if (user.HasConfiguredPassword) html += '' + Globalize.translate('Password') + ''; //if (user.Configuration.IsAdministrator) html += '' + Globalize.translate('Administrator') + ''; //html += "

    "; //html += "
    "; //html += "" + Globalize.translate('Delete') + ""; //html += "
  • "; return html; } function loadUsers(page) { Dashboard.showLoadingMsg(); ApiClient.getUsers().done(function (users) { var html = users.map(getUserHtml).join(''); $('.users', page).html(html).trigger('create'); Dashboard.hideLoadingMsg(); }); } $(document).on('pagebeforeshow', "#userProfilesPage", function () { var page = this; loadUsers(page); }); })(document, window, jQuery);