<commit_before>{% extends 'SimplyTestableWebClientBundle::App/single-page-dialog.html.twig' %}

{% block title %}Sign in - {{ parent() }}{% endblock %}

{% block content %}

<h1>Sign in</h1>
<!--
<p>
    Keep track of the tests you've started, find past test
    results, easily re-test when you make changes.
</p>
-->

    {% if user_signin_error is defined and user_signin_error != '' %}    
        {% if user_signin_error == 'invalid-user' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                There's no account for <strong>{{ email }}</strong>.
                Good news - we can do that for you if you like.
            </p>
            <form class="form-horizontal" method="get" action="{{ path('sign_up') }}">
                <div> 
                    <input type="hidden" name="email" value="{{ email }}" />
                    <button class="btn btn-success" type="submit">Yes, sign me up please!</button>
                </div>      
            </form>
        </div>                
        {% endif %}
    {% endif %}

    {% if user_signin_confirmation is defined and user_signin_confirmation != '' %}    
        {% if user_signin_confirmation == 'user-activated' %}
        <div class="alert alert-success for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Yippee!</strong>
            </p>
            <p>
                Your account is now activate. Go ahead, sign in and enjoy.
            </p>
        </div>                
        {% endif %}
    {% endif %}

<form class="form-horizontal" method="post" action="{{ path('sign_in_submit') }}">
        {% if user_signin_error is defined and user_signin_error != '' %}
            {% if user_signin_error == 'invalid-email' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Hmmm.</strong> I'm not convinced that <strong>{{ email }}</strong> is a valid email address.
        </div>                
            {% endif %}        
        
            {% if user_signin_error == 'blank-email' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Slow down!</strong> You're going to have to enter in your email address to sign in.
        </div>                
            {% endif %}                                                   
        
            {% if user_signin_error == 'blank-password' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Slow down!</strong> You're going to have to enter in your password to sign in.
        </div>                
            {% endif %}   
        
            {% if user_signin_error == 'test-not-logged-in' %}
        <div class="alert alert-info">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You need to sign in to access this test.
            </p>
        </div>                
            {% endif %}           

            {% if user_signin_error == 'authentication-failure' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hmmm.</strong>
            </p>
            <p>
                That's not the right password. Try again.
            </p>
        </div>                
            {% endif %}         
        
            {% if user_signin_error == 'public-user' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You're trying to sign in as the public user.
            </p>
            <p>
                The public user is special, you're not allowed to sign in as it.
            </p>
        </div>                
            {% endif %}        
        
            {% if user_signin_error == 'user-not-enabled' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You've not yet activated your account.
            </p>
            <p>
                We've emailed an activation code to <strong> {{ email }}</strong>.
            </p>
            <p>
                Follow the instructions in the email to activate your account. Once
                you've done that, you can sign in.
            </p> 

        </div>               
            {% endif %}         
        {% endif %}    
    
    <div class="larger">
        <label for="email">Email</label>
        <input type="text" id="email" name="email" placeholder="Enter your email address" {% if email != '' %} value="{{ email }}" {% endif %} />
    </div>
    <div class="larger">
        <label  for="password">Password</label>
        <input name="password" type="password" id="password" placeholder="Enter your password" />
    </div>       
    <div>
        <button class="submit btn btn-large btn-primary" type="submit">Sign in!</button>
        <input type="hidden" name="redirect" value="{{ redirect }}" />
        <label class="checkbox" id="stay-signed-in-container">
            <input type="checkbox" {% if stay_signed_in == "1" %}checked="checked"{% endif %} name="stay-signed-in" value="1"><span>Stay signed in</span>
        </label>        
    </div>       
</form>   

<form class="form-horizontal" method="get" action="{{ path('reset_password') }}">
    <div class="input-secondary">                
        <button class="btn" type="submit">I need to reset my password</button>
        <input type="hidden" name="email" value="{{ email }}" />        
    </div>      
</form>

{% endblock %}<commit_msg>Tick 'stay signed in' by default<commit_after>{% extends 'SimplyTestableWebClientBundle::App/single-page-dialog.html.twig' %}

{% block title %}Sign in - {{ parent() }}{% endblock %}

{% block content %}

<h1>Sign in</h1>
<!--
<p>
    Keep track of the tests you've started, find past test
    results, easily re-test when you make changes.
</p>
-->

    {% if user_signin_error is defined and user_signin_error != '' %}    
        {% if user_signin_error == 'invalid-user' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                There's no account for <strong>{{ email }}</strong>.
                Good news - we can do that for you if you like.
            </p>
            <form class="form-horizontal" method="get" action="{{ path('sign_up') }}">
                <div> 
                    <input type="hidden" name="email" value="{{ email }}" />
                    <button class="btn btn-success" type="submit">Yes, sign me up please!</button>
                </div>      
            </form>
        </div>                
        {% endif %}
    {% endif %}

    {% if user_signin_confirmation is defined and user_signin_confirmation != '' %}    
        {% if user_signin_confirmation == 'user-activated' %}
        <div class="alert alert-success for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Yippee!</strong>
            </p>
            <p>
                Your account is now activate. Go ahead, sign in and enjoy.
            </p>
        </div>                
        {% endif %}
    {% endif %}

<form class="form-horizontal" method="post" action="{{ path('sign_in_submit') }}">
        {% if user_signin_error is defined and user_signin_error != '' %}
            {% if user_signin_error == 'invalid-email' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Hmmm.</strong> I'm not convinced that <strong>{{ email }}</strong> is a valid email address.
        </div>                
            {% endif %}        
        
            {% if user_signin_error == 'blank-email' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Slow down!</strong> You're going to have to enter in your email address to sign in.
        </div>                
            {% endif %}                                                   
        
            {% if user_signin_error == 'blank-password' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <strong>Slow down!</strong> You're going to have to enter in your password to sign in.
        </div>                
            {% endif %}   
        
            {% if user_signin_error == 'test-not-logged-in' %}
        <div class="alert alert-info">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You need to sign in to access this test.
            </p>
        </div>                
            {% endif %}           

            {% if user_signin_error == 'authentication-failure' %}
        <div class="alert alert-error for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hmmm.</strong>
            </p>
            <p>
                That's not the right password. Try again.
            </p>
        </div>                
            {% endif %}         
        
            {% if user_signin_error == 'public-user' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You're trying to sign in as the public user.
            </p>
            <p>
                The public user is special, you're not allowed to sign in as it.
            </p>
        </div>                
            {% endif %}        
        
            {% if user_signin_error == 'user-not-enabled' %}
        <div class="alert alert-info for:input-email">
            <button type="button" class="close" data-dismiss="alert">×</button>
            <p>
                <strong>Hello!</strong>
            </p>
            <p>
                You've not yet activated your account.
            </p>
            <p>
                We've emailed an activation code to <strong> {{ email }}</strong>.
            </p>
            <p>
                Follow the instructions in the email to activate your account. Once
                you've done that, you can sign in.
            </p> 

        </div>               
            {% endif %}         
        {% endif %}    
    
    <div class="larger">
        <label for="email">Email</label>
        <input type="text" id="email" name="email" placeholder="Enter your email address" {% if email != '' %} value="{{ email }}" {% endif %} />
    </div>
    <div class="larger">
        <label  for="password">Password</label>
        <input name="password" type="password" id="password" placeholder="Enter your password" />
    </div>       
    <div>
        <button class="submit btn btn-large btn-primary" type="submit">Sign in!</button>
        <input type="hidden" name="redirect" value="{{ redirect }}" />
        <label class="checkbox" id="stay-signed-in-container">
            <input type="checkbox" {% if stay_signed_in != "0" %}checked="checked"{% endif %} name="stay-signed-in" value="1"><span>Stay signed in</span>
        </label>        
    </div>       
</form>   

<form class="form-horizontal" method="get" action="{{ path('reset_password') }}">
    <div class="input-secondary">                
        <button class="btn" type="submit">I need to reset my password</button>
        <input type="hidden" name="email" value="{{ email }}" />        
    </div>      
</form>

{% endblock %}
{'fraction_non_alphanumeric': 0.14813657316977888, 'fraction_numerical': 0.0006250488319399953, 'mean_word_length': 1.5995125913891146, 'pattern_counts': {'":': 0, '<': 265, '<?xml version=': 0, '>': 265, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2894473', 'n_tokens_mistral': 3691, 'n_tokens_neox': 3411, 'n_words': 917}