Merge pull request #7773 from mfo/US/add-code-commune-to-geoarea-label
feat(export.xslx): add code commune to geo_area.label
This commit is contained in:
commit
ce25f45b75
4 changed files with 4 additions and 4 deletions
|
@ -73,7 +73,7 @@ class GeoArea < ApplicationRecord
|
||||||
def label
|
def label
|
||||||
case source
|
case source
|
||||||
when GeoArea.sources.fetch(:cadastre)
|
when GeoArea.sources.fetch(:cadastre)
|
||||||
I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round)
|
I18n.t("cadastre", scope: 'geo_area.label', numero: numero, prefixe: prefixe, section: section, surface: surface.round, commune: commune)
|
||||||
when GeoArea.sources.fetch(:selection_utilisateur)
|
when GeoArea.sources.fetch(:selection_utilisateur)
|
||||||
if polygon?
|
if polygon?
|
||||||
if area > 0
|
if area > 0
|
||||||
|
|
|
@ -8,7 +8,7 @@ en:
|
||||||
selection_utilisateur: User selection
|
selection_utilisateur: User selection
|
||||||
geo_area:
|
geo_area:
|
||||||
label:
|
label:
|
||||||
cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface} m²"
|
cadastre: "Parcel n° %{numero} - Sheet %{prefixe} %{section} - %{surface} m² - town %{commune}"
|
||||||
area: "An area of %{area} m²"
|
area: "An area of %{area} m²"
|
||||||
area_unknown: "An area of unknown surface"
|
area_unknown: "An area of unknown surface"
|
||||||
line: "A %{length} m long line"
|
line: "A %{length} m long line"
|
||||||
|
|
|
@ -8,7 +8,7 @@ fr:
|
||||||
selection_utilisateur: Sélection utilisateur
|
selection_utilisateur: Sélection utilisateur
|
||||||
geo_area:
|
geo_area:
|
||||||
label:
|
label:
|
||||||
cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface} m²"
|
cadastre: "Parcelle n° %{numero} - Feuille %{prefixe} %{section} - %{surface} m² – commune %{commune}"
|
||||||
area: "Une aire de surface %{area} m²"
|
area: "Une aire de surface %{area} m²"
|
||||||
area_unknown: "Une aire de surface inconnue"
|
area_unknown: "Une aire de surface inconnue"
|
||||||
line: "Une ligne longue de %{length} m"
|
line: "Une ligne longue de %{length} m"
|
||||||
|
|
|
@ -140,7 +140,7 @@ RSpec.describe GeoArea, type: :model do
|
||||||
context "when geo is a cadastre parcelle" do
|
context "when geo is a cadastre parcelle" do
|
||||||
let(:geo_area) { build(:geo_area, :selection_utilisateur, :cadastre, champ: nil) }
|
let(:geo_area) { build(:geo_area, :selection_utilisateur, :cadastre, champ: nil) }
|
||||||
it "should return the label" do
|
it "should return the label" do
|
||||||
expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123 m²")
|
expect(geo_area.label).to eq("Parcelle n° 42 - Feuille 000 A11 - 123 m² – commune 75127")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue