mobilizon.chapril.org-mobil.../lib/mobilizon/common-config.ex
Thomas Citharel da2a0593ca
Various UI stuff (mainly implement mookup)
Fix lint

Disable modern mode

Fixes

UI fixes

Fixes

Ignore .po~ files

Fixes

Fix homepage

Fixes

Fixes

Mix format

Fix tests

Fix tests (yeah…)

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2019-04-11 11:58:13 +02:00

26 lines
514 B
Elixir

defmodule Mobilizon.CommonConfig do
@moduledoc """
Instance configuration wrapper
"""
def registrations_open?() do
instance_config()
|> get_in([:registrations_open])
|> to_bool
end
def instance_name() do
instance_config()
|> get_in([:name])
end
def instance_description() do
instance_config()
|> get_in([:description])
end
defp instance_config(), do: Application.get_env(:mobilizon, :instance)
defp to_bool(v), do: v == true or v == "true" or v == "True"
end