diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-04-07 16:18:55 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-04-07 16:18:55 +0100 |
commit | 8fde4a3ca2a84cb4afbc5096e853e016e27ea35a (patch) | |
tree | 6e3375d58bd5672a4aad1ed77a63b98e9ffecdad | |
parent | 42d7669ab494f2b8bf7f2209a7ce06fd8a373bc5 (diff) |
added newsletter sign up
-rw-r--r-- | notes/catalyst-master-merge-todos.txt | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/View/Web.pm | 10 | ||||
-rw-r--r-- | templates/web/default/tokens/confirm_problem.html | 2 |
3 files changed, 9 insertions, 5 deletions
diff --git a/notes/catalyst-master-merge-todos.txt b/notes/catalyst-master-merge-todos.txt index a851d0681..ea0ec98cd 100644 --- a/notes/catalyst-master-merge-todos.txt +++ b/notes/catalyst-master-merge-todos.txt @@ -1,3 +1 @@ should we ditch flickr import? (does not seem to be getting huge usage and those using it would probably report using another method: http://www.flickr.com/search/?w=all&q=fixmystreet&m=tags) - -Add newsletter signup to bottom of problem confirm page diff --git a/perllib/FixMyStreet/App/View/Web.pm b/perllib/FixMyStreet/App/View/Web.pm index 75ca4dd81..c8240948d 100644 --- a/perllib/FixMyStreet/App/View/Web.pm +++ b/perllib/FixMyStreet/App/View/Web.pm @@ -6,6 +6,7 @@ use warnings; use mySociety::Locale; use FixMyStreet; +use CrossSell; __PACKAGE__->config( TEMPLATE_EXTENSION => '.html', @@ -14,7 +15,7 @@ __PACKAGE__->config( ], ENCODING => 'utf8', render_die => 1, - expose_methods => [ 'loc', 'nget', 'tprintf', ], + expose_methods => [ 'loc', 'nget', 'tprintf', 'display_crossell_advert' ], ); =head1 NAME @@ -78,7 +79,12 @@ sub display_crossell_advert { my ( $self, $c, $email, $name ) = @_; return unless $c->cobrand->allow_crosssell_adverts(); - return CrossSell::display_advert( $c->req, $email, $name ); + + # fake up the old style $q + my $q = { site => $c->cobrand->moniker, }; + $q->{site} = 'fixmystreet' if $q->{site} eq 'default'; + + return CrossSell::display_advert( $q, $email, $name ); } 1; diff --git a/templates/web/default/tokens/confirm_problem.html b/templates/web/default/tokens/confirm_problem.html index 23d5f52ee..aeff2cc9c 100644 --- a/templates/web/default/tokens/confirm_problem.html +++ b/templates/web/default/tokens/confirm_problem.html @@ -17,6 +17,6 @@ %] </p> -[% display_crossell_advert( problem.email, problem.name ) %] +[% display_crossell_advert( problem.user.email, problem.name ) %] [% INCLUDE 'footer.html' %] |