From 485f675ba36e12ed64be018e91d59cb0fde96095 Mon Sep 17 00:00:00 2001 From: Awilum Date: Thu, 30 Jan 2020 00:26:46 +0300 Subject: [PATCH] feat(admin-plugin): update form validation for api's #211 --- .../templates/system/api/delivery/add.html | 18 +++++++++--- .../templates/system/api/delivery/edit.html | 29 ++++--------------- 2 files changed, 20 insertions(+), 27 deletions(-) diff --git a/site/plugins/admin/templates/system/api/delivery/add.html b/site/plugins/admin/templates/system/api/delivery/add.html index cc9abe61..7023739f 100644 --- a/site/plugins/admin/templates/system/api/delivery/add.html +++ b/site/plugins/admin/templates/system/api/delivery/add.html @@ -1,24 +1,34 @@ {% extends "plugins/admin/templates/partials/base.html" %} {% block content %} -
+ {{ csrf() }}
- + {{ tr('admin_help_text_for_tokens_label') }}
- + {{ tr('admin_help_text_for_api_calls_limit_label') }}
- + {{ tr('admin_help_text_for_api_token_icon', {':link': 'fontawesome'})|raw }}
diff --git a/site/plugins/admin/templates/system/api/delivery/edit.html b/site/plugins/admin/templates/system/api/delivery/edit.html index 7ccf6b84..bea0a953 100644 --- a/site/plugins/admin/templates/system/api/delivery/edit.html +++ b/site/plugins/admin/templates/system/api/delivery/edit.html @@ -13,16 +13,7 @@
- + {{ tr('admin_help_text_for_tokens_label') }}
@@ -34,23 +25,15 @@ value="{{ api_token_data.limit_calls }}" class="form-control" required="required" - data-validation="length required" - data-validation-length="min1" - data-validation-error-msg="{{ tr('admin_error_api_calls_empty_input') }}"> + data-parsley-required="true" + data-parsley-minlength="1" + data-parsley-type="integer" + data-parsley-error-message="{{ tr('admin_error_api_calls_empty_input') }}"> {{ tr('admin_help_text_for_api_calls_limit_label') }}
- + {{ tr('admin_help_text_for_api_token_icon', {':link': 'fontawesome'})|raw }}