<commit_before>var directive = function() {
  return {
    restrict: 'E',
    scope: {
      community: '=',
      update: '&'
    },
    controller: function($scope, CurrentUser) {
      $scope.currentUser = CurrentUser.get();

      $scope.selectOptions = {
        sort: [
          {label: 'Recent', value: 'recent'},
          {label: 'Top', value: 'top'}
        ],
        filter: [
          {label: 'All Posts', value: 'all+welcome'},
          {label: 'Intentions', value: 'intention'},
          {label: 'Offers', value: 'offer'},
          {label: 'Requests', value: 'request'},
          {label: 'Chats', value: 'chat'}
        ]
      };

      $scope.selected = {
        sort: $scope.selectOptions.sort[0],
        filter: $scope.selectOptions.filter[0]
      };

      $scope.select = function(type, value) {
        $scope.selected[type] = _.find(
          $scope.selectOptions[type],
          function(x) { return x.value === value; }
        );

        $scope.update({data: $scope.selected});
      };

    },
    templateUrl: '/ui/post/toolbar.tpl.html',
    replace: true
  };
};

module.exports = function(angularModule) {
  angularModule.directive('postsToolbar', directive);
};
<commit_msg>add "suggested" as a sort type<commit_after>var directive = function() {
  return {
    restrict: 'E',
    scope: {
      community: '=',
      update: '&'
    },
    controller: function($scope, CurrentUser) {
      $scope.currentUser = CurrentUser.get();

      $scope.selectOptions = {
        sort: [
          {label: 'Recent', value: 'recent'},
          {label: 'Top', value: 'top'},
          {label: 'Suggested', value: 'suggested'}
        ],
        filter: [
          {label: 'All Posts', value: 'all+welcome'},
          {label: 'Intentions', value: 'intention'},
          {label: 'Offers', value: 'offer'},
          {label: 'Requests', value: 'request'},
          {label: 'Chats', value: 'chat'}
        ]
      };

      $scope.selected = {
        sort: $scope.selectOptions.sort[0],
        filter: $scope.selectOptions.filter[0]
      };

      $scope.select = function(type, value) {
        $scope.selected[type] = _.find(
          $scope.selectOptions[type],
          function(x) { return x.value === value; }
        );

        $scope.update({data: $scope.selected});
      };

    },
    templateUrl: '/ui/post/toolbar.tpl.html',
    replace: true
  };
};

module.exports = function(angularModule) {
  angularModule.directive('postsToolbar', directive);
};

{'fraction_non_alphanumeric': 0.17325349301397205, 'fraction_numerical': 0.0015968063872255488, 'mean_word_length': 2.1964285714285716, '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': '351368', 'n_tokens_mistral': 783, 'n_tokens_neox': 765, 'n_words': 151}