diff options
Diffstat (limited to 'perllib/CrossSell.pm')
-rw-r--r-- | perllib/CrossSell.pm | 90 |
1 files changed, 34 insertions, 56 deletions
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm index e40f2166f..9235d0a03 100644 --- a/perllib/CrossSell.pm +++ b/perllib/CrossSell.pm @@ -62,7 +62,7 @@ sub display_random_twfy_alerts_advert { <input type="hidden" name="site" value="fms"> <input style="font-size:150%" type="submit" value="#; $text =~ s#\[/button\]#"></p>#; - return '<div id="advert_thin" style="text-align:center">' . $text . '</div>'; + return '<div id="advert_thin">' . $text . '</div>'; } sub display_hfyc_cheltenham_advert { @@ -113,7 +113,7 @@ EOF sub display_democracyclub { my (%input) = @_; return <<EOF; -<div id="advert_thin" style="text-align:center"> +<div id="advert_thin"> <h2 style="margin-bottom:0">Help make the next election the most accountable ever</h2> <p style="font-size:120%;margin-top:0.5em;"><a href="http://www.democracyclub.org.uk/">Join Democracy Club</a> and have fun keeping an eye on your election candidates. <a href="http://www.democracyclub.org.uk/">Sign me up</a>! </div> EOF @@ -143,38 +143,6 @@ details. You can unsubscribe at any time.</p> EOF } -sub display_tms_form { - my (%input) = @_; - my %input_h = map { $_ => $input{$_} ? ent($input{$_}) : '' } qw(name email postcode mobile signed_email); - my $auth_signature = $input_h{signed_email}; - return <<EOF; -<h1 style="padding-top:0.5em">Coming Soon: TextMyStreet</h1> - -<p>Exclusive to FixMyStreet users: Sign up for a <strong>brand new</strong>, not-yet-launched -service which will make it easy to send short messages to other people on <strong>your -street</strong> and just round the corner.</p> - -<p>Use it to borrow a strimmer, discuss the weather or report a <strong>lost cat</strong>.</p> - -<form action="/tms-signup" method="post"> -<input type="hidden" name="signed_email" value="$auth_signature"> -<label for="name">Name:</label> -<input type="text" name="name" id="name" value="$input_h{name}" size="30"> -<br><label for="email">Email:</label> -<input type="text" name="email" id="email" value="$input_h{email}" size="30"> -<br><label for="postcode">Postcode:</label> -<input type="text" name="postcode" id="postcode" value="$input_h{postcode}" size="11"> -<br><label for="mobile">Mobile:</label> <input type="text" name="mobile" id="mobile" value="$input_h{mobile}" size="11"> - <input type="submit" class="submit" value="Sign up"> -</form> - -<p>mySociety respects your privacy, and we'll never sell or give away your private -details. Once we launch we'll send you some emails and perhaps some texts -explaining how it works, and it'll never cost you a penny unless we explicitly -say it will. You'll be able to <strong>unsubscribe</strong> at any time.</p> -EOF -} - # Not currently used, needs more explanation and testing; perhaps in future. sub display_gny_groups { my ($lon, $lat) = @_; @@ -197,39 +165,49 @@ EOF # Choose appropriate advert and display it. # $this_site is to stop a site advertising itself. sub display_advert ($$;$%) { - my ($q, $email, $name, %data) = @_; + my ($c, $email, $name, %data) = @_; - return '' unless $q->{site} eq 'fixmystreet'; + return '' unless $c->cobrand->is_default; - if (defined $data{council} && $data{council} eq '2326') { - my ($out, $ad) = display_hfyc_cheltenham_advert($email, $name); - if ($out) { - $q->{scratch} = "advert=$ad"; - return $out; - } - } + #if (defined $data{council} && $data{council} eq '2326') { + # my ($out, $ad) = display_hfyc_cheltenham_advert($email, $name); + # if ($out) { + # $c->stash->{scratch} = "advert=$ad"; + # return $out; + # } + #} #if ($data{lat}) { # my $out = display_gny_groups($data{lon}, $data{lat}); # if ($out) { - # $q->{scratch} = 'advert=gnygroups'; + # $c->stash->{scratch} = 'advert=gnygroups'; # return '<div style="margin: 0 5em; border-top: dotted 1px #666666;">' # . $out . '</div>'; # } #} - #$q->{scratch} = 'advert=demclub0'; + #$c->stash->{scratch} = 'advert=demclub0'; #return display_democracyclub(); + return <<EOF; +<div id="advert_thin"> +<p>Do you have an issue that’s too big for FixMyStreet? +It could be time to petition your council. Try our new site: +<h2 style="margin-top:0; font-size: 150%"> +<a href="http://www.petitionyourcouncil.com/">PetitionYourCouncil</a></p> +</h2> +</div> +EOF + #unless (defined $data{done_tms} && $data{done_tms}==1) { - $q->{scratch} = 'advert=news'; - my $auth_signature = ''; - unless (defined $data{emailunvalidated} && $data{emailunvalidated}==1) { - $auth_signature = mySociety::AuthToken::sign_with_shared_secret($email, mySociety::Config::get('AUTH_SHARED_SECRET')); - } - return '<div style="margin: 0 5em; border-top: dotted 1px #666666;">' - . display_news_form(email => $email, name => $name, signed_email => $auth_signature) - . '</div>'; + #$c->stash->{scratch} = 'advert=news'; + #my $auth_signature = ''; + #unless (defined $data{emailunvalidated} && $data{emailunvalidated}==1) { + # $auth_signature = mySociety::AuthToken::sign_with_shared_secret($email, mySociety::Config::get('AUTH_SHARED_SECRET')); + #} + #return '<div style="margin: 0 5em; border-top: dotted 1px #666666;">' + # . display_news_form(email => $email, name => $name, signed_email => $auth_signature) + # . '</div>'; #} my @adverts = ( @@ -250,7 +228,7 @@ sub display_advert ($$;$%) { my $out = &$func($email, $name, $advert_text); use strict 'refs'; if ($out) { - $q->{scratch} = "advert=$advert_id"; + $c->stash->{scratch} = "advert=$advert_id"; return $out; } @@ -260,9 +238,9 @@ sub display_advert ($$;$%) { } } - $q->{scratch} = 'advert=pb'; + $c->stash->{scratch} = 'advert=pb'; return <<EOF; -<div id="advert_thin" style="text-align:center"> +<div id="advert_thin"> <h2 style="font-size: 150%"> If you're interested in improving your local area, <a href="http://www.pledgebank.com/">use PledgeBank</a> to |