|
@@ -13,17 +13,21 @@ function tplFormRequest(el) {
|
|
const default_domain = api.settings.get('registration_domain');
|
|
const default_domain = api.settings.get('registration_domain');
|
|
const i18n_cancel = __('Cancel');
|
|
const i18n_cancel = __('Cancel');
|
|
return html`
|
|
return html`
|
|
- <form id="converse-register" class="converse-form no-scrolling" @submit=${ev => el.onFormSubmission(ev)}>
|
|
|
|
|
|
+ <form id="converse-register" class="converse-form no-scrolling" @submit=${(ev) => el.onFormSubmission(ev)}>
|
|
${tplSpinner({ 'classes': 'hor_centered' })}
|
|
${tplSpinner({ 'classes': 'hor_centered' })}
|
|
${default_domain
|
|
${default_domain
|
|
? ''
|
|
? ''
|
|
: html`
|
|
: html`
|
|
- <button class="btn btn-secondary button-cancel hor_centered"
|
|
|
|
- @click=${ev => el.renderProviderChoiceForm(ev)}>${i18n_cancel}</button>
|
|
|
|
|
|
+ <button
|
|
|
|
+ class="btn btn-secondary button-cancel hor_centered"
|
|
|
|
+ @click=${(ev) => el.renderProviderChoiceForm(ev)}
|
|
|
|
+ >
|
|
|
|
+ ${i18n_cancel}
|
|
|
|
+ </button>
|
|
`}
|
|
`}
|
|
</form>
|
|
</form>
|
|
`;
|
|
`;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param {import('../form.js').default} el
|
|
* @param {import('../form.js').default} el
|
|
@@ -34,9 +38,11 @@ function tplDomainInput(el) {
|
|
const i18n_providers_link = __('here');
|
|
const i18n_providers_link = __('here');
|
|
const href_providers = api.settings.get('providers_link');
|
|
const href_providers = api.settings.get('providers_link');
|
|
return html`
|
|
return html`
|
|
- <input class="form-control"
|
|
|
|
|
|
+ <input
|
|
|
|
+ class="form-control"
|
|
required="required"
|
|
required="required"
|
|
- type="text" name="domain"
|
|
|
|
|
|
+ type="text"
|
|
|
|
+ name="domain"
|
|
placeholder="${domain_placeholder}"
|
|
placeholder="${domain_placeholder}"
|
|
value="${el.domain}"
|
|
value="${el.domain}"
|
|
/>
|
|
/>
|
|
@@ -46,7 +52,7 @@ function tplDomainInput(el) {
|
|
</p>
|
|
</p>
|
|
${api.settings.get('show_connection_url_input') ? tplConnectionURLInput() : ''}
|
|
${api.settings.get('show_connection_url_input') ? tplConnectionURLInput() : ''}
|
|
`;
|
|
`;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
function tplFetchFormButtons() {
|
|
function tplFetchFormButtons() {
|
|
const i18n_register = __('Fetch registration form');
|
|
const i18n_register = __('Fetch registration form');
|
|
@@ -61,7 +67,7 @@ function tplFetchFormButtons() {
|
|
<a class="login-here toggle-register-login" href="#converse/login">${i18n_login}</a>
|
|
<a class="login-here toggle-register-login" href="#converse/login">${i18n_login}</a>
|
|
</div>
|
|
</div>
|
|
`;
|
|
`;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
/**
|
|
/**
|
|
* @param {import('../form.js').default} el
|
|
* @param {import('../form.js').default} el
|
|
@@ -73,16 +79,16 @@ function tplChooseProvider(el) {
|
|
const show_form_buttons = !default_domain && el.status === CHOOSE_PROVIDER;
|
|
const show_form_buttons = !default_domain && el.status === CHOOSE_PROVIDER;
|
|
|
|
|
|
return html`
|
|
return html`
|
|
- <form id="converse-register" class="converse-form" @submit=${ev => el.onFormSubmission(ev)}>
|
|
|
|
|
|
+ <form id="converse-register" class="converse-form" @submit=${(ev) => el.onFormSubmission(ev)}>
|
|
<legend class="col-form-label">${i18n_create_account}</legend>
|
|
<legend class="col-form-label">${i18n_create_account}</legend>
|
|
- <div>
|
|
|
|
|
|
+ <div class="pt-3">
|
|
<label class="form-label">${i18n_choose_provider}</label>
|
|
<label class="form-label">${i18n_choose_provider}</label>
|
|
${default_domain ? default_domain : tplDomainInput(el)}
|
|
${default_domain ? default_domain : tplDomainInput(el)}
|
|
</div>
|
|
</div>
|
|
${show_form_buttons ? tplFetchFormButtons() : ''}
|
|
${show_form_buttons ? tplFetchFormButtons() : ''}
|
|
</form>
|
|
</form>
|
|
`;
|
|
`;
|
|
-};
|
|
|
|
|
|
+}
|
|
|
|
|
|
const CHOOSE_PROVIDER = 0;
|
|
const CHOOSE_PROVIDER = 0;
|
|
const FETCHING_FORM = 1;
|
|
const FETCHING_FORM = 1;
|
|
@@ -94,11 +100,12 @@ const REGISTRATION_FORM_ERROR = 3;
|
|
*/
|
|
*/
|
|
export default (el) => {
|
|
export default (el) => {
|
|
return html`
|
|
return html`
|
|
- <converse-brand-logo></converse-brand-logo>
|
|
|
|
- ${ el.alert_message ? html`<div class="alert alert-${el.alert_type}" role="alert">${el.alert_message}</div>` : '' }
|
|
|
|
|
|
+ ${el.alert_message
|
|
|
|
+ ? html`<div class="alert alert-${el.alert_type}" role="alert">${el.alert_message}</div>`
|
|
|
|
+ : ''}
|
|
${el.status === CHOOSE_PROVIDER ? tplChooseProvider(el) : ''}
|
|
${el.status === CHOOSE_PROVIDER ? tplChooseProvider(el) : ''}
|
|
${el.status === FETCHING_FORM ? tplFormRequest(el) : ''}
|
|
${el.status === FETCHING_FORM ? tplFormRequest(el) : ''}
|
|
${el.status === REGISTRATION_FORM ? tplRegistrationForm(el) : ''}
|
|
${el.status === REGISTRATION_FORM ? tplRegistrationForm(el) : ''}
|
|
- ${el.status === REGISTRATION_FORM_ERROR ? tplSwitchForm() : '' }
|
|
|
|
|
|
+ ${el.status === REGISTRATION_FORM_ERROR ? tplSwitchForm() : ''}
|
|
`;
|
|
`;
|
|
};
|
|
};
|