The Framework Code

twigs/content/profile.twig

File List

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

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

{% block scripts %}
    <script {{h.urlattr(fwurls.parsley)}}></script>
{% endblock scripts %}

{% block header %}
    <section class="col-md-12 mt-5">
	<h1>{{context.user.login}}</h1>
    </section>
{% endblock header %}

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

{% block main %}
    <section class="row">
        <article class="offset-md-1 col">
            {% include '@util/message.twig' %}
            {{f.startform({id: 'cform', method: 'POST'})}}
                {{f.email({label: 'Email', id: 'em', name: 'email', ph: 'Email Address', value: context.user.email})}}
                {{f.password({label: 'Password', id: 'pw', ph: '********', name: 'password'})}}
                {{f.password({label: 'Repeat Password', ph: '********', name: 'repeat', data: {'parsley-equalto': '#pw', 'parsley-trigger': 'change'} })}}
                {{f.submit({value: 'Update'})}}
            {{f.endform()}}
{#
            <form id="cform" action="#" method="post" role="form">
                <div class="form-group">
                    <label for="em" class="control-label">Email</label>
                    <input type="email" id="em" name="email" placeholder="Email address" value="{{context.user.email}}" class="form-control"/>
                </div>
                <div class="form-group">
                    <label for="pw" class="control-label">Password</label>
                    <input type="password" id="pw" name="password" placeholder="********" rows="10" class="form-control"/>
                </div>
                <div class="form-group">
                    <label for="rpw" class="control-label">Your Email Address</label>
                    <input type="password" id="rpw" name="repeat" placeholder="********" class="form-control" data-parsley-equalto="#pw", data-parsley-trigger="change"/>
                </div>
                <button class="btn btn-primary" type="submit">Update</button>
            </form>
#}
        </article>
    </section>
{% endblock main %}

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