willpower232/TOTPBTF3

View on GitHub
resources/views/sessions/form.twig

Summary

Maintainability
Test Coverage
{% extends 'global.twig' %}
{% block main %}

    {% include 'partials/header.twig' %}

    <main>
        <h1>Edit Profile</h1>

        <form method="POST" action="{{ route('session.update') }}">
            {{ csrf_field() }}

            <p>Enter your current password to confirm these changes.</p>

            <div class="fieldwrapper">
                <input id="f_currentpassword" type="password" class="{{ errors.has('currentpassword') ? ' is-invalid' }}" name="currentpassword" required autocomplete="false" placeholder=" " />

                <label for="f_currentpassword">Current Password</label>

                {% if errors.has('currentpassword') %}
                    <span class="invalid-feedback">
                        <strong>{{ errors.first('currentpassword') }}</strong>
                    </span>
                {% endif %}
            </div>

            <div class="fieldwrapper">
                <input id="f_name" type="text" class="{{ errors.has('name') ? ' is-invalid' }}" name="name" value="{{ old('name', user.name) }}" required autocomplete="false" placeholder=" " />

                <label for="f_name">Name</label>

                {% if errors.has('name') %}
                    <span class="invalid-feedback">
                        <strong>{{ errors.first('name') }}</strong>
                    </span>
                {% endif %}
            </div>

            <div class="fieldwrapper">
                <input id="f_email" type="text" class="{{ errors.has('email') ? ' is-invalid' }}" name="email" value="{{ old('email', user.email) }}" required autocomplete="false" placeholder=" " />

                <label for="f_email">Email</label>

                {% if errors.has('email') %}
                    <span class="invalid-feedback">
                        <strong>{{ errors.first('email') }}</strong>
                    </span>
                {% endif %}
            </div>

            <p>If you enter a new password you will be logged out. If you do not remember your password, it cannot be recovered and your tokens will be unreadable.</p>

            <div class="fieldwrapper">
                <input id="f_newpassword" type="password" class="{{ errors.has('newpassword') ? ' is-invalid' }}" name="newpassword" autocomplete="false" placeholder=" " />

                <label for="f_newpassword">New Password</label>

                {% if errors.has('newpassword') %}
                    <span class="invalid-feedback">
                        <strong>{{ errors.first('newpassword') }}</strong>
                    </span>
                {% endif %}
            </div>

            <div class="fieldwrapper">
                <input id="f_newpassword_confirmation" type="password" class="{{ errors.has('newpassword_confirmation') ? ' is-invalid' }}" name="newpassword_confirmation" autocomplete="false" placeholder=" " />

                <label for="f_newpassword_confirmation">Confirm New Password</label>

                {% if errors.has('newpassword_confirmation') %}
                    <span class="invalid-feedback">
                        <strong>{{ errors.first('newpassword_confirmation') }}</strong>
                    </span>
                {% endif %}
            </div>

            <div class="buttons">
                <button class="button-primary" type="submit">Save</button>
            </div>
        </form>
    </main>

{% endblock %}