diff options
4 files changed, 204 insertions, 0 deletions
diff --git a/templates/web/fixmystreet/around/around_index.html b/templates/web/fixmystreet/around/around_index.html new file mode 100644 index 000000000..c07eb2ca2 --- /dev/null +++ b/templates/web/fixmystreet/around/around_index.html @@ -0,0 +1,49 @@ +[% INCLUDE 'header.html', title => loc('Reporting a problem') %] + +[% + # NOTE ON PARTIAL REPORTS: + # + # partial reports get a bit of extra text added, the form goes to + # '/report/new' and the partial hidden field is added to the form. +%] + +[% + question + = c.cobrand.enter_postcode_text() + || loc("Enter a nearby GB postcode, or street name and area"); +%] + +<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> + +[% IF location_offshore %] + <p class="error">[% loc('That spot does not appear to be covered by a council. If you have tried to report an issue past the shoreline, for example, please specify the closest point on land.') %]</p> +[% ELSIF location_error %] + <p class="error">[% location_error %]</p> +[% END %] + +[% IF possible_location_matches %] + <p>[% loc('We found more than one match for that location. We show up to ten matches, please try a different search if yours is not here.') %]</p> + <ul class="pc_alternatives"> + [% FOREACH match IN possible_location_matches %] + <li><a href="/around?latitude=[% match.latitude | uri %];longitude=[% match.longitude | uri %]">[% match.address | html %]</a></li> + [% END %] + </ul> +[% END %] + +[% IF partial_token %] + <p style="margin-top: 0; color: #cc0000;"> + <img align="right" src="/photo?id=[% report.id %]" hspace="5"> + [% loc("Thanks for uploading your photo. We now need to locate your problem, so please enter a nearby street name or postcode in the box below :") %] + </p> +[% END %] + + + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/fixmystreet/around/around_map_list_items.html b/templates/web/fixmystreet/around/around_map_list_items.html new file mode 100644 index 000000000..e248ce3ed --- /dev/null +++ b/templates/web/fixmystreet/around/around_map_list_items.html @@ -0,0 +1,16 @@ +[% IF around_map.size %] + [% FOREACH p IN around_map %] + + [% dist = tprintf("%.1f", (p.distance || 0) ) %] + + <li> + <a href="[% c.uri_for('/report', p.problem.id ) %]">[% p.problem.title | html %]</a> + <small>[% prettify_epoch( p.problem.confirmed_local.epoch, 1 ) %], [% dist %]km</small> + [% IF p.problem.is_fixed %] + <small>[% loc('(fixed)') %]</small> + [% END %] + </li> + [% END %] +[% ELSE %] + <li>[% loc('No problems found.') %]</li> +[% END %] diff --git a/templates/web/fixmystreet/around/display_location.html b/templates/web/fixmystreet/around/display_location.html new file mode 100755 index 000000000..b5705a77b --- /dev/null +++ b/templates/web/fixmystreet/around/display_location.html @@ -0,0 +1,126 @@ +[% + + rss_alt = loc('RSS feed'); + rss_title = loc('RSS feed of recent local problems'); + + rss_url + = pc + ? c.uri_for( "/rss/pc", pc ) + : c.uri_for( "/rss/l/$short_latitude,$short_longitude" ); + + email_url = c.uri_for( + '/alert/list', + { + lat => short_latitude, + lon => short_longitude, + feed => "local:$short_latitude:$short_longitude", + } + ); + + url_skip = c.uri_for( + '/report/new', + { + pc => pc + latitude => short_latitude, + longitude => short_longitude, + skipped => 1, + } + ); + + PROCESS "maps/${map.type}.html"; + + INCLUDE 'header.html', + title => loc('Viewing a location') + rss => [ loc('Recent local problems, FixMyStreet'), rss_url ], + robots => 'noindex,nofollow'; +%] + +<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 %] +<input type="hidden" name="pc" value="[% pc | html %]"> + +<input type="hidden" name="latitude" id="fixmystreet.latitude" value="[% short_latitude | html %]"> +<input type="hidden" name="longitude" id="fixmystreet.longitude" value="[% short_longitude | html %]"> + +[% map_html %] + +<p id='sub_map_links'> + [% IF c.req.params.no_pins %] + <a id='hide_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => 0 } ) %]'>[% loc('Show pins') %]</a> + [% ELSE %] + <a id='hide_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => 1 } ) %]'>[% loc('Hide pins') %]</a> + [% END %] + [% IF c.cobrand.country == 'GB' || c.cobrand.country == 'NO' %] + | + [% IF c.req.params.all_pins %] + <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => undef } ) %]'>[% loc('Hide stale reports') %]</a> + [% ELSE %] + <a id='all_pins_link' rel='nofollow' href='[% c.uri_with( { no_pins => undef, all_pins => 1 } ) %]'>[% loc('Include stale reports') %]</a> + [% END %] + [% END %] +</p> + +</div> +<div id="side"> + +<p id="text_map" class="banner"> + [% loc( 'To <strong>report a problem</strong>, click on the map at the correct location.' ) %] + [% + tprintf( + loc("<small>If you cannot see the map, <a href='%s' rel='nofollow'>skip this step</a>.</small>"), + url_skip + ) + %] + <span id="text_map_arrow"></span> +</p> + +<h1>[% loc('Problems in this area') %]</h1> + +<p id="alert_links_area"> + <a id="email_alert" rel="nofollow" href="[% email_url | html %]"> + [%- loc('Email me new local problems') -%] +</a> | + <a href="[% rss_url | html %]" id="rss_alert"> + <span>[% rss_alt %]</span> + <img src="/i/feed.png" width="16" height="16" title="[% rss_title %]" alt="[% rss_alt %]" border="0" style="vertical-align: top"> + </a> +</p> + +<div id="nearby_lists"> + + <h2>[% loc('Reports on and around the map') %]</h2> + + <ul id="current"> + [% INCLUDE "around/on_map_list_items.html" %] + </ul> + + + <h2> + [% + tprintf( + loc( 'Closest nearby problems <small>(within %skm)</small>' ), + distance + ) + %] + </h2> + + <ul id="current_near"> + [% INCLUDE "around/around_map_list_items.html" %] + </ul> + +</div> + +</div> + +<div style="display:none" id="side-form"> +[% INCLUDE "report/new/fill_in_details_form.html" + js = 1, + report.used_map = 1 +%] +</div> + +</form> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/fixmystreet/around/on_map_list_items.html b/templates/web/fixmystreet/around/on_map_list_items.html new file mode 100644 index 000000000..245be7190 --- /dev/null +++ b/templates/web/fixmystreet/around/on_map_list_items.html @@ -0,0 +1,13 @@ +[% IF on_map.size %] + [% FOREACH p IN on_map %] + <li> + <a href="[% c.uri_for('/report', p.id ) %]">[% p.title | html %]</a> + <small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small> + [% IF p.is_fixed %] + <small>[% loc('(fixed)') %]</small> + [% END %] + </li> + [% END %] +[% ELSE %] + <li>[% loc('No problems have been reported yet.') %]</li> +[% END %] |