diff options
-rw-r--r-- | conf/crontab.ugly | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 4 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 2 | ||||
-rwxr-xr-x | perllib/FixMyStreet/App/Controller/Rss.pm | 1 | ||||
-rw-r--r-- | templates/web/emptyhomes/alert/index.html | 5 | ||||
-rwxr-xr-x | templates/web/emptyhomes/around/display_location.html | 57 | ||||
-rw-r--r-- | templates/web/emptyhomes/front/stats.html | 27 | ||||
-rw-r--r-- | templates/web/emptyhomes/header.html | 1 | ||||
-rw-r--r-- | templates/web/emptyhomes/index.html | 40 | ||||
-rw-r--r-- | templates/web/emptyhomes/report/display.html | 32 | ||||
-rw-r--r-- | templates/web/emptyhomes/report/new/councils_text_all.html (renamed from templates/web/emptyhomes/report/new/all_councils_text.html) | 0 | ||||
-rw-r--r-- | templates/web/emptyhomes/report/new/councils_text_none.html (renamed from templates/web/emptyhomes/report/new/no_councils_text.html) | 0 | ||||
-rwxr-xr-x | templates/web/emptyhomes/reports/council.html | 73 | ||||
-rwxr-xr-x | templates/web/emptyhomes/reports/index.html | 2 |
14 files changed, 241 insertions, 5 deletions
diff --git a/conf/crontab.ugly b/conf/crontab.ugly index 415176779..8c52c898d 100644 --- a/conf/crontab.ugly +++ b/conf/crontab.ugly @@ -15,7 +15,7 @@ MAILTO=cron-!!(*= $site *)!!@mysociety.org 5,10,15,20,25,30,35,40,45,50,55 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-reports" || echo "stalled?" 0 0-11,13-23 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-reports" || echo "stalled?" 0 12 * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-reports.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-reports --verbose" || echo "stalled?" -2 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-alerts.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-alerts" || echo "stalled?" +#2 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-alerts.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-alerts" || echo "stalled?" 0,30 * * * * !!(*= $user *)!! run-with-lockfile -n /data/vhost/!!(*= $vhost *)!!/send-questionnaires.lock "/data/vhost/!!(*= $vhost *)!!/fixmystreet/bin/cron-wrapper send-questionnaires" || echo "stalled?" !!(* } elsif (($vhost eq 'www.fixmystreet.com') || ($vhost eq 'matthew.fixmystreet.com')) { *)!! diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index 4410acdd4..a34737844 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -218,7 +218,9 @@ sub council_list : Path('council_list') : Args(0) { $c->stash->{edit_activity} = $edit_activity; # Not London, as treated separately - my @area_types = grep { $_ ne 'LBO' } $c->cobrand->area_types; + my @area_types = $c->cobrand->moniker eq 'emptyhomes' + ? $c->cobrand->area_types + : grep { $_ ne 'LBO' } $c->cobrand->area_types; my $areas = mySociety::MaPit::call('areas', \@area_types); my @councils_ids = sort { strcoll($areas->{$a}->{name}, $areas->{$b}->{name}) } keys %$areas; diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 72d6ac62b..148a22368 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -182,7 +182,7 @@ sub display_location : Private { # create a list of all the pins my @pins; - unless ($c->req->param('no_pins')) { + unless ($c->req->param('no_pins') || $c->cobrand->moniker eq 'emptyhomes') { @pins = map { # Here we might have a DB::Problem or a DB::Nearby, we always want the problem. my $p = (ref $_ eq 'FixMyStreet::App::Model::DB::Nearby') ? $_->problem : $_; diff --git a/perllib/FixMyStreet/App/Controller/Rss.pm b/perllib/FixMyStreet/App/Controller/Rss.pm index 23345df65..7fddbed97 100755 --- a/perllib/FixMyStreet/App/Controller/Rss.pm +++ b/perllib/FixMyStreet/App/Controller/Rss.pm @@ -151,6 +151,7 @@ sub local_problems_ll : Private { sub output : Private { my ( $self, $c ) = @_; + $c->detach( '/page_error_404_not_found', [ 'Feed not found' ] ) if $c->cobrand->moniker eq 'emptyhomes'; $c->forward( 'lookup_type' ); $c->forward( 'query_main' ); $c->forward( 'generate' ); diff --git a/templates/web/emptyhomes/alert/index.html b/templates/web/emptyhomes/alert/index.html new file mode 100644 index 000000000..cbb2b45f9 --- /dev/null +++ b/templates/web/emptyhomes/alert/index.html @@ -0,0 +1,5 @@ +[% INCLUDE 'header.html', title => loc('Local RSS feeds and email alerts') %] + +<h1>[% loc('Local RSS feeds and email alerts') %]</h1> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/emptyhomes/around/display_location.html b/templates/web/emptyhomes/around/display_location.html new file mode 100755 index 000000000..2b2a8e9f0 --- /dev/null +++ b/templates/web/emptyhomes/around/display_location.html @@ -0,0 +1,57 @@ +[% + + 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') + robots => 'noindex,nofollow'; +%] + +<form action="[% c.uri_for('/report/new') %]" method="post" name="mapForm" id="mapForm" enctype="multipart/form-data"> +[% 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 %]"> +[% c.cobrand.form_elements('mapForm') %] + +<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 %] + +</div> +<div id="side"> + +<p id="text_map" class="banner"> + [% loc( 'To <strong>report a problem</strong>, simply 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> + +</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/emptyhomes/front/stats.html b/templates/web/emptyhomes/front/stats.html new file mode 100644 index 000000000..cbb26fee1 --- /dev/null +++ b/templates/web/emptyhomes/front/stats.html @@ -0,0 +1,27 @@ +[% + USE Comma; + # Note - if we want to i18n the commas we should try + # 'Template::Plugin::Number::Format' +%] + +[% + stats = c.cobrand.front_stats_data(); + + new_text = + stats.recency == '1 week' + ? nget( + "<big>%s</big> report in past week", + "<big>%s</big> reports in past week", + stats.new + ) + : nget( + "<big>%s</big> report recently", + "<big>%s</big> reports recently", + stats.new + ); + +%] + +<div id="front_stats"> + <div>[% tprintf( new_text, stats.new ) | comma %]</div> +</div> diff --git a/templates/web/emptyhomes/header.html b/templates/web/emptyhomes/header.html index d1198eada..7f4106f85 100644 --- a/templates/web/emptyhomes/header.html +++ b/templates/web/emptyhomes/header.html @@ -26,7 +26,6 @@ <ul> <li><a href="/">[% loc("Report a problem") %]</a></li> <li><a href="/reports">[% loc("All reports") %]</a></li> - <li><a href="/alert">[% loc("Local alerts") %]</a></li> <li><a href="/faq">[% loc("Help") %]</a></li> <li><a href="/about">[% loc('About us') %]</a></li> [% IF lang_code == 'en-gb' %] diff --git a/templates/web/emptyhomes/index.html b/templates/web/emptyhomes/index.html new file mode 100644 index 000000000..34cb0a1c0 --- /dev/null +++ b/templates/web/emptyhomes/index.html @@ -0,0 +1,40 @@ +[% INCLUDE 'header.html', title => '' %] + +[% IF error %] + <p class="error">[% error %]</p> +[% END %] + +<p id="expl"> + <strong>[% loc('Report empty properties') %]</strong> +</p> + +[% + 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> + <span><input type="text" name="pc" value="" id="pc" size="10" maxlength="200"> + <input type="submit" value="[% loc('Go') %]" id="submit"> + </span> + [% c.cobrand.form_elements('postcodeForm') %] +</form> + +<div id="front_intro"> + + <h2>[% loc('How to report a problem') %]</h2> + + <ol> + <li>[% question %]</li> + <li>[% loc('Locate the problem on a map of the area') %]</li> + <li>[% loc('Enter details of the problem') %]</li> + <li>[% loc('We send it to the council on your behalf') %]</li> + </ol> + + [% INCLUDE "front/stats.html" %] + +</div> + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/emptyhomes/report/display.html b/templates/web/emptyhomes/report/display.html new file mode 100644 index 000000000..933a05948 --- /dev/null +++ b/templates/web/emptyhomes/report/display.html @@ -0,0 +1,32 @@ +[% + problem_title = loc('Viewing a problem') | html; + INCLUDE 'header.html' + title = problem_title + robots = 'noindex, nofollow' +%] + +<div id="side"> + +[% IF banner.id %] +<p class="banner" id="[% banner.id %]"> + [% banner.text %] +</p> +[% END %] + +<h1>Empty property report</h1> + +<p><em>[% problem.meta_line(c) | html %] +[% IF problem.council %] + [% IF problem.whensent %] + <small class="council_sent_info"><br>[% problem.duration_string(c) %]</small> + [% END %] +[% ELSE %] +<br><small>[% loc('Not reported to council') %]</small> +[% END %] + +</em></p> + +</div> + +[% INCLUDE 'footer.html' %] + diff --git a/templates/web/emptyhomes/report/new/all_councils_text.html b/templates/web/emptyhomes/report/new/councils_text_all.html index 8bdad1c1f..8bdad1c1f 100644 --- a/templates/web/emptyhomes/report/new/all_councils_text.html +++ b/templates/web/emptyhomes/report/new/councils_text_all.html diff --git a/templates/web/emptyhomes/report/new/no_councils_text.html b/templates/web/emptyhomes/report/new/councils_text_none.html index dbe9cd510..dbe9cd510 100644 --- a/templates/web/emptyhomes/report/new/no_councils_text.html +++ b/templates/web/emptyhomes/report/new/councils_text_none.html diff --git a/templates/web/emptyhomes/reports/council.html b/templates/web/emptyhomes/reports/council.html new file mode 100755 index 000000000..8ba9bf1ca --- /dev/null +++ b/templates/web/emptyhomes/reports/council.html @@ -0,0 +1,73 @@ +[% IF ward %] + [% name = "$ward.name, $council.name" + thing = loc('ward') + %] +[% ELSE %] + [% name = council.name + thing = loc('council') + %] +[% END %] + +[% + INCLUDE 'header.html', + title = tprintf(loc('%s - Summary reports'), name) + context = 'reports' +%] + +[% IF children.size %] +<h2 style="clear:right">[% loc('Wards of this council') %]</h2> +<p>[% loc('Follow a ward link to view only reports within that ward.') %]</p> +<ul> +[% FOR child IN children.values.sort('name') %] +<li><a href="[% child.url %]">[% child.name %]</a></li> +[% END %] +</ul> +[% END %] + +<div id="side"> + +[% IF council.generation_high == 10 AND c.cobrand.country == 'GB' %] +<p id="unknown">This council no longer exists. +[% IF council.name.match('Penwith|Kerrier|Carrick|Restormel|Caradon|North Cornwall') %] +Its area is now covered by <a href="/reports/Cornwall">Cornwall Council</a>. +[% ELSIF council.name.match('Durham|Easington|Sedgefield|Teesdale|Wear Valley|Derwentside|Chester le Street') %] +Its area is now covered by <a href="/reports/Durham+County">Durham County Council</a>. +[% ELSIF council.name.match('Blyth Valley|Wansbeck|Castle Morpeth|Tynedale|Alnwick|Berwick upon Tweed') %] +Its area is now covered by <a href="/reports/Northumberland">Northumberland County Council</a>. +[% ELSIF council.name.match('North Shropshire|Oswestry|Shrewsbury and Atcham|South Shropshire|Bridgnorth') %] +Its area is now covered by <a href="/reports/Shropshire">Shropshire Council</a>. +[% ELSIF council.name.match('Salisbury|West Wiltshire|Kennet|North Wiltshire') %] +Its area is now covered by <a href="/reports/Wiltshire">Wiltshire Council</a>. +[% ELSIF council.name.match('Ellesmere Port and Neston|Vale Royal|Chester') %] +Its area is now covered by <a href="/reports/Cheshire+West+and+Chester">Cheshire West and Chester Council</a>. +[% ELSIF council.name.match('Macclesfield|Congleton|Crewe and Nantwich') %] +Its area is now covered by <a href="/reports/Cheshire+East">Cheshire East Council</a>. +[% ELSIF council.name.match('Mid Bedfordshire|South Bedfordshire') %] +Its area is now covered by <a href="/reports/Central+Bedfordshire">Central Bedfordshire Council</a>. +[% ELSIF council.name.match('Cheshire') %] +Its area is now covered by <a href="/reports/Cheshire+West+and+Chester">Cheshire West and Chester Council</a> or +<a href="/reports/Cheshire+East">Cheshire East Council</a>. +[% ELSIF council.name.match('Bedfordshire') %] +Its area is now covered by <a href="/reports/Bedford">Bedford Borough Council</a> or +<a href="/reports/Central+Bedfordshire">Central Bedfordshire Council</a>. +[% END %] +</p> +[% END %] + +[% IF c.cobrand.all_councils_report %] + [% tprintf( loc('This is a summary of all reports for one %s.'), thing ) %] +[% ELSE %] + [% tprintf( loc('This is a summary of all reports for this %s.'), thing ) %] +[% END %] + +[% IF ward %] +[% tprintf( loc('You can <a href="%s">view all reports for the council</a> or <a href="/reports">show all councils</a>.'), council_url ) %] +[% ELSE %] +[% loc('You can <a href="/reports">show all councils</a>.') %] +[% END %] + +<h2>[% name %]</h2> + +</div> +[% INCLUDE 'footer.html' %] + diff --git a/templates/web/emptyhomes/reports/index.html b/templates/web/emptyhomes/reports/index.html index f2cd99cdb..db506679e 100755 --- a/templates/web/emptyhomes/reports/index.html +++ b/templates/web/emptyhomes/reports/index.html @@ -20,7 +20,7 @@ [%- ELSIF loop.count % 2 %] class="a" [%- END -%] > -<td align="left"><a href="[% area.url %]">[% area.name %]</a></td> +<td align="left">[% area.name %]</td> <td>[% open.${area.id}.new or 0 %]</td> <td>[% (open.${area.id}.older or 0) + (open.${area.id}.unknown or 0) %]</td> <td>[% fixed.${area.id}.new or 0 %]</td> |