xmpp.chapril.org-conversejs/src/plugins/register/templates/registration_form.js

44 lines
1.7 KiB
JavaScript
Raw Normal View History

2020-12-28 17:48:25 +01:00
import { __ } from 'i18n';
import { api } from '@converse/headless/core';
import { html } from 'lit';
2020-12-28 17:48:25 +01:00
export default o => {
2020-12-28 17:48:25 +01:00
const i18n_choose_provider = __('Choose a different provider');
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');
const registration_domain = api.settings.get('registration_domain');
2020-12-28 17:48:25 +01:00
return html`
<form id="converse-register" class="converse-form">
<legend class="col-form-label">${i18n_legend} ${o.domain}</legend>
<p class="title">${o.title}</p>
<p class="form-help instructions">${o.instructions}</p>
<div class="form-errors hidden"></div>
${o.form_fields}
2020-12-28 17:48:25 +01:00
<fieldset class="buttons form-group">
${o.fields
? 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}"
/>
`}
<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>
`;
};