diff options
Diffstat (limited to 'templates/web/default')
-rwxr-xr-x | templates/web/default/around/display_location.html | 2 | ||||
-rw-r--r-- | templates/web/default/auth/general.html | 4 | ||||
-rw-r--r-- | templates/web/default/common_header_tags.html | 3 | ||||
-rw-r--r-- | templates/web/default/contact/index.html | 10 | ||||
-rw-r--r-- | templates/web/default/header.html | 3 | ||||
-rw-r--r-- | templates/web/default/js_validation_msgs.html | 20 | ||||
-rw-r--r-- | templates/web/default/report/display.html | 10 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details.html | 4 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details_form.html | 18 |
9 files changed, 50 insertions, 24 deletions
diff --git a/templates/web/default/around/display_location.html b/templates/web/default/around/display_location.html index 8d8e1dc3c..8c9047bb2 100755 --- a/templates/web/default/around/display_location.html +++ b/templates/web/default/around/display_location.html @@ -35,7 +35,7 @@ robots => 'noindex,nofollow'; %] -<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data"> +<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate"> [% IF c.req.params.map_override %] <input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> [% END %] diff --git a/templates/web/default/auth/general.html b/templates/web/default/auth/general.html index 6c9d4497a..5407e56e1 100644 --- a/templates/web/default/auth/general.html +++ b/templates/web/default/auth/general.html @@ -2,7 +2,7 @@ <h1>[% loc('Sign in') %]</h1> -<form action="[% c.uri_for() %]" method="post" name="general_auth"> +<form action="[% c.uri_for() %]" method="post" name="general_auth" class="validate"> <input type="hidden" name="r" value="[% c.req.params.r | html %]"> [% IF email_error; @@ -25,7 +25,7 @@ <div class="form-field"> <label class="n" for="email">[% loc('Your email address:') %]</label> - <input type="email" size="30" id="email" name="email" value="[% email | html %]"> + <input type="email" class="required email" size="30" id="email" name="email" value="[% email | html %]"> </div> <div id="form_sign_in"> diff --git a/templates/web/default/common_header_tags.html b/templates/web/default/common_header_tags.html index 44da6aa9b..fb1d559b8 100644 --- a/templates/web/default/common_header_tags.html +++ b/templates/web/default/common_header_tags.html @@ -1,5 +1,8 @@ <meta http-equiv="content-type" content="text/html; charset=utf-8"> <script type="text/javascript" src="/jslib/jquery-1.6.2.min.js"></script> + +<script src="[% version('/js/jquery.validate.min.js') %]" type="text/javascript" charset="utf-8"></script> + <script type="text/javascript" src="[% version('/js/geo.min.js') %]"></script> <script type="text/javascript" src="[% version('/js/fixmystreet.js') %]"></script> diff --git a/templates/web/default/contact/index.html b/templates/web/default/contact/index.html index dc64dd554..2c0c2ff02 100644 --- a/templates/web/default/contact/index.html +++ b/templates/web/default/contact/index.html @@ -5,7 +5,7 @@ <h1>[% loc('Contact the team') %]</h1> -<form method="post" action="/contact/submit"> +<form method="post" action="/contact/submit" class="validate"> [% INCLUDE 'errors.html' %] @@ -66,7 +66,7 @@ [% END %] <div class="form-field"> <label for="form_name">[% loc('Your name:') %]</label> -<input type="text" name="name" id="form_name" value="[% form_name | html %]" size="30"></div> +<input type="text" class="required" name="name" id="form_name" value="[% form_name | html %]" size="30"></div> [% IF field_errors.em %] @@ -74,14 +74,14 @@ [% END %] <div class="form-field"> <label for="form_email">[% loc('Your email:') %]</label> -<input type="text" name="em" id="form_email" value="[% em | html %]" size="30"></div> +<input type="text" class="required email" name="em" id="form_email" value="[% em | html %]" size="30"></div> [% IF field_errors.subject %] <div class="form-error">[% field_errors.subject %]</div> [% END %] <div class="form-field"> <label for="form_subject">[% loc('Subject:') %]</label> -<input type="text" name="subject" id="form_subject" value="[% subject | html %]" size="30"></div> +<input type="text" class="required" name="subject" id="form_subject" value="[% subject | html %]" size="30"></div> [% IF field_errors.message %] <div class="form-error">[% field_errors.message %]</div> @@ -89,7 +89,7 @@ <div class="form-field"> <label for="form_message">[% loc('Message:') %]</label> -<textarea name="message" id="form_message" rows="7" cols="50">[% message | html %]</textarea></div> +<textarea class="required" name="message" id="form_message" rows="7" cols="50">[% message | html %]</textarea></div> <div class="checkbox"><input type="submit" value="[% loc('Post') %]"></div> [% c.cobrand.form_elements('contactForm') %] diff --git a/templates/web/default/header.html b/templates/web/default/header.html index 1aa8ce159..54aa3f342 100644 --- a/templates/web/default/header.html +++ b/templates/web/default/header.html @@ -15,6 +15,8 @@ <link rel="stylesheet" type="text/css" href="[% version('/css/core.css') %]"> <link rel="stylesheet" type="text/css" href="[% version('/css/main.css') %]"> + [% INCLUDE 'js_validation_msgs.html' %] + [% INCLUDE 'common_header_tags.html' %] [% IF c.req.uri.host == 'osm.fixmystreet.com' %] @@ -22,6 +24,7 @@ [% END %] [% INCLUDE 'tracking_code.html' %] + </head> <body> diff --git a/templates/web/default/js_validation_msgs.html b/templates/web/default/js_validation_msgs.html new file mode 100644 index 000000000..2466ce175 --- /dev/null +++ b/templates/web/default/js_validation_msgs.html @@ -0,0 +1,20 @@ +<script type="text/javascript"> + validation_strings = { + update: '[% loc('Please enter a message') %]', + title: '[% loc('Please enter a subject') %]', + detail: '[% loc('Please enter some details') %]', + name: { + required: '[% loc('Please enter your name') %]', + validName: '[% loc('Please enter your full name, councils need this information - if you do not wish your name to be shown on the site, untick the box') %]', + }, + category: '[% loc('Please choose a category') %]', + rznvy: { + required: '[% loc('Please enter your email') %]', + email: '[% loc('Please enter a valid email') %]', + }, + email: { + required: '[% loc('Please enter your email') %]', + email: '[% loc('Please enter a valid email') %]', + } + }; +</script> diff --git a/templates/web/default/report/display.html b/templates/web/default/report/display.html index aeff140fe..1e320e1b4 100644 --- a/templates/web/default/report/display.html +++ b/templates/web/default/report/display.html @@ -65,7 +65,7 @@ [% INCLUDE 'errors.html' %] - <form method="post" action="[% c.uri_for( '/report/update' ) %]" name="updateForm" class="fieldset"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> + <form method="post" action="[% c.uri_for( '/report/update' ) %]" name="updateForm" class="fieldset validate"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> <input type="hidden" name="submit_update" value="1"> <input type="hidden" name="id" value="[% problem.id | html %]"> @@ -75,7 +75,7 @@ [% END %] <div class="form-field"> <label for="form_update">[% loc( 'Update:' ) %]</label> - <textarea name="update" id="form_update" rows="7" cols="30">[% update.text | html %]</textarea> + <textarea name="update" id="form_update" rows="7" cols="30" required>[% update.text | html %]</textarea> </div> [% IF c.user && c.user.belongs_to_council( problem.council ) %] @@ -132,7 +132,7 @@ [% END %] <div class="form-field"> <label for="form_rznvy">[% loc('Your email:' ) %]</label> - <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30"> + <input type="email" name="rznvy" id="form_rznvy" value="[% update.user.email | html %]" size="30" required> </div> <div id="form_sign_in"> @@ -159,7 +159,7 @@ </p> <p> - <input type="submit" name="submit_sign_in" value="[% loc('Post') %]"> + <input type="submit" name="submit_sign_in" id="submit_sign_in" value="[% loc('Post') %]"> </p> </div> @@ -181,7 +181,7 @@ <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> <p> - <input type="submit" name="submit_register" value="[% loc('Post') %]"> + <input type="submit" name="submit_register" id="submit_register" value="[% loc('Post') %]"> </p> </div> diff --git a/templates/web/default/report/new/fill_in_details.html b/templates/web/default/report/new/fill_in_details.html index a9a113283..701a9bafa 100644 --- a/templates/web/default/report/new/fill_in_details.html +++ b/templates/web/default/report/new/fill_in_details.html @@ -4,14 +4,14 @@ %] [% IF report.used_map %] -<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> +<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %] class="validate"> [% IF c.req.params.map_override %] <input type="hidden" name="map_override" value="[% c.req.params.map_override | html %]"> [% END %] <input type="hidden" name="pc" value="[% pc | html %]"> [% c.cobrand.form_elements('mapForm') %] [% ELSE %] -<form action="[% c.uri_for('/report/new') %]" method="post" name="mapSkippedForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %]> +<form action="[% c.uri_for('/report/new') %]" method="post" name="mapSkippedForm"[% IF c.cobrand.allow_photo_upload %] enctype="multipart/form-data"[% END %] class="validate"> <input type="hidden" name="pc" value="[% pc | html %]"> <input type="hidden" name="skipped" value="1"> [% c.cobrand.form_elements('mapSkippedForm') %] diff --git a/templates/web/default/report/new/fill_in_details_form.html b/templates/web/default/report/new/fill_in_details_form.html index 633dc0b11..c428df514 100644 --- a/templates/web/default/report/new/fill_in_details_form.html +++ b/templates/web/default/report/new/fill_in_details_form.html @@ -50,7 +50,7 @@ <div class="form-field"> <label for="form_title">[% loc('Subject:') %]</label> - <input type="text" value="[% report.title | html %]" name="title" id="form_title" size="25"> + <input type="text" value="[% report.title | html %]" name="title" id="form_title" size="25" required> </div> [% IF field_errors.detail %] @@ -59,13 +59,13 @@ <div class="form-field"> <label for="form_detail">[% loc('Details:') %]</label> - <textarea name="detail" id="form_detail" rows="7" cols="26">[% report.detail | html %]</textarea> + <textarea name="detail" id="form_detail" rows="7" cols="26" required>[% report.detail | html %]</textarea> </div> [% IF js %] <div class="form-field" id="form_category_row"> <label for="form_category">[% loc('Category:') %]</label> - <select name="category" id="form_category"><option>[% loc('Loading...') %]</option></select> + <select name="category" id="form_category" required><option>[% loc('Loading...') %]</option></select> </div> [% ELSE %] [% IF category_options.size %] @@ -118,7 +118,7 @@ <div class="form-field"> <label for="form_email">[% loc('Your email:') %]</label> - <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> + <input type="email" value="[% report.user.email | html %]" name="email" id="form_email" size="25" required> </div> [% INCLUDE 'report/new/notes.html' %] @@ -132,10 +132,10 @@ <div class='form-error'>[% field_errors.password %]</div> [% END %] - <p> + <div class="form-field"> <label class="n" for="password_sign_in">[% loc('<strong>Yes</strong>, I have a password:') %]</label> <input type="password" name="password_sign_in" id="password_sign_in" value="" size="25"> - </p> + </div> <div class="fieldset"> @@ -147,7 +147,7 @@ </p> <p> - <input type="submit" name="submit_sign_in" value="[% loc('Submit') %]"> + <input type="submit" id="submit_sign_in" name="submit_sign_in" value="[% loc('Submit') %]"> </p> </div> @@ -169,7 +169,7 @@ <p style="clear:both"><small>[% loc('Providing a password is optional, but doing so will allow you to more easily report problems, leave updates and manage your reports.') %]</small></p> <p> - <input type="submit" name="submit_register" value="[% loc('Submit') %]"> + <input type="submit" id="submit_register" name="submit_register" value="[% loc('Submit') %]"> </p> </div> @@ -197,7 +197,7 @@ <div class="form-field"> <label for="form_name">[% loc('Your name:') %]</label> - <input type="text" value="[% report.name | html %]" name="name" id="form_name" size="25"> + <input type="text" class="validName" value="[% report.name | html %]" name="name" id="form_name" size="25"> </div> <div class="checkbox"> |