<commit_before>var Backbone = require('backbone'),
    $ = require('jquery'),
    _ = require('underscore');

function navigate(options) {
  var route  = 'query',
      params = [],
      router = require('routers/router').instance;

  if(options.categories.length > 0) {
     params.push("categories=" + options.categories.join(","));
  }

  if(options.demographics.length > 0) {
    params.push("demographics=" + options.demographics.join(","));
  }

  if(options.gender) {
    params.push("gender=" + options.gender);
  }

  if(params.length > 0) {
    route = route + "?" + params.join("&");
  }

  router.navigate(route, { trigger: true });
}

var FilterView = Backbone.View.extend({
  template: require('templates/filter'),<commit_msg>[Fixes #84] Filter: sort not working<commit_after>var Backbone = require('backbone'),
    $ = require('jquery'),
    _ = require('underscore');

function navigate(options) {
  var route  = 'query',
      params = [],
      router = require('routers/router').instance;

  if (options.categories.length > 0) {
     params.push("categories=" + options.categories.join(","));
  }

  if (options.demographics.length > 0) {
    params.push("demographics=" + options.demographics.join(","));
  }

  if (options.gender) {
    params.push("gender=" + options.gender);
  }

  if (params.sort) {
    params.push("sort=" + options.sort);
  }

  if (params.length > 0) {
    route = route + "?" + params.join("&");
  }

  router.navigate(route, { trigger: true });
}

var FilterView = Backbone.View.extend({
  template: require('templates/filter'),
{'fraction_non_alphanumeric': 0.18781725888324874, 'fraction_numerical': 0.005076142131979695, 'mean_word_length': 3.624633431085044, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3597822', 'n_tokens_mistral': 520, 'n_tokens_neox': 496, 'n_words': 86}