(function() { /** * Page for displaying the logs of a member in an organization. */ angular.module('quayPages').config(['pages', function(pages) { pages.create('org-member-logs', 'org-member-logs.html', OrgMemberLogsCtrl); }]); function OrgMemberLogsCtrl($scope, $routeParams, $rootScope, $timeout, Restangular, ApiService) { var orgname = $routeParams.orgname; var membername = $routeParams.membername; $scope.orgname = orgname; $scope.memberInfo = null; $scope.ready = false; var loadOrganization = function() { $scope.orgResource = ApiService.getOrganizationAsResource({'orgname': orgname}).get(function(org) { $scope.organization = org; return org; }); }; var loadMemberInfo = function() { var params = { 'orgname': orgname, 'membername': membername }; $scope.memberResource = ApiService.getOrganizationMemberAsResource(params).get(function(resp) { $scope.memberInfo = resp.member; $rootScope.title = 'Logs for ' + $scope.memberInfo.name + ' (' + $scope.orgname + ')'; $rootScope.description = 'Shows all the actions of ' + $scope.memberInfo.username + ' under organization ' + $scope.orgname; $timeout(function() { $scope.ready = true; }); return resp.member; }); }; // Load the org info and the member info. loadOrganization(); loadMemberInfo(); } })();