diff options
23 files changed, 147 insertions, 181 deletions
diff --git a/bin/send-comments b/bin/send-comments index 2d6b525b5..fabf2b633 100755 --- a/bin/send-comments +++ b/bin/send-comments @@ -145,7 +145,7 @@ while ( my $body = $bodies->next ) { sub bromley_retry_timeout { my $row = shift; - my $tz = DateTime::TimeZone->new( name => 'local' ); + my $tz = FixMyStreet->local_time_zone; my $now = DateTime->now( time_zone => $tz ); my $diff = $now - $row->send_fail_timestamp; if ( $diff->in_units( 'minutes' ) < 30 ) { diff --git a/perllib/FixMyStreet.pm b/perllib/FixMyStreet.pm index f3b72c4d0..76760b967 100644 --- a/perllib/FixMyStreet.pm +++ b/perllib/FixMyStreet.pm @@ -6,6 +6,7 @@ use warnings; use Path::Class; my $ROOT_DIR = file(__FILE__)->parent->parent->absolute->resolve; +use DateTime::TimeZone; use Readonly; use Sub::Override; @@ -217,4 +218,23 @@ sub get_email_template { return $template; } +my $tz = DateTime::TimeZone->new( name => "local" ); +my $tz_f; +$tz_f = DateTime::TimeZone->new( name => FixMyStreet->config('TIME_ZONE') ) + if FixMyStreet->config('TIME_ZONE'); + +sub local_time_zone { + return $tz; +} + +sub time_zone { + return $tz_f; +} + +sub set_time_zone { + my ($class, $dt) = @_; + $dt->set_time_zone($tz); + $dt->set_time_zone($tz_f) if $tz_f; +} + 1; diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 25c6e1923..c2b0a2ee2 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -128,7 +128,7 @@ sub index : Path : Args(0) { my $dtf = $c->model('DB')->storage->datetime_parser; my %counts; - my $now = DateTime->now( time_zone => 'local' ); + my $now = DateTime->now( time_zone => FixMyStreet->local_time_zone ); my $t = $now->clone->truncate( to => 'day' ); $counts{wtd} = $c->forward( 'updates_search', [ $dtf->format_datetime( $t->clone->subtract( days => $t->dow - 1 ) ) ] ); diff --git a/perllib/FixMyStreet/DB/Result/Alert.pm b/perllib/FixMyStreet/DB/Result/Alert.pm index 4ce72f873..c64cb2ff4 100644 --- a/perllib/FixMyStreet/DB/Result/Alert.pm +++ b/perllib/FixMyStreet/DB/Result/Alert.pm @@ -69,24 +69,16 @@ __PACKAGE__->belongs_to( # You can replace this text with custom code or comments, and it will be preserved on regeneration -use DateTime::TimeZone; use Moose; use namespace::clean -except => [ 'meta' ]; with 'FixMyStreet::Roles::Abuser'; -my $tz = DateTime::TimeZone->new( name => "local" ); - -my $tz_f; -$tz_f = DateTime::TimeZone->new( name => FixMyStreet->config('TIME_ZONE') ) - if FixMyStreet->config('TIME_ZONE'); - my $stz = sub { my ( $orig, $self ) = ( shift, shift ); my $s = $self->$orig(@_); return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - $s->set_time_zone($tz); - $s->set_time_zone($tz_f) if $tz_f; + FixMyStreet->set_time_zone($s); return $s; }; diff --git a/perllib/FixMyStreet/DB/Result/Comment.pm b/perllib/FixMyStreet/DB/Result/Comment.pm index 3fae6860a..836462ed5 100644 --- a/perllib/FixMyStreet/DB/Result/Comment.pm +++ b/perllib/FixMyStreet/DB/Result/Comment.pm @@ -95,25 +95,17 @@ __PACKAGE__->belongs_to( __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); -use DateTime::TimeZone; use Image::Size; use Moose; use namespace::clean -except => [ 'meta' ]; with 'FixMyStreet::Roles::Abuser'; -my $tz = DateTime::TimeZone->new( name => "local" ); - -my $tz_f; -$tz_f = DateTime::TimeZone->new( name => FixMyStreet->config('TIME_ZONE') ) - if FixMyStreet->config('TIME_ZONE'); - my $stz = sub { my ( $orig, $self ) = ( shift, shift ); my $s = $self->$orig(@_); return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - $s->set_time_zone($tz); - $s->set_time_zone($tz_f) if $tz_f; + FixMyStreet->set_time_zone($s); return $s; }; diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm index 34d740912..3c620ba84 100644 --- a/perllib/FixMyStreet/DB/Result/Problem.pm +++ b/perllib/FixMyStreet/DB/Result/Problem.pm @@ -153,7 +153,6 @@ __PACKAGE__->load_components("+FixMyStreet::DB::RABXColumn"); __PACKAGE__->rabx_column('extra'); __PACKAGE__->rabx_column('geocode'); -use DateTime::TimeZone; use Image::Size; use Moose; use namespace::clean -except => [ 'meta' ]; @@ -316,18 +315,11 @@ sub council_states { return wantarray ? keys %{$states} : $states; } -my $tz = DateTime::TimeZone->new( name => "local" ); - -my $tz_f; -$tz_f = DateTime::TimeZone->new( name => FixMyStreet->config('TIME_ZONE') ) - if FixMyStreet->config('TIME_ZONE'); - my $stz = sub { my ( $orig, $self ) = ( shift, shift ); my $s = $self->$orig(@_); return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - $s->set_time_zone($tz); - $s->set_time_zone($tz_f) if $tz_f; + FixMyStreet->set_time_zone($s); return $s; }; @@ -745,7 +737,7 @@ sub update_from_open311_service_request { # of course if local timezone is not the one that went into the data # base then we're also in trouble my $lastupdate = $self->lastupdate; - $lastupdate->set_time_zone( DateTime::TimeZone->new( name => 'local' ) ); + $lastupdate->set_time_zone( FixMyStreet->local_time_zone ); # update from open311 is older so skip if ( $req_time < $lastupdate ) { diff --git a/perllib/FixMyStreet/DB/Result/Questionnaire.pm b/perllib/FixMyStreet/DB/Result/Questionnaire.pm index 7f9c79d9a..6f2941546 100644 --- a/perllib/FixMyStreet/DB/Result/Questionnaire.pm +++ b/perllib/FixMyStreet/DB/Result/Questionnaire.pm @@ -43,22 +43,14 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07035 @ 2013-09-10 17:11:54 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oL1Hk4/bNG14CY74GA75SA -use DateTime::TimeZone; use Moose; use namespace::clean -except => [ 'meta' ]; -my $tz = DateTime::TimeZone->new( name => "local" ); - -my $tz_f; -$tz_f = DateTime::TimeZone->new( name => FixMyStreet->config('TIME_ZONE') ) - if FixMyStreet->config('TIME_ZONE'); - my $stz = sub { my ( $orig, $self ) = ( shift, shift ); my $s = $self->$orig(@_); return $s unless $s && UNIVERSAL::isa($s, "DateTime"); - $s->set_time_zone($tz); - $s->set_time_zone($tz_f) if $tz_f; + FixMyStreet->set_time_zone($s); return $s; }; diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index b704fa7dd..ad180cbd5 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -115,24 +115,14 @@ sub email_alerts ($) { } $data{data} .= $row->{item_name} . ' : ' if $row->{item_name} && !$row->{item_anonymous}; if ( $cobrand->include_time_in_update_alerts ) { - # this is basically recreating the code from the inflate wrapper - # in the database model. - my $tz; - if ( FixMyStreet->config('TIME_ZONE') ) { - $tz = FixMyStreet->config('TIME_ZONE'); - } - my $parser = DateTime::Format::Pg->new(); my $dt = $parser->parse_timestamp( $row->{item_confirmed} ); - my $l_tz = DateTime::TimeZone->new( name => "local" ); # We need to always set this otherwise we end up with the DateTime # object being in the floating timezone in which case applying a # subsequent timezone set will have no effect. - $dt->set_time_zone( $l_tz ); - if ( $tz ) { - my $tz_obj = DateTime::TimeZone->new( name => $tz ); - $dt->set_time_zone( $tz_obj ); - } + # this is basically recreating the code from the inflate wrapper + # in the database model. + FixMyStreet->set_time_zone($dt); $data{data} .= $cobrand->prettify_dt( $dt, 'alert' ) . "\n\n"; } $data{data} .= $row->{item_text} . "\n\n------\n\n"; diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm index bf1681b70..aac52fbaa 100644 --- a/perllib/FixMyStreet/Geocode.pm +++ b/perllib/FixMyStreet/Geocode.pm @@ -7,6 +7,11 @@ package FixMyStreet::Geocode; use strict; +use Digest::MD5 qw(md5_hex); +use Encode; +use File::Slurp; +use File::Path (); +use LWP::Simple qw($ua); use URI::Escape; use FixMyStreet::Geocode::Bing; use FixMyStreet::Geocode::Google; @@ -61,4 +66,25 @@ sub escape { return $s; } +sub cache { + my ($type, $url, $args, $re) = @_; + my $cache_dir = FixMyStreet->config('GEO_CACHE') . $type . '/'; + my $cache_file = $cache_dir . md5_hex($url); + my $js; + if (-s $cache_file && -M $cache_file <= 7) { + $js = File::Slurp::read_file($cache_file); + } else { + $url .= '&' . $args if $args; + $ua->timeout(15); + $js = LWP::Simple::get($url); + $js = encode_utf8($js) if utf8::is_utf8($js); + File::Path::mkpath($cache_dir); + if ($js && (!$re || $js !~ $re)) { + File::Slurp::write_file($cache_file, $js); + } + } + $js = JSON->new->utf8->allow_nonref->decode($js) if $js; + return $js; +} + 1; diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm index 61e04d3d5..d7db10ae6 100644 --- a/perllib/FixMyStreet/Geocode/Bing.pm +++ b/perllib/FixMyStreet/Geocode/Bing.pm @@ -7,11 +7,6 @@ package FixMyStreet::Geocode::Bing; use strict; -use Encode; -use File::Slurp; -use File::Path (); -use LWP::Simple; -use Digest::MD5 qw(md5_hex); use Utils; @@ -34,24 +29,10 @@ sub string { $url .= '&userLocation=' . $params->{centre} if $params->{centre}; $url .= '&c=' . $params->{bing_culture} if $params->{bing_culture}; - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'bing/'; - my $cache_file = $cache_dir . md5_hex($url); - my $js; - if (-s $cache_file) { - $js = File::Slurp::read_file($cache_file); - } else { - $url .= '&key=' . FixMyStreet->config('BING_MAPS_API_KEY'); - $js = LWP::Simple::get($url); - $js = encode_utf8($js) if utf8::is_utf8($js); - File::Path::mkpath($cache_dir); - File::Slurp::write_file($cache_file, $js) if $js; - } - + my $js = FixMyStreet::Geocode::cache('bing', $url, 'key=' . FixMyStreet->config('BING_MAPS_API_KEY')); if (!$js) { return { error => _('Sorry, we could not parse that location. Please try again.') }; } - - $js = JSON->new->utf8->allow_nonref->decode($js); if ($js->{statusCode} ne '200') { return { error => _('Sorry, we could not find that location.') }; } @@ -87,33 +68,15 @@ sub string { } sub reverse { - my ( $latitude, $longitude, $bing_culture, $cache ) = @_; + my ( $latitude, $longitude, $bing_culture ) = @_; # Get nearest road-type thing from Bing my $key = mySociety::Config::get('BING_MAPS_API_KEY', ''); if ($key) { my $url = "http://dev.virtualearth.net/REST/v1/Locations/$latitude,$longitude?key=$key"; $url .= '&c=' . $bing_culture if $bing_culture; - my $j; - if ( $cache ) { - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'bing/'; - my $cache_file = $cache_dir . md5_hex($url); - - if (-s $cache_file) { - $j = File::Slurp::read_file($cache_file); - } else { - $j = LWP::Simple::get($url); - File::Path::mkpath($cache_dir); - File::Slurp::write_file($cache_file, $j) if $j; - } - } else { - $j = LWP::Simple::get($url); - } - - if ($j) { - $j = JSON->new->utf8->allow_nonref->decode($j); - return $j; - } + my $j = FixMyStreet::Geocode::cache('bing', $url); + return $j if $j; } return undef; diff --git a/perllib/FixMyStreet/Geocode/FixaMinGata.pm b/perllib/FixMyStreet/Geocode/FixaMinGata.pm index 5c6851011..3ad98b148 100644 --- a/perllib/FixMyStreet/Geocode/FixaMinGata.pm +++ b/perllib/FixMyStreet/Geocode/FixaMinGata.pm @@ -15,11 +15,7 @@ package FixMyStreet::Geocode::FixaMinGata; use warnings; use strict; -use Digest::MD5 qw(md5_hex); -use Encode; -use File::Slurp; -use File::Path (); -use LWP::Simple qw($ua); +use LWP::Simple; use Memcached; use XML::Simple; use Utils; @@ -55,25 +51,11 @@ sub string { if $params->{country}; $url .= join('&', map { "$_=$query_params{$_}" } keys %query_params); - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'osm/'; - my $cache_file = $cache_dir . md5_hex($url); - my $js; - if (-s $cache_file) { - $js = File::Slurp::read_file($cache_file); - } else { - $ua->timeout(15); - $js = LWP::Simple::get($url); - $js = encode_utf8($js) if utf8::is_utf8($js); - File::Path::mkpath($cache_dir); - File::Slurp::write_file($cache_file, $js) if $js; - } - + my $js = FixMyStreet::Geocode::cache('osm', $url); if (!$js) { return { error => _('Sorry, we could not find that location.') }; } - $js = JSON->new->utf8->allow_nonref->decode($js); - my ( %locations, $error, @valid_locations, $latitude, $longitude ); foreach (@$js) { next if $_->{class} eq "boundary"; diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm index d83920a81..35fcec36f 100644 --- a/perllib/FixMyStreet/Geocode/Google.pm +++ b/perllib/FixMyStreet/Geocode/Google.pm @@ -7,11 +7,6 @@ package FixMyStreet::Geocode::Google; use strict; -use Encode; -use File::Slurp; -use File::Path (); -use LWP::Simple; -use Digest::MD5 qw(md5_hex); use Utils; # string STRING CONTEXT @@ -24,6 +19,13 @@ sub string { my $params = $c->cobrand->disambiguate_location($s); + # For some reason adding gl=uk is no longer sufficient to make google + # think we are in the UK for some locations so we explictly add UK to + # the address. + if ($c->cobrand->country eq 'GB' && $s !~ /, *UK/ && $s !~ /united *kingdom$/) { + $s .= ', UK'; + } + $s = FixMyStreet::Geocode::escape($s); my $url = 'http://maps.google.com/maps/geo?q=' . $s; @@ -36,38 +38,11 @@ sub string { } $url .= '&hl=' . $params->{lang} if $params->{lang}; - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'google/'; - my $cache_file = $cache_dir . md5_hex($url); - my $js; - if (-s $cache_file) { - $js = File::Slurp::read_file($cache_file); - } else { - # For some reason adding gl=uk is no longer sufficient to make google - # think we are in the UK for some locations so we explictly add UK to - # the address. We do it here so as not to invalidate existing cache - # entries - if ( $c->cobrand->country eq 'GB' - && $url !~ /,\+UK/ - && $url !~ /united\++kingdom$/ ) - { - if ( $url =~ /&/ ) { - $url =~ s/&/,+UK&/; - } else { - $url .= ',+UK'; - } - } - $url .= '&sensor=false&key=' . FixMyStreet->config('GOOGLE_MAPS_API_KEY'); - $js = LWP::Simple::get($url); - $js = encode_utf8($js) if utf8::is_utf8($js); - File::Path::mkpath($cache_dir); - File::Slurp::write_file($cache_file, $js) if $js && $js !~ /"code":6[12]0/; - } - + my $args = 'sensor=false&key=' . FixMyStreet->config('GOOGLE_MAPS_API_KEY'); + my $js = FixMyStreet::Geocode::cache('google', $url, $args, qr/"code":6[12]0/); if (!$js) { return { error => _('Sorry, we could not parse that location. Please try again.') }; } - - $js = JSON->new->utf8->allow_nonref->decode($js); if ($js->{Status}->{code} ne '200') { return { error => _('Sorry, we could not find that location.') }; } diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm index 082d8fbc1..f165963d7 100644 --- a/perllib/FixMyStreet/Geocode/OSM.pm +++ b/perllib/FixMyStreet/Geocode/OSM.pm @@ -9,11 +9,7 @@ package FixMyStreet::Geocode::OSM; use warnings; use strict; -use Digest::MD5 qw(md5_hex); -use Encode; -use File::Slurp; -use File::Path (); -use LWP::Simple qw($ua); +use LWP::Simple; use Memcached; use XML::Simple; use Utils; @@ -47,25 +43,11 @@ sub string { if $params->{country}; $url .= join('&', map { "$_=$query_params{$_}" } keys %query_params); - my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'osm/'; - my $cache_file = $cache_dir . md5_hex($url); - my $js; - if (-s $cache_file) { - $js = File::Slurp::read_file($cache_file); - } else { - $ua->timeout(15); - $js = LWP::Simple::get($url); - $js = encode_utf8($js) if utf8::is_utf8($js); - File::Path::mkpath($cache_dir); - File::Slurp::write_file($cache_file, $js) if $js; - } - + my $js = FixMyStreet::Geocode::cache('osm', $url); if (!$js) { return { error => _('Sorry, we could not find that location.') }; } - $js = JSON->new->utf8->allow_nonref->decode($js); - my ( $error, @valid_locations, $latitude, $longitude ); foreach (@$js) { ( $latitude, $longitude ) = diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm index 7de2cc272..aad918b0e 100644 --- a/perllib/FixMyStreet/Geocode/Zurich.pm +++ b/perllib/FixMyStreet/Geocode/Zurich.pm @@ -66,7 +66,7 @@ sub string { my $cache_dir = FixMyStreet->config('GEO_CACHE') . 'zurich/'; my $cache_file = $cache_dir . md5_hex($s); my $result; - if (-s $cache_file) { + if (-s $cache_file && -M $cache_file <= 7) { $result = retrieve($cache_file); } else { my $search = SOAP::Data->name('search' => $s)->type(''); diff --git a/perllib/FixMyStreet/SendReport.pm b/perllib/FixMyStreet/SendReport.pm index 40e76ef72..9967b0663 100644 --- a/perllib/FixMyStreet/SendReport.pm +++ b/perllib/FixMyStreet/SendReport.pm @@ -23,8 +23,7 @@ sub should_skip { return 0 unless $row->send_fail_count; - my $tz = DateTime::TimeZone->new( name => 'local' ); - my $now = DateTime->now( time_zone => $tz ); + my $now = DateTime->now( time_zone => FixMyStreet->local_time_zone ); my $diff = $now - $row->send_fail_timestamp; my $backoff = $row->send_fail_count > 1 ? 30 : 5; diff --git a/perllib/Utils.pm b/perllib/Utils.pm index 7f95d1f5a..87e0bd7c9 100644 --- a/perllib/Utils.pm +++ b/perllib/Utils.pm @@ -225,7 +225,7 @@ sub prettify_dt { $type ||= ''; $type = 'short' if $type eq '1'; - my $now = DateTime->now( time_zone => FixMyStreet->config('TIME_ZONE') || 'local' ); + my $now = DateTime->now( time_zone => FixMyStreet->time_zone || FixMyStreet->local_time_zone ); my $tt = ''; return "[unknown time]" unless ref $dt; diff --git a/templates/web/fixmystreet.com/static/posters.html b/templates/web/fixmystreet.com/static/posters.html index 2e26ad40e..4bd613fd9 100644 --- a/templates/web/fixmystreet.com/static/posters.html +++ b/templates/web/fixmystreet.com/static/posters.html @@ -11,6 +11,27 @@ badge = '<a href="https://www.fixmystreet.com/"> <img src="https://www.fixmystreet.com/i/fms-badge.jpeg" alt="FixMyStreet - report, view or discuss local problems" border="0"></a>' %] +<script> + +$("[data-goodielink]").on(click, function(e){ + var url = $(this).attr('href') + var name = $(this).attr('data-goodielink') + var callback = function(){ + window.location.href = url + } + if(e.metaKey || e.ctrlKey){ + callback = function(){} + } else { + e.preventDefault() + } + ga('send', 'event', 'goodie', 'download', name, { + 'hitCallback': callback + }) + setTimeout(callback, 2000); +}); + +</script> + <div class="sticky-sidebar"> <aside> <ul class="plain-list"> @@ -45,7 +66,7 @@ <li>Ideas for letting more people know about FixMyStreet</li> </ul> -<a href="/cobrands/fixmystreet/posters/activist-pack.zip" class="download-button">Download ZIP file</a> +<a href="/cobrands/fixmystreet/posters/activist-pack.zip" data-goodielink="activist-pack" class="download-button">Download ZIP file</a> <h2 id="school-pack">Activity Pack for Schools, Brownies, and Scouts</h2> @@ -59,7 +80,7 @@ <li>Ideas for activities</li> </ul> -<a href="/cobrands/fixmystreet/posters/schools-clubs-pack.zip" class="download-button">Download ZIP file</a> +<a href="/cobrands/fixmystreet/posters/schools-clubs-pack.zip" data-goodielink="schools-clubs-pack" class="download-button">Download ZIP file</a> <h2 id="community-pack">Community Group Pack</h2> @@ -75,7 +96,7 @@ <li>Instructions for including a feed of local FixMyStreet reports on your site or blog</li> </ul> -<a href="/cobrands/fixmystreet/posters/community-group-pack.zip" class="download-button">Download ZIP file</a> +<a href="/cobrands/fixmystreet/posters/community-group-pack.zip" data-goodielink="community-group-pack" class="download-button">Download ZIP file</a> <h2 id="web">Website Badge</h2> @@ -88,19 +109,19 @@ <h2 id="print">Printed Materials</h2> <ul class="downloads"> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-poster-a4.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-poster-a4.pdf" data-goodielink="fixmystreet-poster-a4"> <img src="/cobrands/fixmystreet/images/a4-poster.png"> <strong>A4 poster</strong> Ideal for a noticeboard at work, in the library, corner shop… wherever your community will see it. </a></li> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-flyers-a5.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-flyers-a5.pdf" data-goodielink="fixmystreet-flyers-a5"> <img src="/cobrands/fixmystreet/images/a5-flyers.png"> <strong>A5 flyers (2 to a sheet)</strong> Perfect for handing out to friends or posting to subscribers. </a></li> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-flyers-a6.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-flyers-a6.pdf" data-goodielink="fixmystreet-flyers-a6"> <img src="/cobrands/fixmystreet/images/a6-flyers.png"> <strong>A6 flyers (4 to a sheet)</strong> Great for cafés, pubs, or meetings. </a></li> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-poop-flags.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-poop-flags.pdf" data-goodielink="fixmystreet-poop-flags"> <img src="/cobrands/fixmystreet/images/dog-poop-flags.png"> <strong>Doggy poop flags (4 to a sheet)</strong> Take a stand against dog-fouling with our home-made flags. Some assembly required! </a></li> @@ -111,15 +132,15 @@ <p>Ideal for promoting FixMyStreet in your community newsletter or local magazine. Specially designed to stand out, and get your message across!</p> <ul class="downloads"> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-90x130.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-90x130.pdf" data-goodielink="fixmystreet-advert-90x130"> <img src="/cobrands/fixmystreet/images/advert-90x130.png"> <strong>Quarter page advert</strong> (9cm wide, 13cm high) </a></li> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-90x60.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-90x60.pdf" data-goodielink="fixmystreet-advert-90x60"> <img src="/cobrands/fixmystreet/images/advert-90x60.png"> <strong>One-eighth page advert</strong> (9cm wide, 6cm high) </a></li> - <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-40x60.pdf"> + <li><a href="/cobrands/fixmystreet/posters/fixmystreet-advert-40x60.pdf" data-goodielink="fixmystreet-advert-40x60"> <img src="/cobrands/fixmystreet/images/advert-40x60.png"> <strong>One-sixteenth page advert</strong> (4cm wide, 6cm high) </a></li> diff --git a/templates/web/trinidadtobago/header_logo.html b/templates/web/trinidadtobago/header_logo.html new file mode 100644 index 000000000..d5da7e6b2 --- /dev/null +++ b/templates/web/trinidadtobago/header_logo.html @@ -0,0 +1 @@ + <a href="[% c.config.BASE_URL %]/" id="site-logo">[% PROCESS 'site-name.html' -%]</a> diff --git a/templates/web/trinidadtobago/site-name.html b/templates/web/trinidadtobago/site-name.html new file mode 100644 index 000000000..d9c3f19c7 --- /dev/null +++ b/templates/web/trinidadtobago/site-name.html @@ -0,0 +1 @@ +FixMyStreeTT diff --git a/web/cobrands/trinidadtobago/base.scss b/web/cobrands/trinidadtobago/base.scss index 9fccf92db..77f91f57d 100644 --- a/web/cobrands/trinidadtobago/base.scss +++ b/web/cobrands/trinidadtobago/base.scss @@ -5,3 +5,29 @@ @import "../sass/base"; +#site-header { + background: #fff; +} + + +#site-logo { + display: block; + width: 175px; + height: 40px; + top: 0.4em; + background: url("/cobrands/trinidadtobago/images/sprite.png") -3px -3px no-repeat; + text-indent: -999999px; + position: absolute; + z-index: 2 +} + +#nav-link { + width: 50px; + height: 48px; + background: url("/cobrands/trinidadtobago/images/sprite.png") -5px -916px no-repeat; + display: block; + text-indent: -999999px; + position: absolute; + right: 2em; + top: -2px +}
\ No newline at end of file diff --git a/web/cobrands/trinidadtobago/fixmystreett.png b/web/cobrands/trinidadtobago/fixmystreett.png Binary files differnew file mode 100644 index 000000000..4d0388f19 --- /dev/null +++ b/web/cobrands/trinidadtobago/fixmystreett.png diff --git a/web/cobrands/trinidadtobago/images/sprite.png b/web/cobrands/trinidadtobago/images/sprite.png Binary files differnew file mode 100644 index 000000000..6094712f1 --- /dev/null +++ b/web/cobrands/trinidadtobago/images/sprite.png diff --git a/web/cobrands/trinidadtobago/layout.scss b/web/cobrands/trinidadtobago/layout.scss index 67cc7307f..43783b58b 100644 --- a/web/cobrands/trinidadtobago/layout.scss +++ b/web/cobrands/trinidadtobago/layout.scss @@ -4,3 +4,15 @@ .big-green-banner { background-color: $trinidad_primary; } + +#site-logo, +body.frontpage #site-logo { + margin-top: -10px; + margin-left: 10px; + height: 100px; + background: url(fixmystreett.png) 0px 0px no-repeat; + background-size: contain; +} +body.frontpage #site-logo { + margin-top: -20px; +}
\ No newline at end of file |