(function()
{
    var moduleName = 'claromentis.project';
    var template = require('../../html/directives/history_user.directive.html');

    angular.module(moduleName)
        .directive('historyUser', historyUser);

    function historyUser()
    {
        return {
            restrict: 'E',
            templateUrl: template,
            scope: {
                user: '<'
            },
            controllerAs: 'ctrl',
            bindToController: true,
            controller: controller
        };

        function controller()
        {
            var ctrl = this;

            ctrl.isUser = function()
            {
                return ((typeof ctrl.user === 'object') && (ctrl.user !== null) && (ctrl.user.id !== undefined) && (ctrl.user.id !== null));
            };
        }
    }
}());
