login.html 5.79 KB
Newer Older
mntmn's avatar
mntmn committed
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
<header id="landing-header" class="header" v-cloak v-if="(active_view == 'login' || active_view == 'signup' || active_view == 'password-reset' || active_view == 'password-confirm')">
  <div class="header-left">
    <a class="btn btn-transparent btn-nude" href="/"><img src="/images/sd5-logo.svg" width="190"></a>
  </div>

  <div class="header-right pull-right">
    <span class="btn-group dark round">
      {% if (locale != "de") %}<a href="/t/de?r={{active_view}}" class="btn btn-transparent btn-md">Deutsch</a>{% endif %}
      {% if (locale != "en") %}<a href="/t/en?r={{active_view}}" class="btn btn-transparent btn-md">English</a>{% endif %}
      {% if (locale != "fr") %}<a href="/t/fr?r={{active_view}}" class="btn btn-transparent btn-md">Français</a>{% endif %}
    </span>

    <a class="btn btn-md btn-dark btn-round" href="/login">[[__("login")]]</a>
    <a class="btn btn-md btn-blue btn-round" href="/signup">[[__("signup")]]</a>
  </div>
</header>

<div id="account-forms"
  v-bind:class="{'got-user':logged_in}"
  v-cloak
  v-if="(active_view == 'login' || active_view == 'signup' || active_view == 'password-reset' || active_view == 'password-confirm')">

  <div id="login" v-bind:class="{active : active_view == 'login'}">
    <div class="content">
      <form v-on:submit="login_submit(user_forms_email, login_password, $event)">
        <h4>[[__("login")]]</h4>

        <div class="tight">
          <div class="form-group">
            <input class="input" name="email" type="email" required v-model="user_forms_email" placeholder="[[__("email")]]">
          </div>
          <div class="form-group">
            <input class="input" name="password" type="password" required v-model="login_password" placeholder="[[__("password")]]">
          </div>
        </div>

        <button type="submit" class="btn btn-primary btn-block">
          <span v-show="!loading_user">[[__("login")]]</span>
          <span v-show="loading_user">[[__("logging_in")]]</span>
        </button>

        <div class="center alert alert-danger" v-if="login_error">{{login_error}}</div>

        <div class="pull-right">
          <a class="btn btn-xs btn-darken" href="/signup">[[__("signup")]]</a>&nbsp;
          <a class="btn btn-xs btn-darken" href="/password-reset">[[__("reset_password")]]</a>
        </div>
      </form>
    </div>
  </div>

  <div id="signup" v-bind:class="{active : active_view == 'signup'}">
    <div class="content">
      <form v-on:submit="signup_submit($event, user_forms_name, user_forms_email, signup_password, signup_password_confirmation)">
        <h4>[[__("signup")]]</h4>

        <div class="tight">

          <div class="form-group">
            <input class="input" type="text" id="user-name" v-model="user_forms_name" placeholder="[[__("name")]]" v-focus autofocus>
          </div>

        </div>

        <div class="tight">

          <div class="form-group">
            <input class="input" type="email" required id="user-email" v-model="user_forms_email" placeholder="[[__("email")]]">
          </div>

          <div class="form-group">
            <input class="input" id="user-password" required type="password" v-model="signup_password" placeholder="[[__("password")]]">
          </div>

          <div class="form-group">
            <input class="input" id="user-password-confirmation" required type="password" v-model="signup_password_confirmation" placeholder="[[__("password_confirmation")]]">
          </div>
        </div>

        <div style="margin-top: -7px; margin-bottom: 7px;"><small>By signing up you agree to our <a href="/terms" target="_blank">TOS</a> and <a href="/privacy" target="_blank">Privacy Policy.</a></small><br/>
       </div>

        <button class="btn btn-primary btn-block">
          <span v-if="!creating_user">[[__("signup")]]</span>
          <span v-if="creating_user">[[__("signing_up")]]</span>
        </button>

        <div class="center alert alert-danger" style="width:100%;" v-if="signup_error">{{signup_error}}</div>

        <a class="btn btn-link btn-block" href="/login" style="margin-top: 20px">[[__("login")]]</a>
      </form>
    </div>
  </div>

  <div id="password-reset" v-bind:class="{active : active_view == 'password-reset'}">
    <div class="content" v-if="!password_reset_send">
      <form>
        <h4>Password Recovery</h4>
        <div class="tight">
          <div class="form-group">
            <input class="input" type="email" id="user-email" v-model="reset_email" placeholder="[[__("email")]]">
          </div>
        </div>
        <div class="text-center alert alert-danger" v-if="password_reset_error">{{password_reset_error}}</div>
        <button class="btn btn-primary btn-block" v-on:click="password_reset_submit($event, reset_email)">[[__("reset_password")]]</button>
      </form>
    </div>
    <div class="content" v-if="password_reset_send==true">
      <h4>[[__("password_confirmation")]]</h4>
      [[__("password_check_inbox")]]
    </div>
  </div>

  <div id="password-confirm" v-bind:class="{active : active_view == 'password-confirm'}">
    <div class="content">
      <form>
        <h4>Password Recovery</h4>

        <div class="tight">
          <div class="form-group">
            <input class="input" id="user-password" type="password" v-model="signup_password" placeholder="[[__("password")]]">
          </div>

          <div class="form-group">
            <input class="input" id="user-password" type="password" v-model="signup_password_confirmation" placeholder="[[__("password_confirmation")]]">
          </div>
        </div>

        <div class="text-center alert alert-danger" v-if="password_reset_confirm_error">{{password_reset_confirm_error}}</div>
        <button class="btn btn-primary btn-block" v-on:click="password_reset_confirm($event, signup_password, signup_password_confirmation)">[[__("save")]]</button>
      </form>
    </div>
  </div>

</div>