1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 10:51:21 +02:00

feat(admin-plugin): update validation for all forms #211

This commit is contained in:
Awilum
2020-02-05 18:25:50 +03:00
parent bdd0e701e2
commit d9f4eb214f
7 changed files with 20 additions and 18 deletions

View File

@@ -9,19 +9,21 @@
<input type="hidden" id="fieldset" name="fieldset" value="{{ type }}">
<div class="form-group">
<label for="title">{{ tr('admin_title') }}</label>
<input type="text" id="title" name="title" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_title_empty_input') }}">
<label for="title" class="form-control-title">{{ tr('admin_title') }}</label>
<input type="text" id="title" name="title" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_title_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_entry_label') }}</small>
</div>
<div class="form-group">
<label for="id">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_entry_name') }}</small>
</div>
<div class="flex row">
<div class="col w-full lg:w-6/12">
<div class="form-group">
<label>{{ tr('admin_routable') }}</label>
<label class="form-control-title">{{ tr('admin_routable') }}</label>
<select class="form-control js-select" name="routable">
<option value="1" selected="selected">{{ tr('admin_yes') }}</option>
<option value="0">{{ tr('admin_no') }}</option>
@@ -30,7 +32,7 @@
</div>
<div class="col w-full lg:w-6/12">
<div class="form-group">
<label>{{ tr('admin_visibility') }}</label>
<label class="form-control-title">{{ tr('admin_visibility') }}</label>
<select class="form-control js-select" name="visibility">
<option value="visible" selected="selected">{{ tr('admin_visible') }}</option>
<option value="hidden">{{ tr('admin_hidden') }}</option>

View File

@@ -7,19 +7,19 @@
<div class="col w-full lg:w-4/12">
<div class="form-group">
<label for="title" class="form-control-title">{{ tr('admin_title') }}</label>
<input type="text" id="title" name="title" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_title_empty_input') }}">
<input type="text" id="title" name="title" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_title_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_fieldsets_label') }}</small>
</div>
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_fieldsets_name') }}</small>
</div>
<div class="flex row">
<div class="col w-full lg:w-6/12">
<div class="form-group">
<label for="icon" class="form-control-title">{{ tr('admin_icon') }}</label>
<input type="text" id="fieldsetIcon" name="icon" value="far fa-file-alt" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_icon_empty_input') }}">
<input type="text" id="fieldsetIcon" name="icon" value="far fa-file-alt" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_icon_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_fieldsets_icon', {':link': '<a href="https://fontawesome.com/icons?d=gallery&m=free" target="_blank">fontawesome</a>'})|raw }}</small>
</div>
</div>
@@ -46,4 +46,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}

View File

@@ -4,11 +4,11 @@
<form method="post" id="form">
{{ csrf() }}
<input type="hidden" id="fieldset-id-current-{{ id }}" name="fieldset-id-current" value="{{ id }}">
<div class="flex row">
<div class="col w-full lg:w-4/12">
<div class="flex row">
<div class="col w-full lg:w-4/12">
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="{{ id }}" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<input type="text" id="id" name="id" value="{{ id }}" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_fieldsets_name') }}</small>
</div>
<div class="button-group">
@@ -17,4 +17,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}

View File

@@ -7,7 +7,7 @@
<div class="col w-full lg:w-4/12">
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_snippets_name') }}</small>
</div>
<div class="button-group">

View File

@@ -8,7 +8,7 @@
<div class="col w-full lg:w-3/12">
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="{{ id_current }}" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<input type="text" id="id" name="id" value="{{ id_current }}" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_snippets_name') }}</small>
</div>
<div class="button-group">

View File

@@ -8,7 +8,7 @@
<div class="w-full lg:w-4/12">
<div class="form-group">
<label for="id" class="form-control-title">{{ tr('admin_name') }}</label>
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-validation="length required" data-validation-length="min1" data-validation-error-msg="{{ tr('admin_error_name_empty_input') }}">
<input type="text" id="id" name="id" value="" class="form-control" required="required" data-parsley-minlength="1" data-parsley-error-message="{{ tr('admin_error_name_empty_input') }}" data-parsley-required="true">
<small>{{ tr('admin_help_text_for_temlates_name') }}</small>
</div>
<div class="form-group">

View File

@@ -44,4 +44,4 @@
</div>
</div>
</form>
{% endblock %}
{% endblock %}