From d2939e236f7bb04ec7dd3902e69134e1b538a6fb Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Wed, 12 Sep 2018 12:26:56 +0100 Subject: [Oxfordshire] display message if user selects PROW category Adds some div wrappers round the non category bit of the form so we can then hide easily. --- templates/web/base/report/new/form_report.html | 2 ++ templates/web/base/report/new/form_user.html | 2 ++ templates/web/fixmystreet.com/footer_extra_js.html | 1 + templates/web/oxfordshire/footer_extra_js.html | 1 + web/cobrands/oxfordshire/assets.js | 18 ++++++++++++++++++ web/cobrands/oxfordshire/base.scss | 5 +++++ 6 files changed, 29 insertions(+) create mode 100644 web/cobrands/oxfordshire/assets.js diff --git a/templates/web/base/report/new/form_report.html b/templates/web/base/report/new/form_report.html index b4688f950..24c3ff4d1 100644 --- a/templates/web/base/report/new/form_report.html +++ b/templates/web/base/report/new/form_report.html @@ -6,6 +6,7 @@ [% PROCESS "report/new/category_wrapper.html" %] [% TRY %][% PROCESS 'report/new/after_category.html' %][% CATCH file %][% END %] +
[% TRY %][% PROCESS 'report/new/_form_labels.html' %][% CATCH file %][% END %]

[% loc( 'Public details' ) %]

@@ -75,3 +76,4 @@ +
diff --git a/templates/web/base/report/new/form_user.html b/templates/web/base/report/new/form_user.html index 68a226693..3e0af10a3 100644 --- a/templates/web/base/report/new/form_user.html +++ b/templates/web/base/report/new/form_user.html @@ -1,3 +1,4 @@ +

[% loc('Private details') %]

[% IF js %] @@ -13,3 +14,4 @@ [% ELSE %] [% PROCESS "report/new/form_user_loggedout.html" %] [% END %] +

diff --git a/templates/web/fixmystreet.com/footer_extra_js.html b/templates/web/fixmystreet.com/footer_extra_js.html index c1d1b09b0..bb7c9780c 100644 --- a/templates/web/fixmystreet.com/footer_extra_js.html +++ b/templates/web/fixmystreet.com/footer_extra_js.html @@ -9,6 +9,7 @@ IF bodyclass.match('mappage'); scripts.push( version('/cobrands/bromley/assets.js') ); scripts.push( version('/cobrands/buckinghamshire/assets.js') ); scripts.push( version('/cobrands/lincolnshire/assets.js') ); + scripts.push( version('/cobrands/oxfordshire/assets.js') ); scripts.push( version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), ); diff --git a/templates/web/oxfordshire/footer_extra_js.html b/templates/web/oxfordshire/footer_extra_js.html index 541e2ee16..e05e16707 100644 --- a/templates/web/oxfordshire/footer_extra_js.html +++ b/templates/web/oxfordshire/footer_extra_js.html @@ -1,4 +1,5 @@ [% scripts.push( version('/vendor/OpenLayers.Projection.OrdnanceSurvey.js'), version('/cobrands/oxfordshire/js.js'), + version('/cobrands/oxfordshire/assets.js'), ) %] diff --git a/web/cobrands/oxfordshire/assets.js b/web/cobrands/oxfordshire/assets.js new file mode 100644 index 000000000..8858ee66e --- /dev/null +++ b/web/cobrands/oxfordshire/assets.js @@ -0,0 +1,18 @@ +(function(){ + function disable_form(disable) { + $('#post_category_details_form').toggle(!disable); + $('#private_form').toggle(!disable); + } + + function check_rights_of_way() { + if (OpenLayers.Util.indexOf(fixmystreet.bodies, 'Oxfordshire County Council') > -1 && $('#form_category').val() == 'Countryside Paths / Public Rights of Way (usually not tarmac)') { + $('#category_meta').html('

Please report problems with rights of way using this page.

'); + disable_form(true); + } else { + $('#category_meta').html(''); + disable_form(false); + } + } + + $(fixmystreet).on('report_new:category_change', check_rights_of_way); +})(); diff --git a/web/cobrands/oxfordshire/base.scss b/web/cobrands/oxfordshire/base.scss index aaaaa186c..6d4bad117 100644 --- a/web/cobrands/oxfordshire/base.scss +++ b/web/cobrands/oxfordshire/base.scss @@ -275,6 +275,11 @@ textarea { } } +.category-message { + padding: 1em; + background-color: $color-oxfordshire-pale-grey-green; +} + .item-list--reports__item { small { font-style: inherit; -- cgit v1.2.3