@extends('layout.app')
@section('scripts')
    <script>
        const i18n = {
            common: {
                error_occurred: "{{ __('app.common.error_occurred') }}",
                not_permitted: "{{ __('app.common.not_permitted') }}"
            },
            login: {
                login_success: "{{ __('app.login.login_success') }}"
            }
        };
    </script>
    <script src="{{ asset("js/intern.js") }}"></script>
    <script src="{{ asset("js/login/login.js") }}"></script>
@endsection

@section('content')
    <h1>{{ __('app.login.title') }}</h1>

    <span>

    @guest
    <div id="fehlermeldung">{{ __('app.login.please_login') }}</div>
    <br /><br />
    <table class="eingabemaske">
        <tr>
            <td><label for="mail">{{ __('app.login.email') }}</label></td>
            <td><input size="32" type="text" id="mail" pattern="^[0-9A-Za-z+_\-]+@[0-9A-Za-z_\-]+\.[0-9A-Za-z]+$"
                       title="{{ __('app.login.email_title') }}"/></td>
        </tr>
        <tr>
            <td><label for="password">{{ __('app.login.password') }}</label></td>
            <td><input size="32" type="password" id="password"></td>
        </tr>
    </table>

    <br/><br/>
    <button class="eingabemaske" onclick="login()">{{ __('app.login.title') }}</button>

    @endguest
    @auth
        <div id="fehlermeldung">{{ __('app.login.logged_in') }}</div>
        <a href="{{ route('logout') }}"><button>{{ __('app.login.logout') }}</button></a>
    @endauth

</span>
@endsection
