<commit_before><form class="form-horizontal"
      role="form">

  <div class="panel panel-default">
    <div class="panel-body">
      Who should approve this invoice?
    </div>
  </div>

  <div class="control-group">
    <label class="control-label">Creditor</label>
    <div class="controls">
      <input cam-variable-name="creditor"
             type="text"
             name="creditor"
             ng-model="creditor"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Amount</label>
    <div class="controls">
      <input cam-variable-name="amount"
             type="text"
             name="amount"
             ng-model="amount"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Invoice Number</label>
    <div class="controls">
      <input cam-variable-name="invoiceNumber"
             type="text"
             name="invoiceNumber"
             ng-model="invoiceNumber"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Approver: </label>
    <div class="controls">
      <input cam-variable-name="approver"
             cam-variable-type="String"
             type="text"
             name="approver"
             ng-model="approver"
             class="form-control"
             required />

      (i.e. &quot;john&quot;, &quot;mary&quot; or &quot;peter&quot;)
    </div>
  </div>


  <script cam-script type="text/form-script">
    var $ = angular.element;
    var each = angular.forEach;
    var variableManager = camForm.variableManager;
    debugger;

    camForm.on('variables-fetched', function() {
      // access to all process variables after the form has loaded
      console.log(variableManager.variables);
    });

    camForm.on('submit', function(evt) {
      var invalid = false;

      each(variableManager.variables, function(variable, name) {
        var $input = $('[cam-variable-name="'+ name +'"]');
        var $parent = $input.parents('.control-group');
        var required = $input.attr('required') && !$input.attr('readonly');
        var fieldValue = $input.val();
        var fieldValid = !!(required && !$input.val());

        $parent[fieldValid ? 'addClass' : 'removeClass']('has-error');

        invalid = invalid || !fieldValid;
      });

      // handle submit
      // may prevent the submit from being executed:<commit_msg>fix(example): remove debugger statement<commit_after><form class="form-horizontal"
      role="form">

  <div class="panel panel-default">
    <div class="panel-body">
      Who should approve this invoice?
    </div>
  </div>

  <div class="control-group">
    <label class="control-label">Creditor</label>
    <div class="controls">
      <input cam-variable-name="creditor"
             type="text"
             name="creditor"
             ng-model="creditor"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Amount</label>
    <div class="controls">
      <input cam-variable-name="amount"
             type="text"
             name="amount"
             ng-model="amount"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Invoice Number</label>
    <div class="controls">
      <input cam-variable-name="invoiceNumber"
             type="text"
             name="invoiceNumber"
             ng-model="invoiceNumber"
             readonly="true"
             class="form-control" />
    </div>
  </div>
  <div class="control-group">
    <label class="control-label">Approver: </label>
    <div class="controls">
      <input cam-variable-name="approver"
             cam-variable-type="String"
             type="text"
             name="approver"
             ng-model="approver"
             class="form-control"
             required />

      (i.e. &quot;john&quot;, &quot;mary&quot; or &quot;peter&quot;)
    </div>
  </div>


  <script cam-script type="text/form-script">
    var $ = angular.element;
    var each = angular.forEach;
    var variableManager = camForm.variableManager;

    camForm.on('variables-fetched', function() {
      // access to all process variables after the form has loaded
      console.log(variableManager.variables);
    });

    camForm.on('submit', function(evt) {
      var invalid = false;

      each(variableManager.variables, function(variable, name) {
        var $input = $('[cam-variable-name="'+ name +'"]');
        var $parent = $input.parents('.control-group');
        var required = $input.attr('required') && !$input.attr('readonly');
        var fieldValue = $input.val();
        var fieldValid = !!(required && !$input.val());

        $parent[fieldValid ? 'addClass' : 'removeClass']('has-error');

        invalid = invalid || !fieldValid;
      });

      // handle submit
      // may prevent the submit from being executed:
{'fraction_non_alphanumeric': 0.156855151045701, 'fraction_numerical': 0.0, 'mean_word_length': 2.2961072112316527, 'pattern_counts': {'":': 0, '<': 71, '<?xml version=': 0, '>': 71, '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': '6989925', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1472, 'n_words': 299}