@extends(Theme::viewName('layout'))

@section('title', trans('auth.change_password_title'))
@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-8 mr-md-auto ml-md-auto">
                <div class="card">
                    <div class="card-header">
                        <ul class="nav nav-tabs card-header-tabs">
                            <li class="nav-item">
                                <a class="nav-link active" href="{{ url('/password/change') }}">@yield('title')</a>
                            </li>
                        </ul>
                    </div>
                    <div class="card-body">
                        <form role="form" method="POST" action="{{ route('auth.processChangePassword') }}">
                            {{ csrf_field() }}

                            @if ($errors->has('email'))
                                <div class="alert alert-danger">{{ $errors->first('email') }}</div>
                            @endif

                            <div class="form-group row{{ $errors->has('password') ? ' has-danger' : '' }}">
                                <label for="password" class="col-md-4 col-form-label text-md-right">@lang('forms.password_label')</label>

                                <div class="col-md-6">
                                    <input id="password" type="password" class="form-control" name="password">

                                    @if ($errors->has('password'))
                                        <div class="form-control-feedback">
                                            <strong>{{ $errors->first('password') }}</strong>
                                        </div>
                                    @endif
                                </div>
                            </div>

                            <div class="form-group row{{ $errors->has('password_confirmation') ? ' has-danger' : '' }}">
                                <label for="password-confirm" class="col-md-4 col-form-label text-md-right">@lang('forms.password_confirm_label')</label>
                                <div class="col-md-6">
                                    <input id="password-confirm" type="password" class="form-control" name="password_confirmation">

                                    @if ($errors->has('password_confirmation'))
                                        <div class="form-control-feedback">
                                            <strong>{{ $errors->first('password_confirmation') }}</strong>
                                        </div>
                                    @endif
                                </div>
                            </div>

                            <div class="form-group row">
                                <div class="col-md-4"><!-- --></div>
                                <div class="col-md-6 text-right">
                                    <a href="{{ url('/login') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
                                    <button type="submit" class="btn btn-success">
                                        <i class="fa fa-fw fa-check"></i> @lang('auth.change_password_action')
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
