Changeset View
Changeset View
Standalone View
Standalone View
src/resources/vue/Signup.vue
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | <div class="container"> | ||||
<input type="text" class="form-control" id="signup_login" required v-model="login" :placeholder="$t('signup.login')"> | <input type="text" class="form-control" id="signup_login" required v-model="login" :placeholder="$t('signup.login')"> | ||||
<span class="input-group-text">@</span> | <span class="input-group-text">@</span> | ||||
<input v-if="is_domain" type="text" class="form-control rounded-end" id="signup_domain" required v-model="domain" :placeholder="$t('form.domain')"> | <input v-if="is_domain" type="text" class="form-control rounded-end" id="signup_domain" required v-model="domain" :placeholder="$t('form.domain')"> | ||||
<select v-else class="form-select rounded-end" id="signup_domain" required v-model="domain"> | <select v-else class="form-select rounded-end" id="signup_domain" required v-model="domain"> | ||||
<option v-for="_domain in domains" :key="_domain" :value="_domain">{{ _domain }}</option> | <option v-for="_domain in domains" :key="_domain" :value="_domain">{{ _domain }}</option> | ||||
</select> | </select> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
<password-input class="mb-3" v-model="pass"></password-input> | |||||
<div class="mb-3"> | <div class="mb-3"> | ||||
<label for="signup_password" class="visually-hidden">{{ $t('form.password') }}</label> | |||||
<input type="password" class="form-control" id="signup_password" :placeholder="$t('form.password')" required v-model="password"> | |||||
</div> | |||||
<div class="mb-3"> | |||||
<label for="signup_confirm" class="visually-hidden">{{ $t('form.password-confirm') }}</label> | |||||
<input type="password" class="form-control" id="signup_confirm" :placeholder="$t('form.password-confirm')" required v-model="password_confirmation"> | |||||
</div> | |||||
<div class="mb-3 pt-2"> | |||||
<label for="signup_voucher" class="visually-hidden">{{ $t('signup.voucher') }}</label> | <label for="signup_voucher" class="visually-hidden">{{ $t('signup.voucher') }}</label> | ||||
<input type="text" class="form-control" id="signup_voucher" :placeholder="$t('signup.voucher')" v-model="voucher"> | <input type="text" class="form-control" id="signup_voucher" :placeholder="$t('signup.voucher')" v-model="voucher"> | ||||
</div> | </div> | ||||
<button v-if="!invitation" class="btn btn-secondary me-2" type="button" @click="stepBack">{{ $t('btn.back') }}</button> | <button v-if="!invitation" class="btn btn-secondary me-2" type="button" @click="stepBack">{{ $t('btn.back') }}</button> | ||||
<button class="btn btn-primary" type="submit"> | <button class="btn btn-primary" type="submit"> | ||||
<svg-icon icon="check"></svg-icon> <span v-if="invitation">{{ $t('btn.signup') }}</span><span v-else>{{ $t('btn.submit') }}</span> | <svg-icon icon="check"></svg-icon> <span v-if="invitation">{{ $t('btn.signup') }}</span><span v-else>{{ $t('btn.submit') }}</span> | ||||
</button> | </button> | ||||
</form> | </form> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<script> | <script> | ||||
import PasswordInput from './Widgets/PasswordInput' | |||||
export default { | export default { | ||||
components: { | |||||
PasswordInput | |||||
}, | |||||
data() { | data() { | ||||
return { | return { | ||||
email: '', | email: '', | ||||
first_name: '', | first_name: '', | ||||
last_name: '', | last_name: '', | ||||
code: '', | code: '', | ||||
short_code: '', | short_code: '', | ||||
login: '', | login: '', | ||||
password: '', | pass: {}, | ||||
password_confirmation: '', | |||||
domain: '', | domain: '', | ||||
domains: [], | domains: [], | ||||
invitation: null, | invitation: null, | ||||
is_domain: false, | is_domain: false, | ||||
plan: null, | plan: null, | ||||
plan_icons: { | plan_icons: { | ||||
individual: 'user', | individual: 'user', | ||||
group: 'users' | group: 'users' | ||||
▲ Show 20 Lines • Show All 112 Lines • ▼ Show 20 Lines | export default { | ||||
}, | }, | ||||
// Submits the data to the API to create the user account | // Submits the data to the API to create the user account | ||||
submitStep3() { | submitStep3() { | ||||
this.$root.clearFormValidation($('#step3 form')) | this.$root.clearFormValidation($('#step3 form')) | ||||
let post = { | let post = { | ||||
login: this.login, | login: this.login, | ||||
domain: this.domain, | domain: this.domain, | ||||
password: this.password, | password: this.pass.password, | ||||
password_confirmation: this.password_confirmation, | password_confirmation: this.pass.password_confirmation, | ||||
voucher: this.voucher | voucher: this.voucher | ||||
} | } | ||||
if (this.invitation) { | if (this.invitation) { | ||||
post.invitation = this.invitation.id | post.invitation = this.invitation.id | ||||
post.plan = this.plan | post.plan = this.plan | ||||
post.first_name = this.first_name | post.first_name = this.first_name | ||||
post.last_name = this.last_name | post.last_name = this.last_name | ||||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |