aboutsummaryrefslogtreecommitdiffstats
path: root/templates/web/base/auth/general.html
blob: 1e44bb68ef1d1828cb3a143cf589e2202b26ea8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
[% INCLUDE 'header.html', bodyclass='authpage', title = loc('Sign in or create an account') %]

<h1>[% loc('Sign in') %]</h1>

[% TRY %][% INCLUDE 'auth/_general_top.html' %][% CATCH file %][% END %]

[% IF oauth_need_email %]
    <p class="form-error">[% loc('We need your email address, please give it below.') %]</p>
[% END %]
[% IF oauth_failure %]
    <p class="form-error">[% loc('Sorry, we could not log you in. Please fill in the form below.') %]</p>
[% END %]

<form action="/auth" method="post" name="general_auth" class="validate">
    <fieldset>

        <input type="hidden" name="r" value="[% c.req.params.r | html %]">

[% IF NOT oauth_need_email AND c.cobrand.social_auth_enabled %]
    [% IF c.config.FACEBOOK_APP_ID %]
      <div class="form-box">
        <button name="facebook_sign_in" id="facebook_sign_in" value="facebook_sign_in" class="btn btn--block btn--social btn--facebook">
            <img alt="" src="/i/facebook-icon-32.png" width="17" height="32">
            [% loc('Log in with Facebook') %]
        </button>
      </div>
    [% END %]
    [% IF c.config.TWITTER_KEY %]
      <div class="form-box">
        <button name="twitter_sign_in" id="twitter_sign_in" value="twitter_sign_in" class="btn btn--block btn--social btn--twitter">
            <img alt="" src="/i/twitter-icon-32.png" width="17" height="32">
            [% loc('Log in with Twitter') %]
        </button>
      </div>
    [% END %]
      <div id="js-social-email-hide">
[% END %]

        [% loc_username_error = INCLUDE 'auth/_username_error.html' default='email' %]

[% IF c.config.SMS_AUTHENTICATION %]
    [% SET username_label = loc('Your email or mobile') %]
[% ELSE %]
    [% SET username_label = loc('Your email') %]
[% END %]

        <label class="n" for="username">[% username_label %]</label>
      [% IF loc_username_error  %]
        <div class="form-error">[% loc_username_error %]</div>
      [% ELSIF sign_in_error %]
        <div class="form-error">[% loc('There was a problem with your login information. If you cannot remember your password, or do not have one, please fill in the &lsquo;No&rsquo; section of the form.') %]</div>
      [% END %]
        <input type="text" class="form-control required" id="username" name="username" value="[% username | html %]"
        [%~ IF c.cobrand.moniker != 'borsetshire' %] autofocus[% END %]>

        <div id="form_sign_in">
            <h3>[% tprintf(loc("Do you have a %s password?", "%s is the site name"), site_name)  %]</h3>
          [% IF oauth_need_email %]
            [% INCLUDE form_sign_in_no %]
            [% INCLUDE form_sign_in_yes %]
            <input type="hidden" name="oauth_need_email" value="1">
          [% ELSE %]
          [% IF NOT field_errors.password_register %]
            [% INCLUDE form_sign_in_yes %]
          [% END %]
            [% INCLUDE form_sign_in_no %]
          [% END %]
        </div>

[% IF NOT oauth_need_email AND c.cobrand.social_auth_enabled %]
      </div>
[% END %]

    </fieldset>
</form>

[% INCLUDE 'footer.html' %]

[% BLOCK form_sign_in_yes %]
    <div id="form_sign_in_yes" class="form-box">
        <h5>[% loc('<strong>Yes</strong> I have a password') %]</h5>

        <label class="hidden-js n" for="password_sign_in">[% loc('Password:') %]</label>

        <div class="form-txt-submit-box">
            <input type="password" name="password_sign_in" class="form-control" id="password_sign_in" value="" placeholder="[% loc('Your password') %]">
            <input class="green-btn" type="submit" name="sign_in_by_password" value="[% loc('Sign in') %]">
        </div>

        <div class="checkbox-group">
            <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]>
            <label class="inline n" for="remember_me">[% loc('Keep me signed in on this computer') %]</label>
        </div>

        <div class="general-notes">
            <p><strong>[% loc('Forgotten your password?') %]</strong>
          [% IF c.config.SMS_AUTHENTICATION %]
            [% loc('Sign in by email or text, providing a new password. When you click the link in your email or enter the SMS authentication code, your password will be updated.') %]</p>
          [% ELSE %]
            [% loc('Sign in by email instead, providing a new password. When you click the link in your email, your password will be updated.') %]</p>
          [% END %]
        </div>

    </div>
[% END %]

[% BLOCK form_sign_in_no %]
    <div id="form_sign_in_no" class="form-box">
      [% IF c.config.SMS_AUTHENTICATION %]
        <h5>[% loc('<strong>No</strong> let me sign in by email or text') %]</h5>
      [% ELSE %]
        <h5>[% loc('<strong>No</strong> let me sign in by email') %]</h5>
      [% END %]

        <label for="name">[% loc('Name') %]</label>
        <input class="form-control" type="text" name="name" value="" placeholder="[% loc('Your name') %]">

        <label for="password_register">[% loc('Password (optional)') %]</label>
      [% IF field_errors.password_register %]
        <p class='form-error'>[% field_errors.password_register %]</p>
      [% END %]

        <div class="general-notes">
            <p>[% loc('Providing a name and password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</p>
        </div>

        <div class="form-txt-submit-box">
            <input class="form-control js-password-validate" type="password" name="password_register" id="password_register" value="" placeholder="[% loc('Enter a password') %]">
            <input class="green-btn" type="submit" name="sign_in_by_code" value="[% loc('Sign in') %]">
        </div>

        <div class="general-notes">
            <p>[% tprintf(loc('Your password should include %d or more characters.'), c.cobrand.password_minimum_length) %]</p>
        </div>

    </div>
[% END %]