<commit_before><%= coffee do %>
$ ->
  $(".event-pages-filter a[data-id!=all]").on 'click', ->
    $(".event-pages-filter a[data-id=all]").removeClass("clicked")

    if $(this).hasClass("clicked")
       $(this).removeClass("clicked")
    else
      $(this).addClass("clicked")

    dataIds = []
    $(".event-pages-filter a.clicked").each ->
      dataId = parseInt($(this).attr("data-id"))
      dataIds.push(dataId) unless isNaN(dataId)

    $("#event-list .page").each ->
      pageDataIds = []
      $.each $(this).attr("data-id").split(" "), ->
        pageDataIds.push(parseInt(this))

      visible = false
      $.each dataIds, ->
        if $.inArray(parseInt(this), pageDataIds) >= 0
          visible = true
          return false

      if visible
        $(this).show()
      else
        $(this).hide()
    return false

  $(".event-pages-filter a[data-id=all]").on 'click', ->
    unless $(this).hasClass("clicked")
      $(this).addClass("clicked")
      $(".event-pages-filter a[data-id!=all]").removeClass("clicked")
      $("#event-list .page").show()
    return false
<% end %>

<%== @cur_node.upper_html %>

<% if @cur_node.st_categories.order_by(order: 1).present? %>
  <nav class="event-pages-filter">
    <ul>
      <li class="all">
        <%= link_to t("event.filter_all"), "#", class: "clicked", "data-id" => "all" %>
      </li>
      <% @cur_node.st_categories.each do |cate| %>
        <li class="<%= cate.basename %>">
          <%= link_to cate.name, "#", "data-id" => cate.id %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>
<commit_msg>event fix order_by<commit_after><%= coffee do %>
$ ->
  $(".event-pages-filter a[data-id!=all]").on 'click', ->
    $(".event-pages-filter a[data-id=all]").removeClass("clicked")

    if $(this).hasClass("clicked")
       $(this).removeClass("clicked")
    else
      $(this).addClass("clicked")

    dataIds = []
    $(".event-pages-filter a.clicked").each ->
      dataId = parseInt($(this).attr("data-id"))
      dataIds.push(dataId) unless isNaN(dataId)

    $("#event-list .page").each ->
      pageDataIds = []
      $.each $(this).attr("data-id").split(" "), ->
        pageDataIds.push(parseInt(this))

      visible = false
      $.each dataIds, ->
        if $.inArray(parseInt(this), pageDataIds) >= 0
          visible = true
          return false

      if visible
        $(this).show()
      else
        $(this).hide()
    return false

  $(".event-pages-filter a[data-id=all]").on 'click', ->
    unless $(this).hasClass("clicked")
      $(this).addClass("clicked")
      $(".event-pages-filter a[data-id!=all]").removeClass("clicked")
      $("#event-list .page").show()
    return false
<% end %>

<%== @cur_node.upper_html %>

<% if @cur_node.st_categories.present? %>
  <nav class="event-pages-filter">
    <ul>
      <li class="all">
        <%= link_to t("event.filter_all"), "#", class: "clicked", "data-id" => "all" %>
      </li>
      <% @cur_node.st_categories.order_by(order: 1).each do |cate| %>
        <li class="<%= cate.basename %>">
          <%= link_to cate.name, "#", "data-id" => cate.id %>
        </li>
      <% end %>
    </ul>
  </nav>
<% end %>

{'fraction_non_alphanumeric': 0.22236220472440946, 'fraction_numerical': 0.0012598425196850393, 'mean_word_length': 2.50939226519337, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 59, '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': '3101502', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1082, 'n_words': 182}