| [7bc636b] | 1 | <div class="container auth-page">
|
|---|
| [24cdcc6] | 2 | <h1><%= t('setup.title') %></h1>
|
|---|
| 3 | <p class="auth-intro"><%= t('setup.intro') %></p>
|
|---|
| 4 |
|
|---|
| 5 | <div class="setup-lang" style="display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:0 0 20px">
|
|---|
| 6 | <span style="opacity:.7;font-size:.9rem"><%= t('setup.lang_label') %>:</span>
|
|---|
| 7 | <% (typeof langs !== 'undefined' ? langs : []).forEach(function(L){ %>
|
|---|
| 8 | <a href="/lang/<%= L.code %>?r=/auth/register"
|
|---|
| 9 | style="padding:5px 13px;border-radius:8px;text-decoration:none;font-weight:600;font-size:.9rem;border:1px solid <%= L.active ? 'var(--accent)' : 'var(--rule, #2b3140)' %>;color:<%= L.active ? 'var(--accent)' : 'inherit' %>"><%= L.name %></a>
|
|---|
| 10 | <% }) %>
|
|---|
| 11 | </div>
|
|---|
| 12 |
|
|---|
| [7bc636b] | 13 | <% if (error) { %><div class="alert alert-error"><%= error %></div><% } %>
|
|---|
| 14 | <form method="post" action="/auth/register" class="auth-form">
|
|---|
| 15 | <% if (typeof next !== 'undefined' && next) { %>
|
|---|
| 16 | <input type="hidden" name="next" value="<%= next %>">
|
|---|
| 17 | <% } %>
|
|---|
| [24cdcc6] | 18 | <label>
|
|---|
| 19 | <span><%= t('setup.f_sitename') %></span>
|
|---|
| 20 | <input type="text" name="siteName" value="<%= typeof siteName !== 'undefined' ? siteName : '' %>" required autofocus maxlength="80" placeholder="<%= t('setup.sitename_ph') %>">
|
|---|
| 21 | </label>
|
|---|
| [7bc636b] | 22 | <label>
|
|---|
| [137cca5] | 23 | <span><%= t('auth.f_username') %></span>
|
|---|
| [923235e] | 24 | <input type="text" id="setup-username" name="username" value="<%= username %>" required autocomplete="username" pattern="[a-zA-Z0-9_-]{3,32}">
|
|---|
| 25 | <small class="setup-handle-hint"><%= t('setup.username_note') %> <code id="setup-handle">@username@…</code></small>
|
|---|
| [7bc636b] | 26 | </label>
|
|---|
| 27 | <label>
|
|---|
| [137cca5] | 28 | <span><%= t('auth.f_email') %></span>
|
|---|
| [7bc636b] | 29 | <input type="email" name="email" value="<%= email %>" required autocomplete="email">
|
|---|
| 30 | </label>
|
|---|
| 31 | <label>
|
|---|
| [137cca5] | 32 | <span><%= t('auth.f_password') %></span>
|
|---|
| [7bc636b] | 33 | <input type="password" name="password" required minlength="8" autocomplete="new-password">
|
|---|
| 34 | </label>
|
|---|
| [24cdcc6] | 35 | <button type="submit" class="btn btn-primary"><%= t('setup.submit') %></button>
|
|---|
| [7bc636b] | 36 | </form>
|
|---|
| 37 | </div>
|
|---|
| [923235e] | 38 |
|
|---|
| 39 | <style>
|
|---|
| 40 | .setup-handle-hint { display: block; margin-top: .35rem; font-size: .82rem; line-height: 1.4; color: var(--ink-soft, #888); }
|
|---|
| 41 | .setup-handle-hint code { color: var(--accent); font-weight: 600; background: color-mix(in srgb, var(--accent) 12%, transparent); padding: .05rem .35rem; border-radius: 6px; white-space: nowrap; }
|
|---|
| 42 | </style>
|
|---|
| 43 | <script>
|
|---|
| 44 | (function () {
|
|---|
| 45 | var u = document.getElementById('setup-username'), out = document.getElementById('setup-handle');
|
|---|
| 46 | if (!u || !out) return;
|
|---|
| 47 | function upd() {
|
|---|
| 48 | var v = (u.value || '').toLowerCase().replace(/[^a-z0-9_-]/g, '') || 'username';
|
|---|
| 49 | out.textContent = '@' + v + '@' + location.host;
|
|---|
| 50 | }
|
|---|
| 51 | u.addEventListener('input', upd);
|
|---|
| 52 | upd();
|
|---|
| 53 | })();
|
|---|
| 54 | </script>
|
|---|