da2a0593ca
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>
26 lines
514 B
Elixir
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
|