diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-08-16 21:12:01 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-08-17 10:35:26 +0100 |
commit | af6c868217414cd50280da78f92487a255e951f6 (patch) | |
tree | 28743bef1e05cde4aaa44b87cf10fde74ee8dd48 | |
parent | de30194a574b972c87fd43d4abd9b542411b770f (diff) |
Consolidate postcode form template, move question to template, and move admin_base_url to config.
-rw-r--r-- | conf/general.yml-example | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 8 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/EmptyHomes.pm | 5 | ||||
-rw-r--r-- | templates/web/default/around/around_index.html | 13 | ||||
-rw-r--r-- | templates/web/default/around/postcode_form.html | 13 | ||||
-rw-r--r-- | templates/web/default/index.html | 11 | ||||
-rw-r--r-- | templates/web/emptyhomes/index.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet/around/around_index.html | 20 | ||||
-rw-r--r-- | templates/web/fixmystreet/around/postcode_form.html | 27 | ||||
-rw-r--r-- | templates/web/fixmystreet/index.html | 26 |
10 files changed, 53 insertions, 76 deletions
diff --git a/conf/general.yml-example b/conf/general.yml-example index bf9990896..124472a36 100644 --- a/conf/general.yml-example +++ b/conf/general.yml-example @@ -110,6 +110,10 @@ ALLOWED_COBRANDS: - cobrand_one - cobrand_two: 'hostname_substring2' +# This is only used in "offensive report" emails to provide a link directly to +# the admin interface. If wanted, set to the full URL of your admin interface. +ADMIN_BASE_URL: '' + # Gaze is a world-wide service for population density lookups. You can leave # this as is. GAZE_URL: 'http://gaze.mysociety.org/gaze' diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index a8b83c512..1d596fb43 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -100,7 +100,7 @@ Base URL for the admin interface. =cut -sub admin_base_url { '' } +sub admin_base_url { FixMyStreet->config('ADMIN_BASE_URL') || '' } =head2 base_url @@ -136,12 +136,12 @@ sub base_host { =head2 enter_postcode_text -Return the text that prompts the user to enter their postcode/place name. -Parameter is QUERY +Return override text that prompts the user to enter their postcode/place name. +Can be specified in template. =cut -sub enter_postcode_text { _('Enter a nearby street name and area') } +sub enter_postcode_text { } =head2 set_lang_and_domain diff --git a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm index ed0c4ba73..c3d13448d 100644 --- a/perllib/FixMyStreet/Cobrand/EmptyHomes.pm +++ b/perllib/FixMyStreet/Cobrand/EmptyHomes.pm @@ -22,15 +22,10 @@ sub base_url { return $base_url; } -sub admin_base_url { - return 'https://secure.mysociety.org/admin/emptyhomes/'; -} - sub area_types { [ 'DIS', 'LBO', 'MTD', 'UTA', 'LGD', 'COI' ]; # No CTY } - sub base_url_with_lang { my $self = shift; diff --git a/templates/web/default/around/around_index.html b/templates/web/default/around/around_index.html index aca7b3f4b..f58d13d80 100644 --- a/templates/web/default/around/around_index.html +++ b/templates/web/default/around/around_index.html @@ -7,18 +7,7 @@ # '/report/new' and the partial hidden field is added to the form. %] -[% - question = c.cobrand.enter_postcode_text(); -%] - -<form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> - <label for="pc">[% question %]:</label> <input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200"> <input type="submit" value="[% loc('Go') %]" id="submit"> - -[% IF partial_token %] - <input type="hidden" name="partial" value="[% partial_token.token %]"> -[% END %] - -</form> +[% INCLUDE 'around/postcode_form.html' %] [% IF location_error %] <p class="error">[% location_error %]</p> diff --git a/templates/web/default/around/postcode_form.html b/templates/web/default/around/postcode_form.html new file mode 100644 index 000000000..935995cfe --- /dev/null +++ b/templates/web/default/around/postcode_form.html @@ -0,0 +1,13 @@ +[% + question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); +%] + +<form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> + <label for="pc">[% question %]:</label> + <span><input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200"> + <input type="submit" value="[% loc('Go') %]" id="submit"> + </span> + [% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> + [% END %] +</form> diff --git a/templates/web/default/index.html b/templates/web/default/index.html index 8f755d4d5..b3ca36e8c 100644 --- a/templates/web/default/index.html +++ b/templates/web/default/index.html @@ -21,16 +21,7 @@ [% TRY %][% INCLUDE 'front/news.html' %][% CATCH file %][% END %] -[% - question = c.cobrand.enter_postcode_text(); -%] - -<form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> - <label for="pc">[% question %]:</label> - <span><input type="text" name="pc" value="" id="pc" size="10" maxlength="200"> - <input type="submit" value="[% loc('Go') %]" id="submit"> - </span> -</form> +[% INCLUDE 'around/postcode_form.html' %] <div id="front_intro"> diff --git a/templates/web/emptyhomes/index.html b/templates/web/emptyhomes/index.html index 60bdee70c..be6a14b95 100644 --- a/templates/web/emptyhomes/index.html +++ b/templates/web/emptyhomes/index.html @@ -38,7 +38,7 @@ The TV series launched a campaign for action and while this is running, our <a h </p> [% - question = c.cobrand.enter_postcode_text(); + question = loc("Enter a nearby GB postcode, or street name and area"); %] <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> diff --git a/templates/web/fixmystreet/around/around_index.html b/templates/web/fixmystreet/around/around_index.html index 74e0d9ac7..c547b7ba9 100644 --- a/templates/web/fixmystreet/around/around_index.html +++ b/templates/web/fixmystreet/around/around_index.html @@ -1,22 +1,4 @@ -[% pre_container_extra = BLOCK %] -<div id="front-main"><div id="front-main-container"> -[% - question = c.cobrand.enter_postcode_text(); -%] -<form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> - <label for="pc">[% question %]:</label> - <div> - <input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200"> - <input type="submit" value="[% loc('Go') %]" id="submit"> - </div> - - [% IF partial_token %] - <input type="hidden" name="partial" value="[% partial_token.token %]"> - [% END %] -</form> -</div></div> -[% END %] - +[% pre_container_extra = INCLUDE 'around/postcode_form.html' %] [% INCLUDE 'header.html', title = loc('Reporting a problem'), bodyclass = 'frontpage fullwidthpage' %] [% diff --git a/templates/web/fixmystreet/around/postcode_form.html b/templates/web/fixmystreet/around/postcode_form.html new file mode 100644 index 000000000..a98959d3a --- /dev/null +++ b/templates/web/fixmystreet/around/postcode_form.html @@ -0,0 +1,27 @@ +<div id="front-main"> + <div id="front-main-container"> + [% IF c.cobrand.moniker == 'bromley' %] + <h1 class="main mob-only">Reporting a problem in Bromley’s streets or parks</h1> + [% ELSE %] + <h1>[% loc('Report, view, or discuss local problems') %]</h1> + <h2>[% loc('(like graffiti, fly tipping, broken paving slabs, or street lighting)') %]</h2> + [% END %] + + [% + question = c.cobrand.enter_postcode_text || loc('Enter a nearby street name and area'); + %] + + <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> + <label for="pc">[% question %]:</label> + <div> + <input type="text" name="pc" value="[% pc | html %]" id="pc" size="10" maxlength="200" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]"> + <input type="submit" value="[% loc('Go') %]" id="submit"> + </div> + + [% IF partial_token %] + <input type="hidden" name="partial" value="[% partial_token.token %]"> + [% END %] + + </form> + </div> +</div> diff --git a/templates/web/fixmystreet/index.html b/templates/web/fixmystreet/index.html index ac25a1b9a..5849977fc 100644 --- a/templates/web/fixmystreet/index.html +++ b/templates/web/fixmystreet/index.html @@ -16,31 +16,7 @@ Modernizr.load({ </script> [% END %] -[% pre_container_extra = BLOCK %] -<div id="front-main"> - <div id="front-main-container"> - [% IF c.cobrand.moniker == 'bromley' %] - <h1 class="main mob-only">Reporting a problem in Bromley’s streets or parks</h1> - [% ELSE %] - <h1>[% loc('Report, view, or discuss local problems') %]</h1> - <h2>[% loc('(like graffiti, fly tipping, broken paving slabs, or street lighting)') %]</h2> - [% END %] - - [% - question = c.cobrand.enter_postcode_text(); - %] - - <form action="[% c.uri_for('/around') %]" method="get" name="postcodeForm" id="postcodeForm"> - <label for="pc">[% question %]:</label> - <div> - <input type="text" name="pc" value="" id="pc" size="10" maxlength="200" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]"> - <input type="submit" value="[% loc('Go') %]" id="submit"> - </div> - </form> - </div> -</div> -[% END %] - +[% pre_container_extra = INCLUDE 'around/postcode_form.html' %] [% INCLUDE 'header.html', title = '', bodyclass = 'frontpage fullwidthpage' %] [% IF error %] |