Merge pull request #921 from maco/bug-#876

Use standardized & translateable strings for the photo show page
This commit is contained in:
pozorvlak
2016-05-26 17:50:12 +01:00
3 changed files with 10 additions and 6 deletions

View File

@@ -24,13 +24,13 @@
%ul
- if @photo.plantings.size > 0
- @photo.plantings.each do |p|
%li= link_to p, p
%li= link_to t('.thing_by', thing: Planting.model_name.singular, owner: p.owner), p
- if @photo.harvests.size > 0
- @photo.harvests.each do |h|
%li= link_to h, h
%li= link_to t('.thing_by', thing: Harvest.model_name.singular, owner: h.owner), h
- if @photo.gardens.size > 0
- @photo.gardens.each do |g|
%li= link_to g, g
%li= link_to t('.thing_by', thing: Garden.model_name.singular, owner: g.owner), g
.row

View File

@@ -54,6 +54,10 @@ en:
crop_plantings: "Everyone's %{crop} plantings"
owner_plantings: "%{owner} plantings"
photos:
show:
thing_by: "A %{thing} by %{owner}"
harvests:
index:
title:

View File

@@ -14,7 +14,7 @@ feature "show photo page" do
scenario "shows linkback to planting" do
planting.photos << photo
visit photo_path(photo)
expect(page).to have_link planting, href: planting_path(planting)
expect(page).to have_link "A planting by #{planting.owner}", href: planting_path(planting)
end
end
@@ -24,7 +24,7 @@ feature "show photo page" do
scenario "shows linkback to harvest" do
harvest.photos << photo
visit photo_path(photo)
expect(page).to have_link harvest, href: harvest_path(harvest)
expect(page).to have_link "A harvest by #{harvest.owner}", href: harvest_path(harvest)
end
end
@@ -34,7 +34,7 @@ feature "show photo page" do
scenario "shows linkback to garden" do
garden.photos << photo
visit photo_path(photo)
expect(page).to have_link garden, href: garden_path(garden)
expect(page).to have_link "A garden by #{garden.owner}", href: garden_path(garden)
end
end
end