Skip to content
Snippets Groups Projects
Commit 696b7c50 authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

better error messages on validation

parent acf0c710
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ our %Lexicon = ( ...@@ -76,7 +76,7 @@ our %Lexicon = (
"Select the federation corresponding to the service you want to test:" => "Sélectionner la fédération correspondant au service à tester:", "Select the federation corresponding to the service you want to test:" => "Sélectionner la fédération correspondant au service à tester:",
"As part of the GÉANT 2020 Framework Partnership Agreement (FPA), this project receives funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 731122 (GN4-2)." => "En tant que membre de l'accord GÉANT 2020 Framework Partnership Agreement (FPA), ce projet bénéficie d'un financement du programme de recherche de l'Union Européenne Horizon 2020 sous l'agrément No. 731122 (GN4-2).", "As part of the GÉANT 2020 Framework Partnership Agreement (FPA), this project receives funding from the European Union’s Horizon 2020 research and innovation programme under Grant Agreement No. 731122 (GN4-2)." => "En tant que membre de l'accord GÉANT 2020 Framework Partnership Agreement (FPA), ce projet bénéficie d'un financement du programme de recherche de l'Union Européenne Horizon 2020 sous l'agrément No. 731122 (GN4-2).",
"Test another service" => "Tester un autre service", "Test another service" => "Tester un autre service",
"This field is required" => "Ce champ est requis", "This information is required" => "Cette information est nécessaire",
); );
1; 1;
...@@ -80,7 +80,7 @@ main form { ...@@ -80,7 +80,7 @@ main form {
.wizard > .content .custom-combobox { .wizard > .content .custom-combobox {
position: relative; position: relative;
display: inline-block; display: inline-block;
width: 90%; width: 95%;
} }
.wizard > .content .custom-combobox-toggle { .wizard > .content .custom-combobox-toggle {
position: absolute; position: absolute;
...@@ -92,7 +92,7 @@ main form { ...@@ -92,7 +92,7 @@ main form {
.wizard > .content .custom-combobox-input { .wizard > .content .custom-combobox-input {
margin: 0; margin: 0;
padding: 5px 10px; padding: 5px 10px;
width: 90%; width: 100%;
} }
.wizard > .content .ui-autocomplete { .wizard > .content .ui-autocomplete {
...@@ -101,6 +101,12 @@ main form { ...@@ -101,6 +101,12 @@ main form {
/* prevent horizontal scrollbar */ /* prevent horizontal scrollbar */
overflow-x: hidden; overflow-x: hidden;
} }
.wizard > .content label.error {
display: block;
color: #FFFFFF;
width: 100%;
background: #F04124;
}
.wizard > .actions { .wizard > .actions {
position: relative; position: relative;
display: block; display: block;
......
...@@ -15,12 +15,14 @@ ...@@ -15,12 +15,14 @@
[% lh.maketext("An email challenge including a validation token has been emailed to you at [_1].", email) %] [% lh.maketext("An email challenge including a validation token has been emailed to you at [_1].", email) %]
[% lh.maketext("Please copy and paste the validation token in the form below to proof that you are administrator of this service.") %] [% lh.maketext("Please copy and paste the validation token in the form below to proof that you are administrator of this service.") %]
</p> </p>
<label for="token">[% lh.maketext("Please provide the validation token here:") %]</label> <fieldset>
<br/> <legend>[% lh.maketext("Please provide the validation token here:") %]</legend>
<input name="token" value="" id="token" type="text" class="required error"/> <input name="token" value="" id="token" type="text" class="required"/>
<input type="hidden" name="federation" value="[% federation %]"/> <label for="token" class="error"></label>
<input type="hidden" name="entityid" value="[% entityid %]"/> <input type="hidden" name="federation" value="[% federation %]"/>
<input type="hidden" name="email" value="[% email %]"/> <input type="hidden" name="entityid" value="[% entityid %]"/>
<input type="hidden" name="email" value="[% email %]"/>
</fieldset>
</div> </div>
<div class="actions clearfix"> <div class="actions clearfix">
...@@ -31,7 +33,7 @@ ...@@ -31,7 +33,7 @@
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$.validator.messages.required = "[% lh.maketext("This field is required") %]"; $.validator.messages.required = "[% lh.maketext("This information is required") %]";
$("form").validate(); $("form").validate();
}); });
</script> </script>
......
...@@ -14,15 +14,18 @@ ...@@ -14,15 +14,18 @@
<p>[% lh.maketext("Before you can create test accounts at this Identity Provider, we need to ensure you are a legitimate administrator of '[_1]'.", sp.displayname) %]</p> <p>[% lh.maketext("Before you can create test accounts at this Identity Provider, we need to ensure you are a legitimate administrator of '[_1]'.", sp.displayname) %]</p>
[% IF sp.contacts.defined %] [% IF sp.contacts.defined %]
<p>[% lh.maketext("Select the email address where an email challenge can be sent to validate your identity:") %]</p> <fieldset>
<legend>[% lh.maketext("Select the email address where an email challenge can be sent to validate your identity:") %]</legend>
[% FOREACH email IN sp.contacts.sort %] [% FOREACH email IN sp.contacts.sort %]
<input id="[% email %]" name="email" value="[% email %]" type="radio" class="required"/> <input id="[% email %]" name="email" value="[% email %]" type="radio" class="required"/>
<label for="[% email %]">[% email %]</label> <label for="[% email %]">[% email %]</label>
<br/> <br/>
[% END %] [% END %]
<label for="email" class="error"></label>
<input type="hidden" name="federation" value="[% federation %]"/>
<input type="hidden" name="entityid" value="[% sp.entityid %]"/>
</fieldset>
<div class="callout primary">[% lh.maketext("Those email addresses have been extracted from your service metadata.") %]</div> <div class="callout primary">[% lh.maketext("Those email addresses have been extracted from your service metadata.") %]</div>
<input type="hidden" name="federation" value="[% federation %]"/>
<input type="hidden" name="entityid" value="[% sp.entityid %]"/>
[% ELSE %] [% ELSE %]
<p> <p>
[% lh.maketext("No ContactPerson element could be found in your service metadata, therefore we are unable to provide test accounts for this service.") %] [% lh.maketext("No ContactPerson element could be found in your service metadata, therefore we are unable to provide test accounts for this service.") %]
...@@ -39,7 +42,7 @@ ...@@ -39,7 +42,7 @@
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$.validator.messages.required = "[% lh.maketext("This field is required") %]"; $.validator.messages.required = "[% lh.maketext("This information is required") %]";
$("form").validate(); $("form").validate();
}); });
</script> </script>
......
...@@ -12,12 +12,15 @@ ...@@ -12,12 +12,15 @@
<div class="content clearfix"> <div class="content clearfix">
<h2>[% lh.maketext("Select a federation") %]</h2> <h2>[% lh.maketext("Select a federation") %]</h2>
<p>[% lh.maketext("Select the federation corresponding to the service you want to test::") %]</p> <fieldset>
<legend>[% lh.maketext("Select the federation corresponding to the service you want to test:") %]</legend>
[% FOREACH federation IN federations.sort %] [% FOREACH federation IN federations.sort %]
<input id="[% federation %]" name="federation" value="[% federation %]" type="radio" class="required"/> <input id="[% federation %]" name="federation" value="[% federation %]" type="radio" class="required"/>
<label for="[% federation %]">[% federation %]</label> <label for="[% federation %]">[% federation %]</label>
<br/> <br/>
[% END %] [% END %]
<label for="federation" class="error"></label>
</fieldset>
</div> </div>
<div class="actions clearfix"> <div class="actions clearfix">
...@@ -28,7 +31,7 @@ ...@@ -28,7 +31,7 @@
<script type="text/javascript"> <script type="text/javascript">
$( document ).ready(function() { $( document ).ready(function() {
$.validator.messages.required = "[% lh.maketext("This field is required") %]"; $.validator.messages.required = "[% lh.maketext("This information is required") %]";
$("form").validate(); $("form").validate();
}); });
</script> </script>
......
...@@ -16,16 +16,18 @@ ...@@ -16,16 +16,18 @@
[% lh.maketext("You must be an administrator of that service to continue afterwards.") %] [% lh.maketext("You must be an administrator of that service to continue afterwards.") %]
</p> </p>
<label for="entityid">[% lh.maketext("Type the name or entityID of service to test:") %]</label> <fieldset>
<br/> <legend for="entityid">[% lh.maketext("Type the name or entityID of service to test:") %]</legend>
<select id="entityid" name="entityid" class="required"> <select id="entityid" name="entityid">
<option value=""></option> <option value=""></option>
[% FOREACH entity IN metadata.sort('display_name') %] [% FOREACH entity IN metadata.sort('display_name') %]
<option value="[% entity.entityid %]">[% entity.display_name %]</option> <option value="[% entity.entityid %]">[% entity.display_name %]</option>
[% END %] [% END %]
</select> </select>
<label for="entityid_combobox" class="error"></label>
<input type="hidden" name="federation" value="[% federation %]"/>
</fieldset>
<div class="callout primary">[% lh.maketext("Those service providers have been extracted from the selected federation metadata.") %]</div> <div class="callout primary">[% lh.maketext("Those service providers have been extracted from the selected federation metadata.") %]</div>
<input type="hidden" name="federation" value="[% federation %]"/>
</div> </div>
<div class="actions clearfix"> <div class="actions clearfix">
...@@ -49,13 +51,16 @@ $( document ).ready(function() { ...@@ -49,13 +51,16 @@ $( document ).ready(function() {
_createAutocomplete: function() { _createAutocomplete: function() {
var selected = this.element.children( ":selected" ), var selected = this.element.children( ":selected" ),
id = this.element.attr('id'),
value = selected.val() ? selected.text() : ""; value = selected.val() ? selected.text() : "";
this.input = $( "<input>" ) this.input = $( "<input>" )
.appendTo( this.wrapper ) .appendTo( this.wrapper )
.val( value ) .val( value )
.attr( "title", "" ) .attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left error required" ) .attr('id', id + '_combobox')
.attr('name', id + '_combobox')
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left required" )
.autocomplete({ .autocomplete({
delay: 0, delay: 0,
minLength: 0, minLength: 0,
...@@ -165,7 +170,7 @@ $( document ).ready(function() { ...@@ -165,7 +170,7 @@ $( document ).ready(function() {
}); });
$( "#entityid" ).combobox(); $( "#entityid" ).combobox();
$.validator.messages.required = "[% lh.maketext("This field is required") %]"; $.validator.messages.required = "[% lh.maketext("This information is required") %]";
$("form").validate(); $("form").validate();
}); });
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment