<commit_before><%inherit file="base.mako"/>

<%def name="title()">Sign In</%def>

<%def name="content()">

%if campaign == "prereg":
<div class="text-center m-t-lg">
    <h3>Preregistration Challenge </h3>
    <hr>
    <p>
      Please login to the Open Science Framework or create a free account to continue.
    </p>
</div>
%endif

%if campaign == "institution" and enable_institutions:
<div class="text-center m-t-lg">
    <h3>OSF for Institutions </h3>
    <hr>
    <p>
      If your institution has partnered with the Open Science Framework, please
        select its name below and sign in with your institutional credentials.
    </p>
    <p> If you do not currently have an OSF account, this will create one. By creating an account you agree to our <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/TERMS_OF_USE.md">Terms</a> and that you have read our <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/PRIVACY_POLICY.md">Privacy Policy</a>, including our information on <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/PRIVACY_POLICY.md#f-cookies">Cookie Use</a>.</p>
</div>
%endif
<div class="row m-t-xl">
    %if campaign == "institution" and enable_institutions:
    <div class="col-sm-6 col-sm-offset-3 toggle-box toggle-box-active">
        <h3 class="m-b-lg"> Login through institution</h3>
        <div id="inst">
            <div class="form-group">
                <label for="selectedInst" class="control-label">Select Institution</label>
                <select id="selectedInst" class="form-control" data-bind="value: selectedInst, options: instNames"></select>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <button data-bind="click: instLogin" class="btn btn-success pull-right">Sign in</button>
                </div>
            </div>
            <div class="form-group" style="padding-top: 15px">
                <div class="text-center m-t-lg">
                    <p>For non-institutional login, click <a href="/login/">here</a>.</p>
                </div>
            </div>
        </div>
    </div>
    %endif
    %if campaign != "institution" or not enable_institutions:
        %if sign_up:
            <div class="col-sm-5 col-sm-offset-1 toggle-box toggle-box-left toggle-box-muted p-h-lg">
        %else:
            <div class="col-sm-5 col-sm-offset-1 toggle-box toggle-box-left toggle-box-active p-h-lg">
        %endif
        <form
            id="logInForm"
            class="form-horizontal"
            action="${login_url}"
            method="POST"
            data-bind="submit: submit"
        >
            <h3 class="m-b-lg"> Login </h3>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-3 control-label">Email</label>
                <div class="col-sm-9">
                    <input
                        type="email"
                        class="form-control"
                        data-bind="value: username"
                        name="username"
                        id="inputEmail3"
                        placeholder="Email"
                        autofocus
                    >
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-3 control-label">Password</label>
                    <div class="col-sm-9">
                    <input
                        type="password"
                        class="form-control"
                        id="inputPassword3"
                        placeholder="Password"
                        data-bind="value: password"
                        name="password"
                    >
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <div class="checkbox">
                    <label><input type="checkbox"> Remember me</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <button type="submit" class="btn btn-success pull-right">Sign in</button>
                </div>
            </div>
        </form>
    </div>
        %if sign_up:
            <div id="signUpScope" class="col-sm-5 toggle-box toggle-box-right toggle-box-active p-h-lg" style="height: auto;">
        %else:
            <div id="signUpScope" class="col-sm-5 toggle-box toggle-box-right toggle-box-muted p-h-lg" style="height: auto;">
        %endif
        <form data-bind="submit: submit" class="form-horizontal">
            <h3 class="m-b-lg"> Create a free account </h3>
                <div
                    class="form-group"
                    data-bind="
                        css: {
                            'has-error': fullName() && !fullName.isValid(),
                            'has-success': fullName() && fullName.isValid()
                        }"
                >
                    <label for="inputName" class="col-sm-4 control-label">Full Name</label>
                    <div class="col-sm-8">
                        <input
                            type="text"
                            class="form-control"
                            id="inputName"
                            placeholder="Name"
                            data-bind="
                                value: fullName, disable: submitted(),
                                event: {
                                    blur: trim.bind($data, fullName)
                                }"
                        >
                        <p class="help-block" data-bind="validationMessage: fullName" style="display: none;"></p>
                    </div>
                </div>
            <div
                class="form-group"
                data-bind="
                    css: {
                        'has-error': email1() && !email1.isValid(),
                        'has-success': email1() && email1.isValid()
                    }"
            >
                <label for="inputEmail" class="col-sm-4 control-label">Email</label>
                <div class="col-sm-8">
                    <input
                        type="text"
                        class="form-control"
                        id="inputEmail"
                        placeholder="Email"
                        data-bind="
                            value: email1,<commit_msg>autofocus form based on if you are logging in or signing up<commit_after><%inherit file="base.mako"/>

<%def name="title()">Sign In</%def>

<%def name="content()">

%if campaign == "prereg":
<div class="text-center m-t-lg">
    <h3>Preregistration Challenge </h3>
    <hr>
    <p>
      Please login to the Open Science Framework or create a free account to continue.
    </p>
</div>
%endif

%if campaign == "institution" and enable_institutions:
<div class="text-center m-t-lg">
    <h3>OSF for Institutions </h3>
    <hr>
    <p>
      If your institution has partnered with the Open Science Framework, please
        select its name below and sign in with your institutional credentials.
    </p>
    <p> If you do not currently have an OSF account, this will create one. By creating an account you agree to our <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/TERMS_OF_USE.md">Terms</a> and that you have read our <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/PRIVACY_POLICY.md">Privacy Policy</a>, including our information on <a href="https://github.com/CenterForOpenScience/centerforopenscience.org/blob/master/PRIVACY_POLICY.md#f-cookies">Cookie Use</a>.</p>
</div>
%endif
<div class="row m-t-xl">
    %if campaign == "institution" and enable_institutions:
    <div class="col-sm-6 col-sm-offset-3 toggle-box toggle-box-active">
        <h3 class="m-b-lg"> Login through institution</h3>
        <div id="inst">
            <div class="form-group">
                <label for="selectedInst" class="control-label">Select Institution</label>
                <select id="selectedInst" class="form-control" data-bind="value: selectedInst, options: instNames"></select>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <button data-bind="click: instLogin" class="btn btn-success pull-right">Sign in</button>
                </div>
            </div>
            <div class="form-group" style="padding-top: 15px">
                <div class="text-center m-t-lg">
                    <p>For non-institutional login, click <a href="/login/">here</a>.</p>
                </div>
            </div>
        </div>
    </div>
    %endif
    %if campaign != "institution" or not enable_institutions:
        %if sign_up:
            <div class="col-sm-5 col-sm-offset-1 toggle-box toggle-box-left toggle-box-muted p-h-lg">
        %else:
            <div class="col-sm-5 col-sm-offset-1 toggle-box toggle-box-left toggle-box-active p-h-lg">
        %endif
        <form
            id="logInForm"
            class="form-horizontal"
            action="${login_url}"
            method="POST"
            data-bind="submit: submit"
        >
            <h3 class="m-b-lg"> Login </h3>
            <div class="form-group">
                <label for="inputEmail3" class="col-sm-3 control-label">Email</label>
                <div class="col-sm-9">
                    %if sign_up:
                    <input
                        type="email"
                        class="form-control"
                        data-bind="value: username"
                        name="username"
                        id="inputEmail3"
                        placeholder="Email"
                    >
                    %else:
                    <input
                        type="email"
                        class="form-control"
                        data-bind="value: username"
                        name="username"
                        id="inputEmail3"
                        placeholder="Email"
                        autofocus
                    >
                    %endif
                </div>
            </div>
            <div class="form-group">
                <label for="inputPassword3" class="col-sm-3 control-label">Password</label>
                    <div class="col-sm-9">
                    <input
                        type="password"
                        class="form-control"
                        id="inputPassword3"
                        placeholder="Password"
                        data-bind="value: password"
                        name="password"
                    >
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <div class="checkbox">
                    <label><input type="checkbox"> Remember me</label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-3 col-sm-9">
                    <button type="submit" class="btn btn-success pull-right">Sign in</button>
                </div>
            </div>
        </form>
    </div>
        %if sign_up:
            <div id="signUpScope" class="col-sm-5 toggle-box toggle-box-right toggle-box-active p-h-lg" style="height: auto;">
        %else:
            <div id="signUpScope" class="col-sm-5 toggle-box toggle-box-right toggle-box-muted p-h-lg" style="height: auto;">
        %endif
        <form data-bind="submit: submit" class="form-horizontal">
            <h3 class="m-b-lg"> Create a free account </h3>
                <div
                    class="form-group"
                    data-bind="
                        css: {
                            'has-error': fullName() && !fullName.isValid(),
                            'has-success': fullName() && fullName.isValid()
                        }"
                >
                    <label for="inputName" class="col-sm-4 control-label">Full Name</label>
                    <div class="col-sm-8">
                        %if sign_up:
                        <input
                            autofocus
                            type="text"
                            class="form-control"
                            id="inputName"
                            placeholder="Name"
                            data-bind="
                                value: fullName, disable: submitted(),
                                event: {
                                    blur: trim.bind($data, fullName)
                                }"
                        >
                        %else:
                            <input
                            type="text"
                            class="form-control"
                            id="inputName"
                            placeholder="Name"
                            data-bind="
                                value: fullName, disable: submitted(),
                                event: {
                                    blur: trim.bind($data, fullName)
                                }"
                        >
                        %endif
                        <p class="help-block" data-bind="validationMessage: fullName" style="display: none;"></p>
                    </div>
                </div>
            <div
                class="form-group"
                data-bind="
                    css: {
                        'has-error': email1() && !email1.isValid(),
                        'has-success': email1() && email1.isValid()
                    }"
            >
                <label for="inputEmail" class="col-sm-4 control-label">Email</label>
                <div class="col-sm-8">
                    <input
                        type="text"
                        class="form-control"
                        id="inputEmail"
                        placeholder="Email"
                        data-bind="
                            value: email1,
{'fraction_non_alphanumeric': 0.12559407324573665, 'fraction_numerical': 0.006080514397539838, 'mean_word_length': 1.2441969887076536, 'pattern_counts': {'":': 2, '<': 221, '<?xml version=': 0, '>': 219, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3293856', 'n_tokens_mistral': 3843, 'n_tokens_neox': 3648, 'n_words': 795}