<commit_before>{{!
    Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
    Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
    Created By: <EMAIL>
    Maintained By: <EMAIL>
}}

{{#is_allowed 'update' instance context='for'}}
  <div {{#instance}}{{data 'model'}}{{/instance}} {{ (el) -> el.ggrc_controllers_quick_form({instance : el.data("model") }) }}>

  {{#if_in instance.status "Open,In Progress"}}
    {{#if_verifiers_defined instance}}
        <button href="javascript://" class="btn btn-small btn-primary pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="Finished">Finish</button>
    {{else}}
        <button href="javascript://" class="btn btn-small btn-primary pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="Final">Finish</button>
    {{/if_verifiers_defined}}
  {{/if_in}}

  {{#if_equals instance.status "Finished"}}
    {{#if_verifier instance}}
      <button href="javascript://" class="btn btn-small btn-success pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="Verified">Verify</button>
      <button href="javascript://" class="btn btn-small btn-danger pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="In Progress">Decline</button>
    {{/if_verifier}}
  {{/if_equals}}

    {{#instance._undo.0}}
        <a href="javascript://" data-name="status" data-value="{{instance._undo.0}}" data-undo="true" class="undo btn-info-pin-header pull-right {{instance._disabled}}">Undo</a>
    {{/instance._undo.0}}
  </div><commit_msg>Conditionally disable finish button on assessments<commit_after>{{!
    Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
    Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
    Created By: <EMAIL>
    Maintained By: <EMAIL>
}}

{{#is_allowed 'update' instance context='for'}}
  <div {{#instance}}{{data 'model'}}{{/instance}} {{ (el) -> el.ggrc_controllers_quick_form({instance : el.data("model") }) }}>

  {{#if_in instance.status "Open,In Progress"}}
    {{#if_helpers '\
      #if_null' instance._mandatory_comment_msg '\
      and #if_null' instance._mandatory_attachment_msg}}
      {{#if_verifiers_defined instance}}
          <button href="javascript://"
                  class="btn btn-small btn-primary pull-right btn-info-pin-header {{instance._disabled}}"
                  data-name="status"
                  data-value="Finished">
            Finish
          </button>
      {{else}}
          <button href="javascript://"
                  class="btn btn-small btn-primary pull-right btn-info-pin-header {{instance._disabled}}"
                  data-name="status"
                  data-value="Final">
            Finish
          </button>
      {{/if_verifiers_defined}}
    {{else}}
      <button href="javascript://"
              class="btn btn-small btn-primary pull-right btn-info-pin-header disabled"
              rel="tooltip"
              title="{{instance._mandatory_comment_msg}}
                     {{^if_null instance._mandatory_comment_msg}} | {{/if}}
                     {{instance._mandatory_attachment_msg}}">
        Finish
      </button>
    {{/if_helpers}}
  {{/if_in}}

  {{#if_equals instance.status "Finished"}}
    {{#if_verifier instance}}
      <button href="javascript://" class="btn btn-small btn-success pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="Verified">Verify</button>
      <button href="javascript://" class="btn btn-small btn-danger pull-right btn-info-pin-header {{instance._disabled}}" data-name="status" data-value="In Progress">Decline</button>
    {{/if_verifier}}
  {{/if_equals}}

    {{#instance._undo.0}}
        <a href="javascript://" data-name="status" data-value="{{instance._undo.0}}" data-undo="true" class="undo btn-info-pin-header pull-right {{instance._disabled}}">Undo</a>
    {{/instance._undo.0}}
  </div>
{'fraction_non_alphanumeric': 0.17667493796526054, 'fraction_numerical': 0.004466501240694789, 'mean_word_length': 3.3578378378378377, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7385053', 'n_tokens_mistral': 1241, 'n_tokens_neox': 1214, 'n_words': 238}