diff options
Diffstat (limited to 'templates/web/default')
-rw-r--r-- | templates/web/default/common_header_tags.html | 3 | ||||
-rw-r--r-- | templates/web/default/header.html | 3 | ||||
-rw-r--r-- | templates/web/default/js_validation_msgs.html | 15 | ||||
-rw-r--r-- | templates/web/default/report/new/fill_in_details_form.html | 18 |
4 files changed, 30 insertions, 9 deletions
diff --git a/templates/web/default/common_header_tags.html b/templates/web/default/common_header_tags.html index d0140d69c..a1787c699 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="/js/jquery.validate.js" type="text/javascript" charset="utf-8"></script> + <script type="text/javascript" src="[% version('/js/fixmystreet.js') %]"></script> [% map_js %] diff --git a/templates/web/default/header.html b/templates/web/default/header.html index cfe4911a0..5290ffc41 100644 --- a/templates/web/default/header.html +++ b/templates/web/default/header.html @@ -8,6 +8,8 @@ <link rel="stylesheet" type="text/css" href="/css/ie6.css"> <![endif]--> + [% INCLUDE 'js_validation_msgs.html' %] + [% INCLUDE 'common_header_tags.html' %] [% IF c.req.uri.host == 'osm.fixmystreet.com' %] @@ -15,6 +17,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..140f22964 --- /dev/null +++ b/templates/web/default/js_validation_msgs.html @@ -0,0 +1,15 @@ +<script type="text/javascript"> + validation_strings = { + 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') %]', + email: { + required: '[% loc('Please enter your email') %]', + email: '[% loc('Please enter a valid email') %]', + } + }; +</script> 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 eea020e3f..58b379f54 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" class="required" value="[% report.title | html %]" name="title" id="form_title" size="25" > </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 class="required" name="detail" id="form_detail" rows="7" cols="26">[% 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 class="required" name="category" id="form_category"><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" class="required email" value="[% report.user.email | html %]" name="email" id="form_email" size="25"> </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> <p> <input type="checkbox" id="remember_me" name="remember_me" value='1'[% ' checked' IF remember_me %]> @@ -145,7 +145,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> @@ -166,7 +166,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> @@ -192,7 +192,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"> |