//
  Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
//

.login2(ng-controller='SignInCtrl')
  .login-wrapper
    a(href='./')
      img(width='160', height='160', src='/static/logo/exports/STF-512.png', title='STF')

    form(name='signin', novalidate, ng-submit='submit()')
      .alert.alert-danger(ng-show='error')
        span(ng-show='error.$invalid', translate) Check errors below
        span(ng-show='error.$incorrect', translate) Incorrect login details
        span(ng-show='error.$server', translate) Server error. Check log output.

      .form-group
        .input-group
          span.input-group-addon
            i.fa.fa-user
          input.form-control(ng-model='username', name='username', required, type='text', placeholder='Name',
          autocorrect='off', autocapitalize='off', spellcheck='false', autocomplete='section-login username')
        .alert.alert-warning(ng-show='signin.username.$dirty && signin.username.$invalid')
          span(translate) Please enter your name

      .form-group
        .input-group
          span.input-group-addon
            i.fa.fa-envelope
          input.form-control(ng-model='email', name='email', required, type='email', placeholder='E-mail',
          autocorrect='off', autocapitalize='off', spellcheck='false', autocomplete='section-login email')
        .alert.alert-warning(ng-show='signin.email.$dirty && signin.email.$invalid')
          span(ng-show='signin.email.$error.email', translate) Please enter a valid email
          span(ng-show='signin.email.$error.required', translate) Please enter your email

      input.btn.btn-lg.btn-primary.btn-block(type='submit', value='Log In')

      button.btn.btn-sm.btn-default-outline(
        type='button'
        uib-tooltip="{{'Write a mail to the support team' | translate}}"
        ng-disabled='!contactEmail'
        ng-click='mailToSupport()'
        tooltip-placement='top'
        tooltip-popup-delay='500')
          i.fa.fa-envelope-o
          span(translate) Contact Support

