// Generated by CoffeeScript 1.12.7
/**
* Show the PIs
* @module
*/
'use strict';
app.directive('showInvestigators', [
'constantService', function(constants) {
return {
restrict: 'E',
scope: true,
transclude: true,
templateUrl: 'volume/showInvestigators.html',
link: function($scope, $element, $attrs) {
var maxPerm, minPerm, ref, ref1;
$scope.title = $attrs.investigatorsTitle;
maxPerm = (ref = constants.permission[$attrs.maxlevel]) != null ? ref : constants.permission.length;
minPerm = (ref1 = constants.permission[$attrs.minlevel]) != null ? ref1 : 0;
return $scope.investigators = $scope.volume.access.filter(function(i) {
var ref2;
return (minPerm <= (ref2 = i.individual) && ref2 < maxPerm) && (i.children || i.individual >= constants.permission.READ) && i.party.id !== constants.party.STAFF;
});
}
};
}
]);
//# sourceMappingURL=showInvestigators.js.map