CommunitySolidServer/templates/setup/input-partial.html.ejs
2022-09-26 11:57:42 +02:00

80 lines
2.6 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1>Set up your Solid server</h1>
<p>
Your Solid server needs a <strong>one-time setup</strong>
so it acts exactly the way you want.
</p>
<form method="post" id="mainForm">
<p class="error" id="error"></p>
<fieldset>
<legend>Accounts on this server</legend>
<ol>
<li class="checkbox">
<label>
<input type="checkbox" <% if (!allowRootPod) { %> checked <% } %> disabled>
Enable account registration.
</label>
<p>
This can only be changed in the configuration.
See the <a href="https://github.com/CommunitySolidServer/CommunitySolidServer/blob/main/config/README.md">general configuration documentation</a>
and the <a href="https://github.com/CommunitySolidServer/CommunitySolidServer/blob/main/config/identity/README.md">identity specific options</a> to find out how.
</p>
</li>
<li class="checkbox">
<label>
<input type="checkbox" id="registration" name="registration">
Sign me up for an account.
</label>
<p>
Any existing root Pod will be disabled.
</p>
</li>
<li class="checkbox" id="initializeForm">
<label>
<input type="checkbox" id="initialize" name="initialize" <% if (!allowRootPod) { %> disabled <% } %>>
Expose a public root Pod.
</label>
<p>
By default, the public has read and write access to the root Pod.
<br>
You typically only want to choose this
for rapid testing and development.
<br>
This requires registration to be disabled.
</p>
</li>
</ol>
</fieldset>
<fieldset id="registrationForm">
<legend>Sign up</legend>
<%-
include('../identity/email-password/register-partial.html.ejs', {
allowRootPod: allowRootPod,
})
%>
</fieldset>
<p class="actions"><button type="submit">Complete setup</button></p>
</form>
<!-- Show or hide the account creation form when needed -->
<script>
[
'registration', 'registrationForm', 'initializeForm',
].forEach(registerElement);
Object.assign(visibilityConditions, {
registrationForm: () => elements.registration.checked,
});
// Assigning elements to `visibilityConditions` causes the `disabled` to be removed.
// We don't want this for the initialize form.
const registration = document.getElementById('registration');
registration.addEventListener('change', () => {
const initializeForm = document.getElementById('initializeForm');
initializeForm.classList[elements.registration.checked ? 'add' : 'remove']('hidden');
});
</script>