@extends('layouts.authapp')
@section('title', 'Reset Password')
@section('content')
<div class="uk-section-muted uk-flex uk-flex-middle uk-animation-fade" uk-height-viewport>
    <div class="uk-width-1-1">
        <div class="uk-container">
            <div class="uk-grid-margin uk-grid uk-grid-stack" uk-grid>
                <div class="uk-width-1-1@m">
                    <div class="uk-margin uk-width-large uk-margin-auto uk-card uk-card-default uk-card-body uk-box-shadow-medium auth-form">
                        <h3 class="uk-card-title uk-text-center"><img class="auth-logo" alt="" src="{{url('images/listing-llama-logo.png')}}"></h3>
                        <p class="uk-text-center uk-margin-remove">{!! __("Enter your email address for password reset link!") !!}</p>
                        {{ Form::open(array('route' => 'forget.password.post','method' => 'POST', 'class' => 'form','id' => 'reset_form')) }}
                            @csrf
                            @include('partials.messages')
                            <div class="uk-margin">
                                <div class="uk-inline uk-width-1-1">
                                    <span class="uk-form-icon"><i class="fas fa-user"></i></span>
                                    {{Form::email('email', old('email'),['class' => 'uk-input uk-form-large','autocomplete' => 'off', 'placeholder' => 'Email Address *'])}}
                                </div>
                            </div>
                            <div class="uk-margin uk-text-right">
                                <a href="{{url('login')}}">Back to Login</a>
                            </div>
                            <div class="uk-margin">
                                <button type="submit" class="uk-button uk-button-primary uk-width-1-1 uk-button-large login-btn reset_passord_button" id="reset_passord_button" disabled>
                                  {{ __('Send Email') }}
                                </button>
                            </div>
                        {{ Form::close() }}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
@section('footer-script')
<script type="text/javascript">
    $(document).on('keyup','input[name="email"]',function(){
        var email    = $(this).val();
        if(email){
            $('.reset_passord_button').removeAttr('disabled');
        }
        else{
            $('.reset_passord_button').attr('disabled','true');
        }
    });
    
    $("#reset_form").validate({
        errorClass: "uk-text-danger",
        rules: {
            email: {
                required: true,
                email: true
            }
        },
        messages: {
            email: {
                required: '{!! __("Email field is required.") !!}'
            },
        }
    });
</script>
@endsection