~ihabunek/triglav

ref: d1b5915f3e023d04850eabf702bda7207a337302 triglav/lib/triglav/html.ex -rw-r--r-- 442 bytes
d1b5915fIvan Habunek Validate platform distance from route 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