<commit_before>.collapsible
  %h2.title New Classification
  =form_for Classification.new(:asset_id => @content.asset.id), :url => main_app.classifications_path do |f|
    %p
      %label{:for => 'catalog_id'} Catalog:
      =select("classification", "catalog_id", Catalog.all.inject([]){|m,c| m << [c.title, c.id]})
    =hidden_field "classification", :asset_id
    =submit_tag "Create"


.collapsible
  %h2.title Classifications
  %ul.collection
    -catalogs = []
    -<EMAIL>.each do |classification|
      -catalogs << classification.catalog_id
      %li
        =link_to classification.catalog.title, main_app.catalog_path(classification.catalog)
        .content
          =form_for classification do |f|
            -classification.catalog.facets.each do |facet|
              .facet{:class => "#{facet.color}_lite"}
                .caption{:class => facet.color}
                  =facet.caption
                %ul
                  -facet.labels.each do |label|
                    %li.label
                      =check_box_tag "labels[]", label.id, classification.label_ids.include?(label.id)
                      =link_to label.caption
            =submit_tag "Save"
            =submit_tag "Drop", :style => "float: left", :onclick => "return confirm('Are you sure?')"
<commit_msg>use ajax-request to submit the form<commit_after>.collapsible
  %h2.title New Classification
  =form_for Classification.new(:asset_id => @content.asset.id), :url => main_app.classifications_path do |f|
    %p
      %label{:for => 'catalog_id'} Catalog:
      =select("classification", "catalog_id", Catalog.all.inject([]){|m,c| m << [c.title, c.id]})
    =hidden_field "classification", :asset_id
    =submit_tag "Create"


.collapsible
  %h2.title Classifications
  %ul.collection
    -catalogs = []
    -<EMAIL>.each do |classification|
      -catalogs << classification.catalog_id
      %li
        =link_to classification.catalog.title, main_app.catalog_path(classification.catalog)
        .content
          =form_for classification, :remote => true do |f|
            -classification.catalog.facets.each do |facet|
              .facet{:class => "#{facet.color}_lite"}
                .caption{:class => facet.color}
                  =facet.caption
                %ul
                  -facet.labels.each do |label|
                    %li.label
                      =check_box_tag "labels[]", label.id, classification.label_ids.include?(label.id)
                      =link_to label.caption
            =submit_tag "Save"
            =submit_tag "Drop", :style => "float: left", :onclick => "return confirm('Are you sure?')"

{'fraction_non_alphanumeric': 0.1347248576850095, 'fraction_numerical': 0.0015180265654648956, 'mean_word_length': 2.3367088607594937, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 20, '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': '3421814', 'n_tokens_mistral': 814, 'n_tokens_neox': 776, 'n_words': 159}