~ihabunek/triglav

ref: 3a1876166aa129c76c1b09fc562af764d04df4e1 triglav/lib/triglav/html.ex -rw-r--r-- 442 bytes
3a187616Ivan Habunek Fix detecting unexpected master route members 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