From f8f4ddcc858404d1218c0ed475d61fc9866530b6 Mon Sep 17 00:00:00 2001 From: Khanh Ngo Date: Sun, 19 Aug 2018 22:08:14 +0700 Subject: [PATCH] Add validation for authentication setting form --- app/assets.py | 6 + .../admin_setting_authentication.html | 219 +++++++++++++++--- app/views.py | 45 ++-- package.json | 1 + yarn.lock | 4 + 5 files changed, 233 insertions(+), 42 deletions(-) diff --git a/app/assets.py b/app/assets.py index e6f93b4..06cfa37 100644 --- a/app/assets.py +++ b/app/assets.py @@ -28,6 +28,11 @@ js_login = Bundle( output='generated/login.js' ) +js_validation = Bundle( + 'node_modules/bootstrap-validator/dist/validator.js', + output='generated/validation.js' +) + css_main = Bundle( 'node_modules/bootstrap/dist/css/bootstrap.css', 'node_modules/font-awesome/css/font-awesome.css', @@ -62,6 +67,7 @@ js_main = Bundle( assets = Environment() assets.register('js_login', js_login) +assets.register('js_validation', js_validation) assets.register('css_login', css_login) assets.register('js_main', js_main) assets.register('css_main', css_main) diff --git a/app/templates/admin_setting_authentication.html b/app/templates/admin_setting_authentication.html index 34dbe81..6942e5c 100644 --- a/app/templates/admin_setting_authentication.html +++ b/app/templates/admin_setting_authentication.html @@ -24,6 +24,12 @@

Authentication Settings

+ {% if result %} +
+ + {{ result['msg'] }} +
+ {% endif %}