diff options
author | Struan Donald <struan@exo.org.uk> | 2011-05-12 10:20:36 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-05-12 10:20:36 +0100 |
commit | f192e02e1a1a4ad6754e55ca7045c734f345c148 (patch) | |
tree | b2c8ae747a651a9a433363d390a39005525d461b | |
parent | 64f98502ae9d9c60973862f10ddae8fcce363f9d (diff) |
recent report photos for alerts front page
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Alert.pm | 8 | ||||
-rw-r--r-- | templates/web/default/alert/index.html | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Alert.pm b/perllib/FixMyStreet/App/Controller/Alert.pm index f88e57d1a..3a968ee1d 100644 --- a/perllib/FixMyStreet/App/Controller/Alert.pm +++ b/perllib/FixMyStreet/App/Controller/Alert.pm @@ -56,11 +56,9 @@ sub index : Path('') : Args(0) { # my $cobrand_page = Page::template_include('alert-front-page', $q, Page::template_root($q), %vars); # $out = $cobrand_page if ($cobrand_page); # -# return $out if $q->referer() && $q->referer() =~ /fixmystreet\.com/; -# my $recent_photos = Cobrand::recent_photos($cobrand, 10); -# $out .= '<div id="alert_recent">' . $q->h2(_('Some photos of recent reports')) . $recent_photos . '</div>' if $recent_photos; -# -# return $out; + unless ( $c->req->referer && $c->req->referer =~ /fixmystreet\.com/ ) { + $c->stash->{photos} = $c->cobrand->recent_photos(10); + } } sub list : Path('list') : Args(0) { diff --git a/templates/web/default/alert/index.html b/templates/web/default/alert/index.html index 908b1b120..da057f785 100644 --- a/templates/web/default/alert/index.html +++ b/templates/web/default/alert/index.html @@ -23,6 +23,12 @@ within a certain distance of a particular location.') %] </p> </form> +[% IF photos %] +<div id="alert_recent"> + <h2>[% loc('Some photos of recent reports') %]</h2> + [% photos %] +</div> +[% END %] [%# FIXME - put in blurb here %] [% INCLUDE 'footer.html' %] |