<div class="modal-header">
  <div class="modal-title" data-translate>Request support</div>
  <button type="button" class="close" data-ng-click="cancel()">
    <i class="fa-solid fa-times"></i>
  </button>
</div>
<div class="modal-body" data-ng-init="sent=false; arg.mail_address=resources.preferences.mail_address">
  <form data-ng-hide="sent" name="SupportRequest" novalidate>
    <div class="form-group">
      <label data-translate>Email address</label>
      <input class="form-control" name="email" data-ng-model="arg.mail_address" type="email" data-ng-pattern="CONSTANTS.email_regexp" required/>
      <div class="text-danger" data-ng-show="SupportRequest.email.$error.required" data-translate>This field is mandatory</div>
      <div class="text-danger" data-ng-show="SupportRequest.email.$error.pattern" data-translate>Invalid email address</div>
    </div>
    <div class="form-group">
      <label data-translate>Text</label>
      <div>
        <textarea class="form-control" name="message" data-ng-model="arg.text" required></textarea>
      </div>
      <div class="text-danger" data-ng-show="SupportRequest.message.$error.required" data-translate>This field is mandatory</div>
    </div>
  </form>
  <div data-ng-show="sent" class="alert alert-secondary"><span data-translate>Thank you.</span> <span data-translate>We will try to get back to you as soon as possible.</span></div>
</div>
<div class="modal-footer">
  <button id="modal-action-ok" class="btn btn-primary" data-ng-hide="sent" data-ng-disabled="SupportRequest.$invalid" data-ng-click="sent=true; Utils.submitSupportRequest(arg);">
    <span data-translate>Submit</span>
  </button>

  <a id="modal-action-cancel" class="btn btn-outline-secondary" data-ng-click="cancel()">
    <i class="fa-solid fa-times"></i>
    <span data-translate>Close</span>
  </a>
</div>
