aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Problem.pm3
-rw-r--r--templates/web/fixmystreet/around/around_map_list_items.html6
-rw-r--r--templates/web/fixmystreet/around/on_map_list_items.html4
-rw-r--r--templates/web/fixmystreet/index.html23
4 files changed, 15 insertions, 21 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/Problem.pm b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
index 59227fce8..95d6a02d4 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Problem.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Problem.pm
@@ -122,7 +122,8 @@ sub around_map {
my $attr = {
order_by => { -desc => 'created' },
columns => [
- 'id', 'title' ,'latitude', 'longitude', 'state', 'confirmed'
+ 'id', 'title', 'latitude', 'longitude', 'state', 'confirmed',
+ { photo => 'photo is not null' },
],
};
$attr->{rows} = $limit if $limit;
diff --git a/templates/web/fixmystreet/around/around_map_list_items.html b/templates/web/fixmystreet/around/around_map_list_items.html
index fed53d279..edf8dcbf1 100644
--- a/templates/web/fixmystreet/around/around_map_list_items.html
+++ b/templates/web/fixmystreet/around/around_map_list_items.html
@@ -12,12 +12,14 @@
<small>[% loc('(fixed)') %]</small>
[% END %]
</div>
+ [% IF p.photo %]
<div class="img">
- <img height="60px" width="90px" src="/photo?id=[%p.id%];fp=1">
+ <img height="60" width="90" src="/photo?id=[% p.id %];fp=1" alt="">
</div>
+ [% END %]
</a>
</li>
[% END %]
[% ELSE %]
<li><p>[% loc('No problems found.') %]</p></li>
-[% END %] \ No newline at end of file
+[% END %]
diff --git a/templates/web/fixmystreet/around/on_map_list_items.html b/templates/web/fixmystreet/around/on_map_list_items.html
index ce5639665..3c3b66cf9 100644
--- a/templates/web/fixmystreet/around/on_map_list_items.html
+++ b/templates/web/fixmystreet/around/on_map_list_items.html
@@ -9,9 +9,11 @@
<small>[% loc('(fixed)') %]</small>
[% END %]
</div>
+ [% IF p.photo %]
<div class="img">
- <img height="60px" width="90px" src="/photo?id=[%p.id%];fp=1">
+ <img height="60" width="90" src="/photo?id=[% p.id %];fp=1" alt="">
</div>
+ [% END %]
</a>
</li>
[% END %]
diff --git a/templates/web/fixmystreet/index.html b/templates/web/fixmystreet/index.html
index 96f4dddb5..ddd1554d4 100644
--- a/templates/web/fixmystreet/index.html
+++ b/templates/web/fixmystreet/index.html
@@ -46,27 +46,16 @@
[%
- recent_photos = c.cobrand.recent_photos(3);
- probs = c.cobrand.recent();
+ recent_photos = c.cobrand.recent_photos(5);
%]
- [% IF probs.size || recent_photos.size %]
+ [% IF recent_photos.size %]
<div id="front-recently">
<h2>[% loc('Recently reported problems') %]</h2>
-<!-- [% IF recent_photos.size %]
- <p id="front_photos">
- [% FOREACH p IN recent_photos %]
- <a href="/report/[% p.id %]"><img border="0" height="100"
- src="/photo?tn=1;id=[% p.id %]" alt="[% p.title | html %]" title="[% p.title | html %]"></a>
- [% END %]
- </p>
- [% END %] -->
-
- [% IF probs.size %]
<section class="full-width">
<ul class="issue-list-a">
- [% FOREACH p IN probs %]
+ [% FOREACH p IN recent_photos %]
<li>
<a href="/report/[% p.id %]">
<div class="text">
@@ -74,14 +63,14 @@
<small>[% prettify_epoch( p.confirmed_local.epoch, 1 ) %]</small>
</div>
<div class="img">
- <img height="60px" width="90px" src="/photo?id=[%p.id%];fp=1">
+ <img alt="[% p.title | html %]" title="[% p.title | html %]" height="60" width="90" src="/photo?id=[% p.id %];fp=1">
</div>
</a>
</li>
[% END %]
</ul>
</section>
- [% END %]
+
</div>
[% END %]
</div>
@@ -116,4 +105,4 @@
<!-- [% TRY %][% INCLUDE 'front/news.html' %][% CATCH file %][% END %] -->
-[% INCLUDE 'footer.html' %] \ No newline at end of file
+[% INCLUDE 'footer.html' %]