<commit_before>### define
  underscore : _
app : app
backbone.marionette : marionette
./workload_list_item_view : WorkloadListItemView
###

class WorkloadListView extends Backbone.Marionette.CompositeView

  template : _.template("""
    <h3>Workload</h3>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Name</th>
            <th>Projects</th>
            <th>Number of all assignable tasks</th>
          </tr>
        </thead>
        <tbody></tbody>
      </table>
  """)
  className : "workload-table container wide"
  childView : WorkloadListItemView
  childViewContainer : "tbody"

  initialize : ->

    @collection.setSort("availableTaskCount", "asc")

    @collection.fetch(
      silent : true
    ).done( =>
      @collection.goTo(1)
    )

    @listenTo(app.vent, "paginationView:filter", @filterByQuery)


  filterByQuery : (filterQuery) ->

    @collection.setFilter(["name", "projects"], filterQuery)
    @collection.pager()

<commit_msg>call setSort after collection is fetched<commit_after>### define
  underscore : _
app : app
backbone.marionette : marionette
./workload_list_item_view : WorkloadListItemView
###

class WorkloadListView extends Backbone.Marionette.CompositeView

  template : _.template("""
    <h3>Workload</h3>
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Name</th>
            <th>Projects</th>
            <th>Number of all assignable tasks</th>
          </tr>
        </thead>
        <tbody></tbody>
      </table>
  """)
  className : "workload-table container wide"
  childView : WorkloadListItemView
  childViewContainer : "tbody"

  initialize : ->

    @collection.fetch(
      silent : true
    ).done( =>
      @collection.setSort("availableTaskCount", "asc")
      @collection.goTo(1)
    )

    @listenTo(app.vent, "paginationView:filter", @filterByQuery)


  filterByQuery : (filterQuery) ->

    @collection.setFilter(["name", "projects"], filterQuery)
    @collection.pager()


{'fraction_non_alphanumeric': 0.1359126984126984, 'fraction_numerical': 0.002976190476190476, 'mean_word_length': 2.7984934086629, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 41, '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': '4627960', 'n_tokens_mistral': 647, 'n_tokens_neox': 626, 'n_words': 119}