optmise register style.
Some checks failed
Deploy / Build (push) Failing after 15s

This commit is contained in:
amass 2025-01-02 17:16:52 +08:00
parent 4b90a75a51
commit 13c80a51eb
2 changed files with 50 additions and 46 deletions

View File

@ -85,11 +85,15 @@ void Application::authEvent() {
LOG(info) << "User " << u.id() << " (" << u.identity(Wt::Auth::Identity::LoginName) << ")"
<< " logged in.";
if (m_loginPage) {
if (m_navigationBar != nullptr) {
m_loginPageRef = m_navigationBar->addLoginItem(std::move(m_loginPage));
}
} else if (m_loginPageRef != nullptr && m_loginPageRef->parent() == m_root) {
m_loginPage = m_loginPageRef->parent()->removeWidget(m_loginPageRef);
if (m_navigationBar != nullptr) {
m_loginPageRef = m_navigationBar->addLoginItem(std::move(m_loginPage));
}
}
setInternalPath("/", true);
auto app = Amass::Singleton<WebToolkit::Server>::instance();
auto &service = app->authService();

View File

@ -80,13 +80,13 @@
<message id="Wt.Auth.template.registration">
<div class="Wt-form Wt-auth-registration">
<h2>${tr:Wt.Auth.registration-form-title}</h2>
<p>${tr:Wt.Auth.registration-form-info}</p>
<h2 class="is-hidden">${tr:Wt.Auth.registration-form-title}</h2>
<p class="is-hidden">${tr:Wt.Auth.registration-form-info}</p>
${password-description}
<div class="Wt-fields">
${<if:user-name>}
<div class="bulma-field">
<label for="${id:user-name}" class="bulma-label">
${user-name-label}
</label>
@ -99,12 +99,12 @@
</div>
${user-name-info class="Wt-info bulma-help"}
${confirm-is-you class="Wt-info bulma-help"}
</div>
${</if:user-name>}
${<if:choose-password>}
<div class="bulma-field">
<label for="${id:choose-password}">${tr:Wt.Auth.choose-password}
${choose-password-info class="Wt-info"}
</label>
<div class="bulma-control bulma-has-icons-left">
@ -113,13 +113,13 @@
<i class="fa-solid fa-lock"></i>
</span>
</div>
${choose-password-info class="Wt-info bulma-help"}
</div>
${</if:choose-password>}
${<if:repeat-password>}
<div>
<div class="bulma-field">
<label for="${id:repeat-password}">${tr:Wt.Auth.repeat-password}
${repeat-password-info class="Wt-info"}
</label>
<div class="bulma-control bulma-has-icons-left">
${repeat-password class="bulma-input"}
@ -127,13 +127,13 @@
<i class="fa-solid fa-lock"></i>
</span>
</div>
${repeat-password-info class="Wt-info bulma-help"}
</div>
${</if:repeat-password>}
${<if:email>}
<div>
<div class="bulma-field">
<label for="${id:email}">${tr:Wt.Auth.email}
${email-info class="Wt-info"}
</label>
<div class="bulma-control bulma-has-icons-left">
${email class="bulma-input"}
@ -141,9 +141,9 @@
<i class="fa-solid fa-envelope"></i>
</span>
</div>
${email-info class="Wt-info bulma-help"}
</div>
${</if:email>}
</div>
${<if:oauth>}
<br clear="both" />
@ -154,8 +154,8 @@
${icons}
${</if:oauth>}
<div class="Wt-buttons">
${ok-button} ${cancel-button}
<div class="bulma-field bulma-is-grouped bulma-is-grouped-right">
${ok-button class="bulma-is-primary"} ${cancel-button class="bulma-is-light"}
</div>
</div>
</message>