<commit_before><html>
  <head>
    <meta name="layout" content="internal" />
  </head>
  <body>

    <ul class="breadcrumb">
      <li><g:link controller="dashboard"><g:message encodeAs='HTML' code="branding.application.name"/></g:link> <span class="divider">/</span></li>
      <li><g:link action="show" controller="organization" id="${groupInstance.organization.id}"><g:fieldValue bean="${groupInstance.organization}" field="displayName"/></g:link> <span class="divider">/</span></li> 
      <li><g:link action="show" controller="group" id="${groupInstance.id}"><g:fieldValue bean="${groupInstance}" field="name"/></g:link> <span class="divider">/</span></li> 
      <li class="active"><g:message encodeAs='HTML' code="branding.nav.breadcrumb.managedsubject.createcsv"/></li>
    </ul>

    <g:render template="/templates/flash" plugin="aafApplicationBase"/>
    <g:render template="/templates/errors_bean" model="['bean':managedSubjectInstance]" plugin="aafApplicationBase"/>

    <g:if test="${errors && !status}">
      <h3 class="muted"><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.csv.heading"/></h3>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.csv.detail"/></p>

      <div class='alert alert-error'>
        <ul>
          <g:each in="${errors}" var="error">
            <li>${error}</li>
          </g:each>
        </ul>
      </div>
    </g:if>

    <g:if test="${managedSubjectInstances && !status}">
      <h3 class="muted"><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.heading"/></h3>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.detail"/></p>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.nocreation"/></p>

      <div class='alert alert-error'>
        <ol>
          <g:each in="${managedSubjectInstances}" var="managedSubjectInstance">
            <g:eachError bean="${managedSubjectInstance}" var="error">
              <li><g:message encodeAs='HTML' error="${error}"/></li>
            </g:eachError>
          </g:each>
        </ol>
      </div>
    </g:if>

    <h2><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.heading" args="${[groupInstance.name]}"/></h2>
    <g:render template="reminder"/>
    <p>
      <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.description"/>
    </p>
    <p>
      <strong><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format"/></strong>
    </p>
    <ul>
      <li>[cn] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.cn"/></li>
      <li>[email] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.email"/></li>
      <li>[eduPersonAffiliation] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.aff"/></li>
      <li>[expiry-in-months] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.expiry"/></li>
    </ul>

    <br>

    <h4 class="muted">Example CSV file contents</h4>
    <pre><NAME>,<EMAIL>,staff,0
<NAME>,<EMAIL>,student,24
Петров,<EMAIL>,affiliate,6</pre>

    <br><br><br>

    <g:uploadForm action="savecsv" class="form form-horizontal">
      <fieldset>
        <g:hiddenField name="group.id" value="${groupInstance.id}"/>

        <div class="control-group">
          <label class="control-label" for="csvdata"><g:message encodeAs='HTML' code="label.file"/></label>
          <div class="controls">
            <input type="file" name="csvdata" class="input-large"/>
          </div>
        </div>
        <div class="form-actions">
          <input type="submit" class="btn btn-success"/>
        </div>
      </fieldset>
    </g:uploadForm>
    
  </body>
</html>

<commit_msg>csv: Figuring out which valid CSV line fails account create is hard<commit_after><html>
  <head>
    <meta name="layout" content="internal" />
  </head>
  <body>

    <ul class="breadcrumb">
      <li><g:link controller="dashboard"><g:message encodeAs='HTML' code="branding.application.name"/></g:link> <span class="divider">/</span></li>
      <li><g:link action="show" controller="organization" id="${groupInstance.organization.id}"><g:fieldValue bean="${groupInstance.organization}" field="displayName"/></g:link> <span class="divider">/</span></li> 
      <li><g:link action="show" controller="group" id="${groupInstance.id}"><g:fieldValue bean="${groupInstance}" field="name"/></g:link> <span class="divider">/</span></li> 
      <li class="active"><g:message encodeAs='HTML' code="branding.nav.breadcrumb.managedsubject.createcsv"/></li>
    </ul>

    <g:render template="/templates/flash" plugin="aafApplicationBase"/>
    <g:render template="/templates/errors_bean" model="['bean':managedSubjectInstance]" plugin="aafApplicationBase"/>

    <g:if test="${errors && !status}">
      <h3 class="muted"><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.csv.heading"/></h3>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.csv.detail"/></p>

      <div class='alert alert-error'>
        <ul>
          <g:each in="${errors}" var="error">
            <li>${error}</li>
          </g:each>
        </ul>
      </div>
    </g:if>

    <g:if test="${managedSubjectInstances && !status}">
      <h3 class="muted"><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.heading"/></h3>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.detail"/></p>
      <p><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.errors.account.nocreation"/></p>

      <div class='alert alert-error'>
        <ul class="clean">
          <g:each in="${managedSubjectInstances.findAll{it.hasErrors()}}" var="managedSubjectInstance">
            <li>
              <strong>Errors for entry: <g:fieldValue bean="${managedSubjectInstance}" field="cn" /> (<g:fieldValue bean="${managedSubjectInstance}" field="email" />)</strong>
              <ol>
                <li>It is possible that an account already exists with these details. Please ensure you aren't trying to create a duplicate account;</li>
                <g:eachError bean="${managedSubjectInstance}" var="error">
                  <li><g:message encodeAs='HTML' error="${error}"/>;</li>
                </g:eachError>
              </ol>
            </li>
          </g:each>
        </ul>
      </div>
    </g:if>

    <h2><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.heading" args="${[groupInstance.name]}"/></h2>
    <g:render template="reminder"/>
    <p>
      <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.description"/>
    </p>
    <p>
      <strong><g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format"/></strong>
    </p>
    <ul>
      <li>[cn] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.cn"/></li>
      <li>[email] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.email"/></li>
      <li>[eduPersonAffiliation] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.aff"/></li>
      <li>[expiry-in-months] - <g:message encodeAs='HTML' code="views.aaf.vhr.managedsubject.createcsv.format.expiry"/></li>
    </ul>

    <br>

    <h4 class="muted">Example CSV file contents</h4>
    <pre><NAME>,<EMAIL>,staff,0
<NAME>,<EMAIL>,student,24
Петров,<EMAIL>,affiliate,6</pre>

    <br><br><br>

    <g:uploadForm action="savecsv" class="form form-horizontal">
      <fieldset>
        <g:hiddenField name="group.id" value="${groupInstance.id}"/>

        <div class="control-group">
          <label class="control-label" for="csvdata"><g:message encodeAs='HTML' code="label.file"/></label>
          <div class="controls">
            <input type="file" name="csvdata" class="input-large"/>
          </div>
        </div>
        <div class="form-actions">
          <input type="submit" class="btn btn-success"/>
        </div>
      </fieldset>
    </g:uploadForm>
    
  </body>
</html>


{'fraction_non_alphanumeric': 0.20179372197309417, 'fraction_numerical': 0.0029087383347473033, 'mean_word_length': 3.5946547884187083, 'pattern_counts': {'":': 0, '<': 269, '<?xml version=': 0, '>': 269, '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': '5560661', 'n_tokens_mistral': 2737, 'n_tokens_neox': 2684, 'n_words': 395}