<commit_before>'use strict';

function createUrl(path) {
    return 'http://localhost:3000/dfl201547282206' + path;
}

function DashboardCtrl($scope, $http) {
    var url = createUrl('/jobs');
    $http.get(url).success(function(jobs) {
        $scope.jobs = jobs;
    });

    
}
DashboardCtrl.$inject = ['$scope','$http'];

function CreateJobCtrl($scope, $http) {
    $scope.title = 'Create new job';
    
    console.log("CreateJobCtrl");
    $scope.job = {
        "client":"",
        "address":"",
        "budget":0
    };
              
    $scope.save = function() {
        var url = createUrl('/jobs/-1');
        $http.post(url, $scope.job)
        .success(function(data, status) {
            console.log('job saved d:' + data + ' id '+ data.id + ' s:' + status);

            $scope.location.path('edit-job/' + data.id);
        })
        .error(function(data, status) {
            $scope.data = data || "Request failed";
            $scope.status = status;        
        });
    };    
}

CreateJobCtrl.$inject = ['$scope','$http'];

function PrintJobCtrl($scope, JobService, $http, $routeParams) {
    $scope.jobId = $routeParams.jobId;

    var url = createUrl('/jobs/' + $scope.jobId);
    $http.get(url).success(function(job) {
        $scope.job = job;
        $scope.userProfile = job.quotes[0];
    });
}


function ViewContractCtrl($scope, ContractService, $routeParams,QuoteService) {
    var $log = $scope.$log;

    $scope.title = 'View contract';
    $scope.quoteId = $routeParams.quoteId;
    $scope.$log.info("ViewContractCtrl " + $scope.quoteId);
    $scope.editing = {};
    $scope.predicate = '-rowNumber';

    ContractService.find($scope.quoteId).then(function(result) {
        $scope.$log.info("found " + result.data.id);
        var quote = result.data;
        $scope.contract = userProfile.contract;
        $scope.userProfile = userProfile;
        $scope.editing = userProfile;
        $scope.printQuote = function() {
            $log.info("ViewContractCtrl printQuote : " + $scope.userProfile.id);
            QuoteService.openPrint($scope.userProfile);
        }
        
        $scope.updateQuoteActions($scope);

    });
}

ViewContractCtrl.$inject = ['$scope', 'ContractService', '$routeParams','QuoteService'];


function SettingsCtrl($scope, $http, QuoteService) {
    var $log = $scope.$log;
    console.log("SettingsCtrl");
    <commit_msg>initial quote integration<commit_after>'use strict';

function createUrl(path) {
    return 'http://localhost:3000/dfl201500062208' + path;
}

function DashboardCtrl($scope, $http) {
    var url = createUrl('/jobs');
    $http.get(url).success(function(jobs) {
        $scope.jobs = jobs;
    });

    
}
DashboardCtrl.$inject = ['$scope','$http'];

function CreateJobCtrl($scope, $http) {
    $scope.title = 'Create new job';
    
    console.log("CreateJobCtrl");
    $scope.job = {
        "client":"",
        "address":"",
        "budget":0
    };
              
    $scope.save = function() {
        var url = createUrl('/jobs/-1');
        $http.post(url, $scope.job)
        .success(function(data, status) {
            console.log('job saved d:' + data + ' id '+ data.id + ' s:' + status);

            $scope.location.path('edit-job/' + data.id);
        })
        .error(function(data, status) {
            $scope.data = data || "Request failed";
            $scope.status = status;        
        });
    };    
}

CreateJobCtrl.$inject = ['$scope','$http'];

function PrintJobCtrl($scope, JobService, $http, $routeParams) {
    $scope.jobId = $routeParams.jobId;

    var url = createUrl('/jobs/' + $scope.jobId);
    $http.get(url).success(function(job) {
        $scope.job = job;
        $scope.quotes = job.quotes[0];
    });
}


function ViewContractCtrl($scope, ContractService, $routeParams,QuoteService) {
    var $log = $scope.$log;

    $scope.title = 'View contract';
    $scope.quoteId = $routeParams.quoteId;
    $scope.$log.info("ViewContractCtrl " + $scope.quoteId);
    $scope.editing = {};
    $scope.predicate = '-rowNumber';

    ContractService.find($scope.quoteId).then(function(result) {
        $scope.$log.info("found " + result.data.id);
        var quote = result.data;
        $scope.contract = quotes.contract;
        $scope.quotes = quotes;
        $scope.editing = quotes;
        $scope.printQuote = function() {
            $log.info("ViewContractCtrl printQuote : " + $scope.quotes.id);
            QuoteService.openPrint($scope.quotes);
        }
        
        $scope.updateQuoteActions($scope);

    });
}

ViewContractCtrl.$inject = ['$scope', 'ContractService', '$routeParams','QuoteService'];


function SettingsCtrl($scope, $http, QuoteService) {
    var $log = $scope.$log;
    console.log("SettingsCtrl");
    
{'fraction_non_alphanumeric': 0.17187172500523998, 'fraction_numerical': 0.007964787256340389, 'mean_word_length': 2.6069538926681783, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5247187', 'n_tokens_mistral': 1540, 'n_tokens_neox': 1474, 'n_words': 248}