<commit_before>h2 Create new group
form(method="post", id="group-model-form")
  p
    label Name
    input(type="text", name="group[name]", value=group.name)
    - if (group.errors.name)
      p.error= group.errors.name
  p
    label Description
    input(type="text", name="group[description]", value=group.description)
    - if (group.errors.description)
      p.error= group.errors.description
  p
    label Donors
    select(multiple="multiple", name="group[donors]")
      - for donor in donors
        option(value=donor._id)= donor.name
    - if (group.errors.donors)
      p.error= group.errors.donors
  p.buttons
    - if (group.isNew)
      input(type="submit", value="Save")
    - else
      input(type="submit", value="Update")<commit_msg>Keep donors already in group selected<commit_after>h2 Create new group
form(method="post", id="group-model-form")
  p
    label Name
    input(type="text", name="group[name]", value=group.name)
    - if (group.errors.name)
      p.error= group.errors.name
  p
    label Description
    input(type="text", name="group[description]", value=group.description)
    - if (group.errors.description)
      p.error= group.errors.description
  p
    label Donors
    select(multiple="multiple", name="group[donors]")
      - for donor in donors
        - var has = false
        - for groupDonor in group.donors
          - if (String(groupDonor._id) == String(donor._id))
            - has = true
        - if (has)
          option(value=donor._id, selected="selected")= donor.name
        else
          option(value=donor._id)= donor.name
    - if (group.errors.donors)
      p.error= group.errors.donors
  p.buttons
    - if (group.isNew)
      input(type="submit", value="Save")
    - else
      input(type="submit", value="Update")
{'fraction_non_alphanumeric': 0.14157303370786517, 'fraction_numerical': 0.0011235955056179776, 'mean_word_length': 2.8218884120171674, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5182141', 'n_tokens_mistral': 565, 'n_tokens_neox': 556, 'n_words': 120}