Clean up the code
This commit is contained in:
parent
91a72d51ff
commit
f1d1fd64d3
3 changed files with 7 additions and 19 deletions
|
@ -31,10 +31,6 @@ const registration = {
|
||||||
if ((!this.registrationOpen && !this.token) || this.signedIn) {
|
if ((!this.registrationOpen && !this.token) || this.signedIn) {
|
||||||
this.$router.push('/main/all')
|
this.$router.push('/main/all')
|
||||||
}
|
}
|
||||||
// // Seems like this doesn't work at first page open for some reason
|
|
||||||
// if (this.$store.state.instance.registrationOpen && this.token) {
|
|
||||||
// this.$router.push('/registration')
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
token () { return this.$route.params.token },
|
token () { return this.$route.params.token },
|
||||||
|
@ -43,7 +39,7 @@ const registration = {
|
||||||
signedIn: (state) => !!state.users.currentUser,
|
signedIn: (state) => !!state.users.currentUser,
|
||||||
isPending: (state) => state.users[SIGN_UP.isPending],
|
isPending: (state) => state.users[SIGN_UP.isPending],
|
||||||
serverValidationErrors: (state) => state.users[SIGN_UP.errors],
|
serverValidationErrors: (state) => state.users[SIGN_UP.errors],
|
||||||
termsofservice: (state) => state.instance.tos
|
termsOfService: (state) => state.instance.tos
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -74,13 +74,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<!--
|
|
||||||
<div class='form-group'>
|
|
||||||
<label for='captcha'>Captcha</label>
|
|
||||||
<img src='/qvittersimplesecurity/captcha.jpg' alt='captcha' class='captcha'>
|
|
||||||
<input :disabled="registering" v-model='user.captcha' placeholder='Enter captcha' type='test' class='form-control' id='captcha'>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
<div class='form-group' v-if='token' >
|
<div class='form-group' v-if='token' >
|
||||||
<label for='token'>{{$t('registration.token')}}</label>
|
<label for='token'>{{$t('registration.token')}}</label>
|
||||||
<input disabled='true' v-model='token' class='form-control' id='token' type='text'>
|
<input disabled='true' v-model='token' class='form-control' id='token' type='text'>
|
||||||
|
@ -89,12 +83,10 @@
|
||||||
<button :disabled="isPending" type='submit' class='btn btn-default'>{{$t('general.submit')}}</button>
|
<button :disabled="isPending" type='submit' class='btn btn-default'>{{$t('general.submit')}}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='terms-of-service' v-html="termsofservice">
|
|
||||||
|
<div class='terms-of-service' v-html="termsOfService">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="clientValidationFailed">
|
|
||||||
<span>Form is invalid</span>
|
|
||||||
</div>
|
|
||||||
<div v-if="serverValidationErrors.length" class='form-group'>
|
<div v-if="serverValidationErrors.length" class='form-group'>
|
||||||
<div class='alert error'>
|
<div class='alert error'>
|
||||||
<span v-for="error in serverValidationErrors">{{error}}</span>
|
<span v-for="error in serverValidationErrors">{{error}}</span>
|
||||||
|
@ -165,7 +157,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-group--error .form--label {
|
.form-group--error .form--label {
|
||||||
color: #f04124;
|
color: var(--cRed, #f04124);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-error {
|
.form-error {
|
||||||
|
@ -198,8 +190,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
//align-self: flex-start;
|
|
||||||
//width: 10em;
|
|
||||||
margin-top: 0.6em;
|
margin-top: 0.6em;
|
||||||
height: 28px;
|
height: 28px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
export const SIGN_UP = {
|
export const SIGN_UP = {
|
||||||
|
// mutations
|
||||||
SUCCESS: 'SIGN_UP_SUCCESS',
|
SUCCESS: 'SIGN_UP_SUCCESS',
|
||||||
FAILURE: 'SIGN_UP_FAILURE',
|
FAILURE: 'SIGN_UP_FAILURE',
|
||||||
PENDING: 'SIGN_UP_PENDING',
|
PENDING: 'SIGN_UP_PENDING',
|
||||||
|
// state
|
||||||
isPending: 'sign_up_pending',
|
isPending: 'sign_up_pending',
|
||||||
errors: 'sign_up_errors'
|
errors: 'sign_up_errors'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue