~ihabunek/triglav

ref: 1a8ba58407fc58b933347c9bec5bcb4358191cbb triglav/lib/triglav/html.ex -rw-r--r-- 442 bytes
1a8ba584Ivan Habunek Use derived data for route detail view 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
defimpl Phoenix.HTML.Safe, for: Triglav.Schemas.Osmosis.Relation do
  use Phoenix.HTML

  def to_iodata(nil), do: ""

  def to_iodata(relation) do
    relation
    |> TriglavWeb.OsmHelpers.osm_link()
    |> elem(1)
  end
end

defimpl Phoenix.HTML.Safe, for: Triglav.Schemas.Osmosis.Point do
  use Phoenix.HTML

  def to_iodata(nil), do: ""

  def to_iodata(point) do
    point
    |> TriglavWeb.OsmHelpers.osm_link()
    |> elem(1)
  end
end