diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Barnet.pm | 44 | ||||
-rw-r--r-- | templates/web/barnet/alert/_list.html | 89 | ||||
-rw-r--r-- | templates/web/barnet/alert/index.html | 38 | ||||
-rw-r--r-- | templates/web/barnet/index.html | 99 | ||||
-rw-r--r-- | templates/web/barnet/report/new/councils_text_all.html | 4 | ||||
-rw-r--r-- | templates/web/barnet/report/updates-sidebar-notes.html | 1 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/display.html | 2 | ||||
-rw-r--r-- | templates/web/fixmystreet/report/updates-sidebar-notes.html | 1 |
8 files changed, 277 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Barnet.pm b/perllib/FixMyStreet/Cobrand/Barnet.pm index 13731a66c..60fdb6da6 100644 --- a/perllib/FixMyStreet/Cobrand/Barnet.pm +++ b/perllib/FixMyStreet/Cobrand/Barnet.pm @@ -54,5 +54,49 @@ sub generate_problem_banner { return $banner; } +sub council_rss_alert_options { + my $self = shift; + my $all_councils = shift; + my $c = shift; + + my %councils = map { $_ => 1 } $self->area_types(); + + my $num_councils = scalar keys %$all_councils; + + my ( @options, @reported_to_options ); + if ( $num_councils == 1 or $num_councils == 2 ) { + my ($council, $ward); + foreach (values %$all_councils) { + if ($councils{$_->{type}}) { + $council = $_; + $council->{short_name} = $self->short_name( $council ); + ( $council->{id_name} = $council->{short_name} ) =~ tr/+/_/; + } else { + $ward = $_; + $ward->{short_name} = $self->short_name( $ward ); + ( $ward->{id_name} = $ward->{short_name} ) =~ tr/+/_/; + } + } + + push @options, + { + type => 'council', + id => sprintf( 'council:%s:%s', $council->{id}, $council->{id_name} ), + text => 'All problems within the council.', + rss_text => sprintf( _('RSS feed of problems within %s'), $council->{name}), + uri => $c->uri_for( '/rss/reports/' . $council->{short_name} ), + }; + push @options, + { + type => 'ward', + id => sprintf( 'ward:%s:%s:%s:%s', $council->{id}, $ward->{id}, $council->{id_name}, $ward->{id_name} ), + rss_text => sprintf( _('RSS feed of problems within %s ward'), $ward->{name}), + text => sprintf( _('Problems within %s ward'), $ward->{name}), + uri => $c->uri_for( '/rss/reports/' . $council->{short_name} . '/' . $ward->{short_name} ), + } if $ward; + } + + return ( \@options, @reported_to_options ? \@reported_to_options : undef ); +} 1; diff --git a/templates/web/barnet/alert/_list.html b/templates/web/barnet/alert/_list.html new file mode 100644 index 000000000..b281fd54f --- /dev/null +++ b/templates/web/barnet/alert/_list.html @@ -0,0 +1,89 @@ + <input type="hidden" name="type" value="local"> + <input type="hidden" name="pc" value="[% pc | html %]"> + <input type="hidden" name="latitude" value="[% latitude | html %]"> + <input type="hidden" name="longitude" value="[% longitude | html %]"> + + <p> + [% IF pretty_pc %] + [% tprintf( loc('Here are the types of local problem alerts for ‘%s’.'), pretty_pc ) %] + [% END %] + [% loc('Select which type of alert you\'d like and click the button for an RSS feed, or enter your email address to subscribe to an email alert.') %] + </p> + + [% INCLUDE 'errors.html' %] + + <p> + [% loc('The simplest alert is our geographic one:') %] + </p> + + <p> + <input type="radio" name="feed" id="[% rss_feed_id %]" value="[% rss_feed_id %]"[% IF rss_feed_id == selected_feed || selected_feed == '' %] checked[% END %]> + <label class="inline" for="[% rss_feed_id %]">[% tprintf( loc('Problems within %.1fkm of this location'), population_radius ) %]</label> + <a href='[% rss_feed_uri %]'><img src='/i/feed.png' width='16' height='16' title='[% loc('RSS feed of nearby problems') %]' alt='[% loc('RSS feed') %]' border='0'></a> + <br /> + [% loc('(a default distance which covers roughly 200,000 people)') %] + </p> + + <p id="rss_local_alt"> + [% loc('(alternatively the RSS feed can be customised, within') %] + <a href="[% rss_feed_2k %]">2km</a> / <a href="[% rss_feed_5k %]">5km</a> / <a href="[% rss_feed_10k %]">10km</a> / <a href="[% rss_feed_20k %]">20km</a>) + </p> + + <p> + Or you can subscribe to an alert for all council problems or one based upon what ward you’re in: + </p> + + [% IF reported_to_options %] + <p><strong> + [% loc('Problems within the boundary of:') %] + </strong></p> + <ul class="plain-list"> + [% ELSE %] + <ul id="rss_feed" class="plain-list"> + [% END %] + + [% FOREACH option IN options %] + <li[% IF ! (loop.count % 2) %] class="a"[% END %]> + <input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]> + <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16" +title="[% option.rss_text %]" alt="RSS feed" border="0"></a> + <label class="inline" for="[% option.id %]">[% option.text %]</label> + </li> + [% END %] +</ul> + [% IF reported_to_options %] + <p><strong> + [% loc('Or problems reported to:') %] + </strong></p> + <ul class="plain-list"> + [% FOREACH option IN reported_to_options %] + <li[% IF ! (loop.count % 2) %] class="a"[% END %]> + <input type="radio" name="feed" id="[% option.id %]" value="[% option.id %]"[% IF option.id == selected_feed %] checked[% END %]> + <a href="[% option.uri %]"><img src="/i/feed.png" width="16" height="16" + title="[% option.rss_text %]" alt="RSS feed" border="0"></a> + <label class="inline" for="[% option.id %]">[% option.text %]</label> + </li> + [% END %] + </ul> + <p><small> + [% loc( 'FixMyStreet sends different categories of problem +to the appropriate council, so problems within the boundary of a particular council +might not match the problems sent to that council. For example, a graffiti report +will be sent to the district council, so will appear in both of the district +council’s alerts, but will only appear in the "Within the boundary" alert +for the county council.' ) %] + </small></p> + [% END %] + + <input id="alert_rss_button" class="green-btn" type="submit" name="rss" value="[% loc('Give me an RSS feed') %]"> + + <p id="alert_or"> + [% loc('or') %] + </p> + + [% UNLESS c.user_exists %] + <label for="rznvy">[% loc('Your email') %]</label> + <input type="text" id="rznvy" name="rznvy" value="[% rznvy | html %]"> + [% END %] + <input id="alert_email_button" style="margin-top:1em;" class="green-btn" type="submit" name="alert" value="[% loc('Subscribe me to an email alert') %]"> + diff --git a/templates/web/barnet/alert/index.html b/templates/web/barnet/alert/index.html new file mode 100644 index 000000000..1cc39e130 --- /dev/null +++ b/templates/web/barnet/alert/index.html @@ -0,0 +1,38 @@ +[% INCLUDE 'header.html', title = loc('Local RSS feeds and email alerts'), bodyclass = 'twothirdswidthpage' %] + +<h1>[% loc('Local RSS feeds and email alerts') %]</h1> + +<p> +You can subscribe to an RSS feed and email alerts for problems, including alerts for all problems within Barnet or in a particular ward, or all problems within a certain distance of a particular location. To find out what alerts we have for you, please enter a Barnet postcode or street name and area +</p> + +[% IF location_offshore %] + <div class="error">[% loc('That location does not appear to be covered by a council, perhaps it is offshore - please try somewhere more specific.') %]</div> +[% ELSIF location_error %] + <div class="error">[% location_error %]</div> +[% ELSE %] + [% INCLUDE 'errors.html' %] +[% END %] + +<form method="get" action="/alert/list" class="full-width"> + <fieldset> + <div class="form-txt-submit-box"> + <input type="text" name="pc" value="[% pc | html %]" placeholder="[% tprintf(loc('e.g. ‘%s’ or ‘%s’'), c.cobrand.example_places) %]"> + <input class="green-btn" type="submit" value="[% loc('Go') %]"> + </div> + </fieldset> +</form> + +[% IF photos.size %] +<div class="sticky-sidebar"> + <aside> + <h2>[% loc('Some photos of recent reports') %]</h2> + [% FOREACH p IN photos %] + <a href="/report/[% p.id %]"><img border="0" height="100" + src="/photo/[% p.id %].tn.jpeg" alt="[% p.title | html %]" title="[% p.title | html %]"></a> + [% END %] + </aside> +</div> +[% END %] + +[% INCLUDE 'footer.html' %] diff --git a/templates/web/barnet/index.html b/templates/web/barnet/index.html new file mode 100644 index 000000000..0dfacf499 --- /dev/null +++ b/templates/web/barnet/index.html @@ -0,0 +1,99 @@ +[%# Assumes fixmystreet cobrand is using FMS map template - for bonus points preload all the right map elements. %] +[% map_js = BLOCK %] +<script> +yepnope.addPrefix( 'preload', function ( resource ) { + resource.noexec = true; + return resource; +}); +Modernizr.load({ + load: [ + "preload![% version('/js/OpenLayers.fixmystreet.js') %]", + "preload![% version('/js/map-OpenLayers.js') %]", + "preload![% version('/js/map-bing-ol.js') %]", + "preload![% version('/js/jquery.ba-hashchange.min.js') %]" + ] +}); +</script> +[% END %] + +[% INCLUDE 'header.html', title => '' , bodyclass => 'frontpage fullwidthpage' %] + +[% IF error %] + <p class="error">[% error %]</p> +[% END %] + + +<div id="front-main"> + <div id="front-main-container"> + <h1>[% loc('Report, view, or discuss local problems') %]</h1> + + <h2>[% loc('(like graffiti, fly tipping, broken paving slabs, or street lighting)') %]</h2> + + [% + 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> + <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> + +<div class="tablewrapper"> + <div id="front-howto"> + <h2>[% loc('How to report a problem') %]</h2> + + <ol class="big-numbers"> + <li>[% question %]</li> + <li>[% loc('Locate the problem on a map of the area') %]</li> + <li>[% loc('Enter details of the problem') %]</li> + </ol> + + <section class="full-width"> + [% INCLUDE "front/stats.html" %] + [% TRY %][% INCLUDE "front/tips.html" %][% CATCH file %][% END %] + </section> + </div> + + + [% + recent_photos = c.cobrand.recent_photos(5); + %] + + [% IF recent_photos.size %] + <div id="front-recently"> + <h2>[% loc('Recently reported problems') %]</h2> + + <section class="full-width"> + <ul class="issue-list-a"> + [% FOREACH p IN recent_photos %] + <li> + <a href="/report/[% p.id %]"> + <div class="text"> + <h4>[% p.title | html %]</h4> + <small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small> + </div> + <div class="img"> + <img alt="[% p.title | html %]" title="[% p.title | html %]" height="60" width="90" src="/photo/[% p.id %].fp.jpeg"> + </div> + </a> + </li> + [% END %] + </ul> + </section> + + </div> + [% END %] +</div> + + +<!-- [% TRY %][% INCLUDE 'front/news.html' %][% CATCH file %][% END %] --> + + +[% INCLUDE 'footer.html' pagefooter = 'yes' %] diff --git a/templates/web/barnet/report/new/councils_text_all.html b/templates/web/barnet/report/new/councils_text_all.html new file mode 100644 index 000000000..20152928b --- /dev/null +++ b/templates/web/barnet/report/new/councils_text_all.html @@ -0,0 +1,4 @@ +<p> +All the information you provide here will be sent to the <strong>relevant department</strong>. +[% loc('The subject and details of the problem will be public, plus your name if you give us permission.') %] +</p> diff --git a/templates/web/barnet/report/updates-sidebar-notes.html b/templates/web/barnet/report/updates-sidebar-notes.html new file mode 100644 index 000000000..9fff322a1 --- /dev/null +++ b/templates/web/barnet/report/updates-sidebar-notes.html @@ -0,0 +1 @@ + <p>[% loc( 'Please note that updates are not sent to the relevant department. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</p> diff --git a/templates/web/fixmystreet/report/display.html b/templates/web/fixmystreet/report/display.html index 0f650b7c2..6db70f5ad 100644 --- a/templates/web/fixmystreet/report/display.html +++ b/templates/web/fixmystreet/report/display.html @@ -56,7 +56,7 @@ [% IF c.cobrand.moniker != 'emptyhomes' %] <div class="general-sidebar-notes"> - <p>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</p> + [% INCLUDE 'report/updates-sidebar-notes.html' %] </div> [% END %] diff --git a/templates/web/fixmystreet/report/updates-sidebar-notes.html b/templates/web/fixmystreet/report/updates-sidebar-notes.html new file mode 100644 index 000000000..a622cc7da --- /dev/null +++ b/templates/web/fixmystreet/report/updates-sidebar-notes.html @@ -0,0 +1 @@ + <p>[% loc( 'Please note that updates are not sent to the council. If you leave your name it will be public. Your information will only be used in accordance with our <a href="/faq#privacy">privacy policy</a>' ) %]</p> |