aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtemplates/web/base/around/display_location.html2
-rwxr-xr-xtemplates/web/fixmystreet.com/around/_report_banner.html11
-rwxr-xr-xtemplates/web/fixmystreet/around/_report_banner.html11
-rw-r--r--templates/web/seesomething/around/display_location.html2
-rw-r--r--templates/web/zurich/admin/body.html38
-rw-r--r--web/js/fixmystreet.js4
6 files changed, 35 insertions, 33 deletions
diff --git a/templates/web/base/around/display_location.html b/templates/web/base/around/display_location.html
index 182c1249e..dbe7d9ffd 100755
--- a/templates/web/base/around/display_location.html
+++ b/templates/web/base/around/display_location.html
@@ -39,7 +39,7 @@
%]
[% IF allow_creation %]
-<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate">
+<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate" novalidate>
[% 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/fixmystreet.com/around/_report_banner.html b/templates/web/fixmystreet.com/around/_report_banner.html
index bd47a1b54..9d0d9bdfe 100755
--- a/templates/web/fixmystreet.com/around/_report_banner.html
+++ b/templates/web/fixmystreet.com/around/_report_banner.html
@@ -6,11 +6,6 @@
<span>Yellow pins show existing reports</span>
[% END %]
</h1>
-<p id="skip-this-step" class="variant0">
- [%
- tprintf(
- loc("Can't see the map? <a href='%s' rel='nofollow'>Skip this step</a>"),
- url_skip
- )
- %]
-</p>
+<a id="skip-this-step" class="variant0" href="[% url_skip %]" rel="nofollow">
+ [% loc("Can't see the map? <em>Skip this step</em>") %]
+</a>
diff --git a/templates/web/fixmystreet/around/_report_banner.html b/templates/web/fixmystreet/around/_report_banner.html
index 9edf6e171..5ec7300d6 100755
--- a/templates/web/fixmystreet/around/_report_banner.html
+++ b/templates/web/fixmystreet/around/_report_banner.html
@@ -4,11 +4,6 @@
<span>Yellow pins show existing reports</span>
[% END %]
</h1>
-<p id="skip-this-step">
- [%
- tprintf(
- loc("Can't see the map? <a href='%s' rel='nofollow'>Skip this step</a>"),
- url_skip
- )
- %]
-</p>
+<a id="skip-this-step" href="[% url_skip %]" rel="nofollow">
+ [% loc("Can't see the map? <em>Skip this step</em>") %]
+</a>
diff --git a/templates/web/seesomething/around/display_location.html b/templates/web/seesomething/around/display_location.html
index e90d1aa0e..ea0a499f7 100644
--- a/templates/web/seesomething/around/display_location.html
+++ b/templates/web/seesomething/around/display_location.html
@@ -19,7 +19,7 @@
%]
-<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate">
+<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data" class="validate" novalidate>
[% 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/zurich/admin/body.html b/templates/web/zurich/admin/body.html
index 764ad9bd8..4cedc9838 100644
--- a/templates/web/zurich/admin/body.html
+++ b/templates/web/zurich/admin/body.html
@@ -2,12 +2,13 @@
[% PROCESS 'admin/report_blocks.html' %]
[% IF updated %]
-<p>
-<em>[% updated %]</em>
-</p>
+ <p>
+ <em>[% updated %]</em>
+ </p>
[% END %]
[% IF admin_type == 'super' AND body.parent AND NOT body.parent.parent # A division %]
+ [% IF NOT errors %]
<table cellspacing="0" cellpadding="2" border="1">
<tr>
<th>[% loc('Category') %]</th>
@@ -16,29 +17,34 @@
<th>[% loc('Note') %]</th>
<th>[% loc('When edited') %]</th>
</tr>
- [% WHILE ( contact = contacts.next ) %]
- <tr>
- <td><a href="[% c.uri_for( 'body_edit', body_id, contact.category ) %]">[% contact.category %]</a></td>
- <td>[% contact.email | html %]</td>
- <td>[% contact.editor %]</td>
- <td>[% contact.note | html %]</td>
- <td>[% PROCESS format_date this_date=contact.whenedited %]</td>
+ [% WHILE ( cat = contacts.next ) %]
+ <tr[% IF cat.deleted %] class="is-deleted"[% END %]>
+ <td><a href="[% c.uri_for( 'body_edit', body_id, cat.category ) %]">[% cat.category %]</a></td>
+ <td>[% cat.email | html %]</td>
+ <td>[% cat.editor %]</td>
+ <td>[% cat.note | html %]</td>
+ <td>[% PROCESS format_date this_date=cat.whenedited %]</td>
</tr>
[% END %]
</table>
<h2>[% loc('Add new category') %]</h2>
+ [% END %][%# Only show all the above if no errors with below form %]
+
+ [% IF errors %]
+ <div class="fms-admin-warning">
+ [% errors.values.join('<br>') %]
+ </div>
+ [% END %]
<form method="post" action="[% c.uri_for('body', body_id ) %]" enctype="application/x-www-form-urlencoded" accept-charset="utf-8">
- [% IF c.cobrand.moniker != 'emptyhomes' %]
<p>
- <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30">
+ <strong>[% loc('Category:') %] </strong><input type="text" name="category" size="30" value="[% contact.category | html %]">
</p>
- [% END %]
<p>
- <strong>[% loc('Email:') %] </strong><input type="text" name="email" size="30">
+ <strong>[% loc('Email:') %] </strong><input type="text" name="email" size="30" value="[% contact.email | html %]">
</p>
<input type="hidden" name="confirmed" value="1" id="confirmed">
@@ -50,7 +56,7 @@
<p>
<input type="hidden" name="posted" value="new" >
<input type="hidden" name="token" value="[% token %]" >
- <input type="submit" name="Create category" value="[% loc('Create category') %]" >
+ <input type="submit" name="Create category" value="[% errors ? loc('Save changes') : loc('Create category') %]">
</p>
<div>
@@ -61,7 +67,9 @@
[% END %]
+[% IF NOT errors %]
<h2>[% loc('Edit body details') %]</h2>
[% INCLUDE 'admin/body-form.html' %]
+[% END %]
[% INCLUDE 'admin/footer.html' %]
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js
index 7d75c8b65..c8f1fe697 100644
--- a/web/js/fixmystreet.js
+++ b/web/js/fixmystreet.js
@@ -203,6 +203,10 @@ $(function(){
});
});
+ // Map form doesn't work in some browsers with HTML5 validation and hidden form, so
+ // we disable validation by default, and add it in the JS case.
+ // For some reason, the removeAttr doesn't work if we place it at beginning.
+ $('#mapForm').removeAttr('novalidate');
});
})(jQuery);