2020-12-28 17:48:25 +01:00
|
|
|
import { __ } from 'i18n';
|
2020-12-29 10:52:02 +01:00
|
|
|
import { api } from '@converse/headless/core';
|
2021-04-14 22:56:59 +02:00
|
|
|
import { html } from 'lit';
|
2020-12-28 17:48:25 +01:00
|
|
|
|
2023-02-16 22:10:14 +01:00
|
|
|
export default (el) => {
|
2020-12-28 17:48:25 +01:00
|
|
|
const i18n_choose_provider = __('Choose a different provider');
|
2020-12-29 10:52:02 +01:00
|
|
|
const i18n_has_account = __('Already have a chat account?');
|
|
|
|
const i18n_legend = __('Account Registration:');
|
|
|
|
const i18n_login = __('Log in here');
|
2020-12-28 17:48:25 +01:00
|
|
|
const i18n_register = __('Register');
|
2020-12-29 10:52:02 +01:00
|
|
|
const registration_domain = api.settings.get('registration_domain');
|
2020-12-28 17:48:25 +01:00
|
|
|
|
|
|
|
return html`
|
2023-02-16 22:10:14 +01:00
|
|
|
<form id="converse-register" class="converse-form" @submit=${ev => el.onFormSubmission(ev)}>
|
|
|
|
<legend class="col-form-label">${i18n_legend} ${el.domain}</legend>
|
|
|
|
<p class="title">${el.title}</p>
|
|
|
|
<p class="form-help instructions">${el.instructions}</p>
|
2020-12-29 10:52:02 +01:00
|
|
|
<div class="form-errors hidden"></div>
|
2023-02-16 22:10:14 +01:00
|
|
|
${el.form_fields}
|
2020-12-28 17:48:25 +01:00
|
|
|
|
2020-12-29 10:52:02 +01:00
|
|
|
<fieldset class="buttons form-group">
|
2023-02-16 22:10:14 +01:00
|
|
|
${el.fields
|
2020-12-29 10:52:02 +01:00
|
|
|
? html`
|
|
|
|
<input type="submit" class="btn btn-primary" value="${i18n_register}" />
|
|
|
|
`
|
|
|
|
: ''}
|
|
|
|
${registration_domain
|
|
|
|
? ''
|
|
|
|
: html`
|
|
|
|
<input
|
|
|
|
type="button"
|
|
|
|
class="btn btn-secondary button-cancel"
|
|
|
|
value="${i18n_choose_provider}"
|
2023-02-16 22:10:14 +01:00
|
|
|
@click=${ev => el.renderProviderChoiceForm(ev)}
|
2020-12-29 10:52:02 +01:00
|
|
|
/>
|
|
|
|
`}
|
|
|
|
<div class="switch-form">
|
|
|
|
<p>${i18n_has_account}</p>
|
|
|
|
<p><a class="login-here toggle-register-login" href="#converse/login">${i18n_login}</a></p>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
`;
|
|
|
|
};
|