<commit_before>@open_record = (options, record) ->
  menu_slide ->
    ($ ".arena").append form().addClass "defaultform"
    ($ ".defaultform").append create_form record, SCHEMAS[options.schema]

create_record = (options) ->
  record = generate_xml_from_schema options.schema
  options.parent.prepend record
  record

add_button = (options) ->
  (button().text "Neu").click (x) ->
    x.preventDefault()
    open_record options, create_record options

edit_button = (options, record) ->
  (button().text "bearbeiten").click (x) ->
    x.preventDefault()
    open_record options, record

remove_button = (record) ->
  (button().text "entfernen").click (x) ->
    x.preventDefault()
    e = ($ x.target).closest ".record"
    e.addClass "selected"
    if confirm "Diesen Eintrag wirklich entfernen?"
      record.remove()
      e.remove()
    e.removeClass "selected"

record = (options, x) ->
  x = $ x
  (tr().addClass "record").append (create_form x, SCHEMAS[options.schema]),
                                  (edit_button options, x)
                                  (remove_button x)

list = (options) ->
  $.map options.parent.children(), (x) -> record options, x

list_headers = (options) ->
  (th().text desc) for {desc} in SCHEMAS[options.schema]

make_table = (options) ->
  table().append (thead tr list_headers options),
                 (tbody list options)<commit_msg>Have checkboxes with lists of records.<commit_after>@open_record = (options, record) ->
  menu_slide ->
    ($ ".arena").append form().addClass "defaultform"
    ($ ".defaultform").append create_form record, SCHEMAS[options.schema]

create_record = (options) ->
  record = generate_xml_from_schema options.schema
  options.parent.prepend record
  record

add_button = (options) ->
  (button().text "Neu").click (x) ->
    x.preventDefault()
    open_record options, create_record options

edit_button = (options, record) ->
  (button().text "bearbeiten").click (x) ->
    x.preventDefault()
    open_record options, record

remove_button = (record) ->
  (button().text "entfernen").click (x) ->
    x.preventDefault()
    e = ($ x.target).closest ".record"
    e.addClass "selected"
    if confirm "Diesen Eintrag wirklich entfernen?"
      record.remove()
      e.remove()
    e.removeClass "selected"

record = (options, x) ->
  x = $ x
  cb = ($ "<input>")
  cb.attr type: "checkbox", name: x.children().first().text()
  (tr().addClass "record").append cb,
                                  (create_form x, SCHEMAS[options.schema]),
                                  (edit_button options, x),
                                  (remove_button x)

list = (options) ->
  $.map options.parent.children(), (x) -> record options, x

list_headers = (options) ->
  (th().text desc) for {desc} in SCHEMAS[options.schema]

make_table = (options) ->
  head = thead().append ($ "<tr>").append ($ "<th>"),
                                          list_headers options
  table().append head,
                 (tbody list options)
{'fraction_non_alphanumeric': 0.1506164611796068, 'fraction_numerical': 0.0, 'mean_word_length': 2.69249692496925, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 34, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4467390', 'n_tokens_mistral': 906, 'n_tokens_neox': 911, 'n_words': 217}