Added some form elements + autocomplete attributes

This commit is contained in:
emeric
2020-06-23 14:41:38 +02:00
parent a293273940
commit 2ca3e6a237
9 changed files with 309 additions and 283 deletions
+4 -1
View File
@@ -181,12 +181,15 @@ Auth::Auth()
};
// LoginName
setFormWidget(AuthModel::LoginNameField, std::make_unique<Wt::WLineEdit>());
auto loginName {std::make_unique<Wt::WLineEdit>()};
loginName->setAttributeValue("autocomplete", "username");
setFormWidget(AuthModel::LoginNameField, std::move(loginName));
// Password
auto password = std::make_unique<Wt::WLineEdit>();
password->setEchoMode(Wt::EchoMode::Password);
password->enterPressed().connect(this, processAuth);
password->setAttributeValue("autocomplete", "current-password");
setFormWidget(AuthModel::PasswordField, std::move(password));
// Remember me
+3
View File
@@ -387,17 +387,20 @@ SettingsView::refreshView()
auto oldPassword {std::make_unique<Wt::WLineEdit>()};
oldPassword->setEchoMode(Wt::EchoMode::Password);
oldPassword->setAttributeValue("autocomplete", "current-password");
t->setFormWidget(SettingsModel::PasswordOldField, std::move(oldPassword));
}
// Password
auto password {std::make_unique<Wt::WLineEdit>()};
password->setEchoMode(Wt::EchoMode::Password);
password->setAttributeValue("autocomplete", "new-password");
t->setFormWidget(SettingsModel::PasswordField, std::move(password));
// Password confirm
auto passwordConfirm {std::make_unique<Wt::WLineEdit>()};
passwordConfirm->setEchoMode(Wt::EchoMode::Password);
passwordConfirm->setAttributeValue("autocomplete", "new-password");
t->setFormWidget(SettingsModel::PasswordConfirmField, std::move(passwordConfirm));
// Audio
+17 -7
View File
@@ -113,17 +113,27 @@ InitWizardView::InitWizardView()
auto model = std::make_shared<InitWizardModel>();
// AdminLogin
setFormWidget(InitWizardModel::AdminLoginField, std::make_unique<Wt::WLineEdit>());
{
auto adminLogin {std::make_unique<Wt::WLineEdit>()};
adminLogin->setAttributeValue("autocomplete", "username");
setFormWidget(InitWizardModel::AdminLoginField, std::move(adminLogin));
}
// Password
auto passwordEdit = std::make_unique<Wt::WLineEdit>();
passwordEdit->setEchoMode(Wt::EchoMode::Password);
setFormWidget(InitWizardModel::PasswordField, std::move(passwordEdit) );
{
auto passwordEdit = std::make_unique<Wt::WLineEdit>();
passwordEdit->setEchoMode(Wt::EchoMode::Password);
passwordEdit->setAttributeValue("autocomplete", "current-password");
setFormWidget(InitWizardModel::PasswordField, std::move(passwordEdit) );
}
// Password confirmation
auto passwordConfirmEdit = std::make_unique<Wt::WLineEdit>();
passwordConfirmEdit->setEchoMode(Wt::EchoMode::Password);
setFormWidget(InitWizardModel::PasswordConfirmField, std::move(passwordConfirmEdit));
{
auto passwordConfirmEdit = std::make_unique<Wt::WLineEdit>();
passwordConfirmEdit->setEchoMode(Wt::EchoMode::Password);
passwordConfirmEdit->setAttributeValue("autocomplete", "current-password");
setFormWidget(InitWizardModel::PasswordConfirmField, std::move(passwordConfirmEdit));
}
Wt::WPushButton* saveButton = bindNew<Wt::WPushButton>("create-btn", Wt::WString::tr("Lms.create"));
saveButton->clicked().connect([=]
+1
View File
@@ -227,6 +227,7 @@ UserView::refreshView()
// Password
auto passwordEdit = std::make_unique<Wt::WLineEdit>();
passwordEdit->setEchoMode(Wt::EchoMode::Password);
passwordEdit->setAttributeValue("autocomplete", "off");
t->setFormWidget(UserModel::PasswordField, std::move(passwordEdit));
// Demo account