CodeforAustralia / heritage-near-me

🔎 Heritage Near Me web app prototype
23 stars 6 forks source link

text misaligned when less than 2 photos #68

Closed techieshark closed 8 years ago

techieshark commented 8 years ago

This is an edge case, but we might run across a story with less than two photos, and in that situation the text is misaligned:

image

To fix this, we'll need some CSS but first how to reproduce.

First find the story id for the first story that comes up:

image

Then in Postgres, you'll see it has a bunch of photos for it:

psql hnm
hnm=# select * from story_photo where story_id = 16;
 id | story_id | photo_id 
----+----------+----------
 55 |       16 |       51
 56 |       16 |       56
 60 |       16 |       60
 65 |       16 |       65
 67 |       16 |       67
 72 |       16 |       72
(6 rows)

Let's delete all but one of them:

hnm=# select * from story_photo where story_id = 16 and photo_id <> 51;
 id | story_id | photo_id 
----+----------+----------
 56 |       16 |       56
 60 |       16 |       60
 65 |       16 |       65
 67 |       16 |       67
 72 |       16 |       72
(5 rows)

hnm=# delete from story_photo where story_id = 16 and photo_id <> 51;
DELETE 5

hnm=# select * from story_photo where story_id = 16;
 id | story_id | photo_id 
----+----------+----------
 51 |       16 |       51
(1 row)

Now reload the website and you'll see the results in the screenshot above.

techieshark commented 8 years ago

When fixed, it should look like this:

image