<commit_before>/**
 * advt-results-pane-builder
 *
 * Functions to manipulate the results pane located on the right hand side of the app.
 *
 * @author <NAME>
 * @since 02 Dec. 2013
 */
define([
    'jquery',
    'components/advt-util'
], function($, util) {

    // The element that contains detailed results for a region.
    // @private
    var $resultsPane = $("#results div");

    return {

        /**
         * update
         *
         * Updates the results pane with the results for the given zip code region.
         *
         * @param results - An array of school objects to display in the results pane.
         * @return void
         *
         * @author <NAME>
         * @since 02 Dec. 2013
         */
        update: function(results, totalStudents) {

            $resultsPane.empty();

            if(results.length <= 0) {
                var $p = $("<p>We do not have zip code data for the State you are searching for. " +
                    "We are placing down all highschool markers at once. This may take a while. </p>");

                $resultsPane.append($p);
            }

            $.each(results, function(idx, val) {
                var $div = $("<div class='advt-result-item'></div>");
                var schoolName = util.toTitleCase(val.name);

                $("<h4>" + schoolName + "</h4>").appendTo($div);
                $("<p><strong>No. Students:</strong> " + val.students + "</p>").appendTo($div);
                $("<hr />").appendTo($div);

                $resultsPane.append($div);
            });
        }<commit_msg>Adds the number of total students to the right hand results pane.<commit_after>/**
 * advt-results-pane-builder
 *
 * Functions to manipulate the results pane located on the right hand side of the app.
 *
 * @author <NAME>
 * @since 02 Dec. 2013
 */
define([
    'jquery',
    'components/advt-util'
], function($, util) {

    // The element that contains detailed results for a region.
    // @private
    var $resultsPane = $("#results div");

    var _resultObjectBuilder = function(name, numStudents) {
        var $div = $("<div class='advt-result-item'></div>");
        $("<h4>" + name + "</h4>").appendTo($div);
        $("<p><strong>No. Students:</strong> " + numStudents + "</p>").appendTo($div);
        $("<hr />").appendTo($div);

        return $div;
    };

    return {

        /**
         * update
         *
         * Updates the results pane with the results for the given zip code region.
         *
         * @param results - An array of school objects to display in the results pane.
         * @return void
         *
         * @author <NAME>
         * @since 02 Dec. 2013
         */
        update: function(results, totalStudents) {

            $resultsPane.empty();

            if(results.length <= 0) {
                var $p = $("<p>We do not have zip code data for the State you are searching for. " +
                    "We are placing down all highschool markers at once. This may take a while. </p>");

                $resultsPane.append($p);
            }

            var $totalStudents =  $("<div class='advt-result-total'></div>");
            $("<h3><strong>Total Students:</strong> " + totalStudents + "</h3>").appendTo($totalStudents);
            $("<hr />").appendTo($totalStudents);

            $resultsPane.append($totalStudents);

            $.each(results, function(idx, val) {

                var $resultObject = _resultObjectBuilder(util.toTitleCase(val.name), val.students);
                $resultsPane.append($resultObject);
            });
        }
{'fraction_non_alphanumeric': 0.14472585583078207, 'fraction_numerical': 0.008906206512663512, 'mean_word_length': 1.8821170809943866, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 36, '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': '3011756', 'n_tokens_mistral': 1054, 'n_tokens_neox': 969, 'n_words': 301}