aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Cobrand.pm18
-rw-r--r--perllib/Page.pm15
-rwxr-xr-xweb/index.cgi4
3 files changed, 16 insertions, 21 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index 9733e99ea..917e12a1e 100644
--- a/perllib/Cobrand.pm
+++ b/perllib/Cobrand.pm
@@ -7,7 +7,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: Cobrand.pm,v 1.34 2009-10-29 17:55:23 matthew Exp $
+# $Id: Cobrand.pm,v 1.35 2009-11-04 15:16:58 matthew Exp $
package Cobrand;
use strict;
@@ -201,22 +201,6 @@ sub recent {
}
}
-=item front_page
-
-Return a front page of the site
-
-=cut
-
-sub front_page {
- my ($cobrand, $q, %vars) = @_;
- my $handle = $cobrand ? cobrand_handle($cobrand) : undef;
- if ( !$cobrand || !$handle || ! $handle->can('front_page')){
- return '';
- } else {
- return $handle->front_page($q, %vars);
- }
-}
-
=item front_stats
Return a block of html for showing front stats for the site
diff --git a/perllib/Page.pm b/perllib/Page.pm
index b42c27291..9ff45fe02 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.198 2009-11-04 13:11:06 matthew Exp $
+# $Id: Page.pm,v 1.199 2009-11-04 15:16:58 matthew Exp $
#
package Page;
@@ -244,7 +244,8 @@ sub template_include {
(my $file = __FILE__) =~ s{/[^/]*?$}{};
my $template_file = $file . $template_root . $template;
$template_file = $file . template_root($q, 1) . $template unless -e $template_file;
-
+ return undef unless -e $template_file;
+
$template = Text::Template->new(
SOURCE => $template_file,
DELIMITERS => ['{{', '}}'],
@@ -680,6 +681,7 @@ sub send_email {
$action = 'your expression of interest will not be registered';
$worry = "we'll hang on to your expression of interest while you're checking your email.";
}
+
my $out = sprintf(_(<<EOF), $action, $worry);
<h1>Nearly Done! Now check your email...</h1>
<p>The confirmation email <strong>may</strong> take a few minutes to arrive &mdash; <em>please</em> be patient.</p>
@@ -688,6 +690,15 @@ sub send_email {
if you do not, %s.</p>
<p>(Don't worry &mdash; %s)</p>
EOF
+
+ my $cobrand = Page::get_cobrand($q);
+ my %vars = (
+ action => $action,
+ worry => $worry,
+ url_home => Cobrand::url($cobrand, '/', $q),
+ );
+ my $cobrand_email = Page::template_include('check-email', $q, Page::template_root($q), %vars);
+ return $cobrand_email if $cobrand_email;
return $out;
}
diff --git a/web/index.cgi b/web/index.cgi
index 18081a678..987f437b3 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: index.cgi,v 1.309 2009-11-04 14:22:57 matthew Exp $
+# $Id: index.cgi,v 1.310 2009-11-04 15:16:59 matthew Exp $
use strict;
use Standard;
@@ -119,7 +119,7 @@ sub front_page {
form_action => $form_action,
question => $question,
);
- my $cobrand_front_page = Cobrand::front_page($cobrand, $q, %vars);
+ my $cobrand_front_page = Page::template_include('front-page', $q, Page::template_root($q), %vars);
return $cobrand_front_page if $cobrand_front_page;
my $out = '<p id="expl"><strong>' . _('Report, view, or discuss local problems') . '</strong>';