2017-04-16 02:12:23 +10:00
|
|
|
<template>
|
2018-04-01 04:14:36 +10:00
|
|
|
<div class="settings panel panel-default">
|
|
|
|
<div class="panel-heading">
|
2017-11-08 21:34:15 +11:00
|
|
|
{{$t('registration.registration')}}
|
2017-04-16 02:12:23 +10:00
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
<form v-on:submit.prevent='submit(user)' class='registration-form'>
|
2017-04-17 20:57:02 +10:00
|
|
|
<div class='container'>
|
|
|
|
<div class='text-fields'>
|
2018-12-05 20:43:01 +11:00
|
|
|
<div class='form-group' :class="{ 'form-group--error': $v.user.username.$error }">
|
|
|
|
<label class='form--label' for='sign-up-username'>{{$t('login.username')}}</label>
|
2019-02-25 06:30:29 +11:00
|
|
|
<input :disabled="isPending" v-model.trim='$v.user.username.$model' class='form-control' id='sign-up-username' :placeholder="$t('registration.username_placeholder')">
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
<div class="form-error" v-if="$v.user.username.$dirty">
|
2018-12-06 02:17:29 +11:00
|
|
|
<ul>
|
|
|
|
<li v-if="!$v.user.username.required">
|
|
|
|
<span>{{$t('registration.validations.username_required')}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
|
2018-12-06 02:42:33 +11:00
|
|
|
<div class='form-group' :class="{ 'form-group--error': $v.user.fullname.$error }">
|
2018-12-05 20:43:01 +11:00
|
|
|
<label class='form--label' for='sign-up-fullname'>{{$t('registration.fullname')}}</label>
|
2019-02-25 06:30:29 +11:00
|
|
|
<input :disabled="isPending" v-model.trim='$v.user.fullname.$model' class='form-control' id='sign-up-fullname' :placeholder="$t('registration.fullname_placeholder')">
|
2018-12-06 02:42:33 +11:00
|
|
|
</div>
|
|
|
|
<div class="form-error" v-if="$v.user.fullname.$dirty">
|
|
|
|
<ul>
|
|
|
|
<li v-if="!$v.user.fullname.required">
|
|
|
|
<span>{{$t('registration.validations.fullname_required')}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
|
|
|
|
<div class='form-group' :class="{ 'form-group--error': $v.user.email.$error }">
|
|
|
|
<label class='form--label' for='email'>{{$t('registration.email')}}</label>
|
|
|
|
<input :disabled="isPending" v-model='$v.user.email.$model' class='form-control' id='email' type="email">
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
<div class="form-error" v-if="$v.user.email.$dirty">
|
2018-12-06 02:17:29 +11:00
|
|
|
<ul>
|
|
|
|
<li v-if="!$v.user.email.required">
|
|
|
|
<span>{{$t('registration.validations.email_required')}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
|
2017-04-17 20:57:02 +10:00
|
|
|
<div class='form-group'>
|
2019-02-25 06:30:29 +11:00
|
|
|
<label class='form--label' for='bio'>{{$t('registration.bio')}} ({{$t('registration.optional')}})</label>
|
|
|
|
<textarea :disabled="isPending" v-model='user.bio' class='form-control' id='bio' :placeholder="$t('registration.bio_placeholder')"></textarea>
|
2018-12-05 20:43:01 +11:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='form-group' :class="{ 'form-group--error': $v.user.password.$error }">
|
|
|
|
<label class='form--label' for='sign-up-password'>{{$t('login.password')}}</label>
|
|
|
|
<input :disabled="isPending" v-model='user.password' class='form-control' id='sign-up-password' type='password'>
|
|
|
|
</div>
|
|
|
|
<div class="form-error" v-if="$v.user.password.$dirty">
|
2018-12-06 02:17:29 +11:00
|
|
|
<ul>
|
|
|
|
<li v-if="!$v.user.password.required">
|
|
|
|
<span>{{$t('registration.validations.password_required')}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2018-12-05 20:43:01 +11:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class='form-group' :class="{ 'form-group--error': $v.user.confirm.$error }">
|
|
|
|
<label class='form--label' for='sign-up-password-confirmation'>{{$t('registration.password_confirm')}}</label>
|
|
|
|
<input :disabled="isPending" v-model='user.confirm' class='form-control' id='sign-up-password-confirmation' type='password'>
|
|
|
|
</div>
|
|
|
|
<div class="form-error" v-if="$v.user.confirm.$dirty">
|
2018-12-06 02:17:29 +11:00
|
|
|
<ul>
|
|
|
|
<li v-if="!$v.user.confirm.required">
|
|
|
|
<span>{{$t('registration.validations.password_confirmation_required')}}</span>
|
|
|
|
</li>
|
|
|
|
<li v-if="!$v.user.confirm.sameAsPassword">
|
|
|
|
<span>{{$t('registration.validations.password_confirmation_match')}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2018-12-06 03:19:39 +11:00
|
|
|
|
2018-12-15 11:06:21 +11:00
|
|
|
<div class="form-group" id="captcha-group" v-if="captcha.type != 'none'">
|
2019-01-04 05:42:43 +11:00
|
|
|
<label class='form--label' for='captcha-label'>{{$t('captcha')}}</label>
|
2018-12-21 08:25:36 +11:00
|
|
|
|
2018-12-15 11:05:47 +11:00
|
|
|
<template v-if="captcha.type == 'kocaptcha'">
|
2018-12-17 06:47:52 +11:00
|
|
|
<img v-bind:src="captcha.url" v-on:click="setCaptcha">
|
2018-12-15 11:05:47 +11:00
|
|
|
|
2018-12-21 17:53:04 +11:00
|
|
|
<sub>{{$t('registration.new_captcha')}}</sub>
|
2018-12-15 11:05:47 +11:00
|
|
|
|
|
|
|
<input :disabled="isPending"
|
|
|
|
v-model='captcha.solution'
|
2018-12-21 08:25:36 +11:00
|
|
|
class='form-control' id='captcha-answer' type='text' autocomplete="off">
|
2018-12-15 11:05:47 +11:00
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
|
2018-08-05 17:01:38 +10:00
|
|
|
<div class='form-group' v-if='token' >
|
|
|
|
<label for='token'>{{$t('registration.token')}}</label>
|
|
|
|
<input disabled='true' v-model='token' class='form-control' id='token' type='text'>
|
|
|
|
</div>
|
2017-04-17 20:57:02 +10:00
|
|
|
<div class='form-group'>
|
2018-12-05 20:43:01 +11:00
|
|
|
<button :disabled="isPending" type='submit' class='btn btn-default'>{{$t('general.submit')}}</button>
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-12-06 03:19:39 +11:00
|
|
|
|
|
|
|
<div class='terms-of-service' v-html="termsOfService">
|
2017-04-17 20:57:02 +10:00
|
|
|
</div>
|
2017-04-16 02:12:23 +10:00
|
|
|
</div>
|
2018-12-05 20:43:01 +11:00
|
|
|
<div v-if="serverValidationErrors.length" class='form-group'>
|
2018-12-04 05:43:58 +11:00
|
|
|
<div class='alert error'>
|
2018-12-05 20:43:01 +11:00
|
|
|
<span v-for="error in serverValidationErrors">{{error}}</span>
|
2018-12-04 05:43:58 +11:00
|
|
|
</div>
|
2017-04-16 02:12:23 +10:00
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script src="./registration.js"></script>
|
|
|
|
<style lang="scss">
|
2018-04-01 12:28:20 +10:00
|
|
|
@import '../../_variables.scss';
|
2018-12-06 06:05:43 +11:00
|
|
|
$validations-cRed: #f04124;
|
2017-04-16 02:12:23 +10:00
|
|
|
|
|
|
|
.registration-form {
|
2018-04-08 02:30:27 +10:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
margin: 0.6em;
|
2017-04-17 20:57:02 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.container {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
//margin-bottom: 1em;
|
|
|
|
}
|
2017-04-17 20:57:02 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.terms-of-service {
|
|
|
|
flex: 0 1 50%;
|
|
|
|
margin: 0.8em;
|
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.text-fields {
|
|
|
|
margin-top: 0.6em;
|
|
|
|
flex: 1 0;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
}
|
2017-04-17 20:57:02 +10:00
|
|
|
|
2019-02-25 06:30:29 +11:00
|
|
|
textarea {
|
|
|
|
min-height: 100px;
|
|
|
|
}
|
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.form-group {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
padding: 0.3em 0.0em 0.3em;
|
|
|
|
line-height:24px;
|
2018-12-05 20:43:01 +11:00
|
|
|
margin-bottom: 1em;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-group--error {
|
|
|
|
animation-name: shakeError;
|
|
|
|
animation-duration: .6s;
|
|
|
|
animation-timing-function: ease-in-out;
|
|
|
|
}
|
|
|
|
|
|
|
|
.form-group--error .form--label {
|
2018-12-06 06:05:43 +11:00
|
|
|
color: $validations-cRed;
|
2018-12-06 06:35:15 +11:00
|
|
|
color: var(--cRed, $validations-cRed);
|
2018-12-05 20:43:01 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-error {
|
|
|
|
margin-top: -0.7em;
|
|
|
|
text-align: left;
|
2018-12-06 02:42:33 +11:00
|
|
|
|
2018-12-05 20:43:01 +11:00
|
|
|
span {
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
2018-12-06 02:17:29 +11:00
|
|
|
}
|
|
|
|
|
|
|
|
.form-error ul {
|
|
|
|
list-style: none;
|
|
|
|
padding: 0 0 0 5px;
|
|
|
|
margin-top: 0;
|
|
|
|
|
|
|
|
li::before {
|
|
|
|
content: "• ";
|
|
|
|
}
|
2018-04-08 02:30:27 +10:00
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
form textarea {
|
|
|
|
line-height:16px;
|
|
|
|
resize: vertical;
|
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.captcha {
|
|
|
|
max-width: 350px;
|
|
|
|
margin-bottom: 0.4em;
|
|
|
|
}
|
2017-04-22 01:52:42 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.btn {
|
|
|
|
margin-top: 0.6em;
|
|
|
|
height: 28px;
|
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
|
2018-04-08 02:30:27 +10:00
|
|
|
.error {
|
|
|
|
text-align: center;
|
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
}
|
2017-04-17 20:57:02 +10:00
|
|
|
|
2019-01-27 02:45:03 +11:00
|
|
|
@media all and (max-width: 800px) {
|
2018-04-08 02:30:27 +10:00
|
|
|
.registration-form .container {
|
2017-04-17 20:57:02 +10:00
|
|
|
flex-direction: column-reverse;
|
|
|
|
}
|
|
|
|
}
|
2017-04-16 02:12:23 +10:00
|
|
|
</style>
|