all files / js/search/ searchResults.controller.js

25% Statements 2/8
0% Branches 0/2
0% Functions 0/4
25% Lines 2/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                       
/**
 * Created by cklimkowsky on 4/6/15.
 */
angular
    .module('coopEval')
    .controller('SearchResultsController', SearchResultsController);
 
function SearchResultsController($scope, $stateParams, $rootScope, searchService, studentService) {
 
    searchService.getSearchResults($rootScope.searchCriteria)
        .success(function (result) {
            $scope.searchResults = result;
        });
 
    // --------------------------------------------------
    // TODO: Probably refactor the below code into another controller or other controllers
 
    //
    // Admin Functionality
    //
 
    // Get the evaluation data for a student when the user clicks on the student's name from the search results page
    if ($stateParams.studentDCE) {
        studentService.getStudentOverviewWithId($stateParams.studentDCE)
            .success(function (result) {
                $scope.overviewData = result;
            });
    }
 
    /**
     * Opens a modal window that allows the user to update the status of the evaluations for the given placement.
     * @param placement
     */
    $scope.updateStatus = function (placement) {
        // TODO: Open a modal window to change the status of the given placement
    };
}