The Framework Code

twigs/content/register.twig

File List

{% set ajax = TRUE %}
{% set parsley = TRUE %}

{% extends '@content/page.twig' %}

{% import '@util/formmacro.twig' as f %}

{% block onload %}
    $('#regform').parsley()
{% endblock onload %}

{% block navigation %}
{% endblock navigation %}

{% block pageheader %}
{% endblock pageheader %}

{% block main %}
    <section class="row" id="frontpage">
        <article class="ml-auto col-md-8 mr-auto">
            {% include '@util/message.twig' %}
            {% if regok is defined %}
                <p><a href="{{base}}/login/" class="btn btn-primary">Login Page</a></p>
                <p><a href="{{base}}/" class="btn btn-primary">Home Page</a></p>
            {% else %}

                <h1 class="jumbotron">Register for {{fwurls.sitename.value}}</h1>
                {{f.startform({method: 'post', class: 'jumbotron', id: 'regform'})}}
                <form action="{{base}}/register" method="post" class="jumbotron" id="regform"
                    {{f.text({label: 'User Name', id: 'un', ph: 'User name - alphanumeric characters only',
                        parsley: {trigger: 'change',  'remote-reverse': 'false', remote: base~'/ajax/uniquenl/user/login/{value}',
                        'remote-message': 'That user name is not available', type: 'alphanum'}, required: TRUE})}}
                    {{f.password({label: 'Password', id: 'pw', name: 'password', ph: '*********', required: TRUE)}}
                    {{f.password({label: 'Repeat Password', id: 'rpw', name: 'repeat', ph: '*********', parsley: {trigger: 'change', equalTo: '#pw'}, required: TRUE})}}
                    {{f.email({label: 'Email Address', id: 'em', name: 'email', ph: 'pat@smith.org', parsley: {trigger: 'change'}, required: TRUE})}}
                    <p class="mt-4">
                        {{f.submit({value: 'Register'})}}
                    </p>
                {{f.endform()}}
            {% endif %}
        </article>
    </section>
{% endblock main %}

{% block pagefooter %}
{% endblock pagefooter %}