WIP. Added Account and Audio forms

This commit is contained in:
emeric
2014-08-01 00:05:44 +02:00
parent 1f41f7f481
commit 1cdb69e4eb
18 changed files with 830 additions and 160 deletions
-10
View File
@@ -1,10 +0,0 @@
#include <Wt/WRegExpValidator>
namespace UserInterface {
static inline Wt::WValidator *createEmailValidator()
{
return new Wt::WRegExpValidator("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}");
}
} // namespace UserInterface
+23
View File
@@ -0,0 +1,23 @@
#include <Wt/WRegExpValidator>
#include <Wt/WLengthValidator>
#include "database/User.hpp"
namespace UserInterface {
static inline Wt::WValidator *createEmailValidator()
{
Wt::WValidator *res = new Wt::WRegExpValidator("[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}");
res->setMandatory(true);
return res;
}
static inline Wt::WValidator *createNameValidator() {
Wt::WLengthValidator *v = new Wt::WLengthValidator();
v->setMandatory(true);
v->setMinimumLength(3);
v->setMaximumLength(::Database::User::MaxNameLength);
return v;
}
} // namespace UserInterface