From c868441d615e78402bd6b258941305ac52b78a23 Mon Sep 17 00:00:00 2001 From: sxw Date: Wed, 5 Aug 2015 19:40:02 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=9C=A8=E7=94=A8=E6=88=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=B7=BB=E5=8A=A0=E4=BA=86email=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=EF=BC=8C=E5=B9=B6=E9=99=84=E5=B8=A6=E9=AA=8C=E8=AF=81?= =?UTF-8?q?;=202.=E7=BB=9F=E4=B8=80=E4=BA=86username=E5=92=8Cemail?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=9A=84=E5=94=AF=E4=B8=80=E6=80=A7=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E6=96=B9=E6=B3=95=E3=80=82=20[ci=20skip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/src/js/app/oj/account/register.js | 22 ++++++++++++++++++++-- template/oj/account/register.html | 4 ++++ 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/static/src/js/app/oj/account/register.js b/static/src/js/app/oj/account/register.js index e6b4deb..b9d3468 100644 --- a/static/src/js/app/oj/account/register.js +++ b/static/src/js/app/oj/account/register.js @@ -2,6 +2,11 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf $("#register-form") .formValidation({ framework: "bootstrap", + icon: { + valid: 'glyphicon glyphicon-ok', + invalid: 'glyphicon glyphicon-remove', + validating: 'glyphicon glyphicon-refresh' + }, fields: { username: { validators: { @@ -50,6 +55,21 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf message: "两次输入的密码必须一致" } } + }, + email: { + validators: { + notEmpty: { + message: "请填写电子邮箱邮箱地址" + }, + emailAddress: { + message: "请填写有效的邮箱地址" + }, + remoteCSRF: { + message: "您已经注册过了", + url: "/api/email_check/", + field: 'email' + } + } } } } @@ -72,8 +92,6 @@ require(["jquery", "bs_alert", "csrf", "validation"], function($, bs_alert, csrf bs_alert(data.data); } } - }) }); - }); \ No newline at end of file diff --git a/template/oj/account/register.html b/template/oj/account/register.html index a93014c..34dc9a4 100644 --- a/template/oj/account/register.html +++ b/template/oj/account/register.html @@ -14,6 +14,10 @@ +
+ + +