<commit_before>angular.module("reflection").controller('allReflectionsController', ['$scope', 'reflectionsContentService', '$window','$rootScope', function ($scope, reflectionsContentService, $window,$rootScope) {
    $scope.reflections = [];

    $scope.activeLetter = '';
    $scope.scrollIndex = 12;
    $scope.reflectionCount = 0;

    $scope.activeLetter = '';
    $scope.scrollIndex = 12;
    $scope.expandFilter = false;
    $scope.filterItems = {};
    $scope.selectedFilterCategory = {};
    $scope.openSecondParda = false;
    $rootScope.isGridPage = true;

    var i = 0;

    $scope.toggleExpandFilter = function () {
        $scope.expandFilter = !$scope.expandFilter;
        if (!$scope.expandFilter) {
            $scope.closeSecondParda()
        }
    };

    $scope.closeSecondParda = function () {
        if ($scope.openSecondParda) {
            $scope.openSecondParda = false;
        }
        $scope.selectedFilterCategory.active = false;
    };

    $scope.openParda = function () {
        $scope.openSecondParda = true;
    };

    $scope.shiftThumbnail = function (index) {
        return "shift" + (index + 1);
    };

    $scope.navigateToDetailPage = function (id) {
        $window.location.href = 'details/'+id;
    };

    $scope.init = function () {
        reflectionsContentService.getPublishedReflections().then(function (reflections) {
            var reflectionsList = reflections.data.reflections;
            _.each(reflectionsList, function (reflection, index) {
                $scope.reflections.push(new AjabShahar.ThumbnailObject(reflection, "reflection"));
            });
            $scope.reflectionCount = $scope.reflections.length;
        });
    };

    $scope.init();
}]);<commit_msg>sorting of reflections on all reflections page [Chanakya]<commit_after>angular.module("reflection").controller('allReflectionsController', ['$scope', 'reflectionsContentService', '$window','$rootScope','$filter',
    function ($scope, reflectionsContentService, $window,$rootScope,$filter) {
    $scope.reflections = [];

    $scope.activeLetter = '';
    $scope.scrollIndex = 12;
    $scope.reflectionCount = 0;

    $scope.activeLetter = '';
    $scope.scrollIndex = 12;
    $scope.expandFilter = false;
    $scope.filterItems = {};
    $scope.selectedFilterCategory = {};
    $scope.openSecondParda = false;
    $rootScope.isGridPage = true;

    var sortList = function (list, sortCriteria) {
        return $filter('orderBy')(list, sortCriteria);
    };

    $scope.toggleExpandFilter = function () {
        $scope.expandFilter = !$scope.expandFilter;
        if (!$scope.expandFilter) {
            $scope.closeSecondParda()
        }
    };

    $scope.closeSecondParda = function () {
        if ($scope.openSecondParda) {
            $scope.openSecondParda = false;
        }
        $scope.selectedFilterCategory.active = false;
    };

    $scope.openParda = function () {
        $scope.openSecondParda = true;
    };

    $scope.shiftThumbnail = function (index) {
        return "shift" + (index + 1);
    };

    $scope.navigateToDetailPage = function (id) {
        $window.location.href = 'details/'+id;
    };

    $scope.init = function () {
        reflectionsContentService.getPublishedReflections().then(function (reflections) {
            var reflectionsList = reflections.data.reflections;
            _.each(reflectionsList, function (reflection) {
                $scope.reflections.push(new AjabShahar.ThumbnailObject(reflection, "reflection"));
            });
            $scope.reflectionCount = $scope.reflections.length;
            $scope.reflections = sortList($scope.reflections,'englishTitle');
        });
    };

    $scope.init();
}]);
{'fraction_non_alphanumeric': 0.1420500403551251, 'fraction_numerical': 0.003497444175410277, 'mean_word_length': 2.8290422245108138, 'pattern_counts': {'":': 0, '<': 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': '6000637', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1057, 'n_words': 165}