@@ -94,6 +94,7 @@ defmodule Mobilizon.GraphQL.Resolvers.Config do
|
||||
contact: Config.contact(),
|
||||
demo_mode: Config.instance_demo_mode?(),
|
||||
long_events: Config.instance_long_events?(),
|
||||
duration_of_long_event: Config.instance_duration_of_long_event(),
|
||||
description: Config.instance_description(),
|
||||
long_description: Config.instance_long_description(),
|
||||
slogan: Config.instance_slogan(),
|
||||
|
||||
@@ -32,6 +32,11 @@ defmodule Mobilizon.GraphQL.Schema.ConfigType do
|
||||
|
||||
field(:demo_mode, :boolean, description: "Whether the demo mode is enabled")
|
||||
field(:long_events, :boolean, description: "Whether the long events mode is enabled")
|
||||
|
||||
field(:duration_of_long_event, :integer,
|
||||
description: "Events longer than this duration are considered long events"
|
||||
)
|
||||
|
||||
field(:country_code, :string, description: "The country code from the IP")
|
||||
field(:location, :lonlat, description: "The IP's location")
|
||||
field(:geocoding, :geocoding, description: "The instance's geocoding settings")
|
||||
|
||||
@@ -181,6 +181,9 @@ defmodule Mobilizon.Config do
|
||||
@spec instance_long_events? :: boolean
|
||||
def instance_long_events?, do: instance_config()[:duration_of_long_event] > 0
|
||||
|
||||
@spec instance_duration_of_long_event :: boolean
|
||||
def instance_duration_of_long_event, do: instance_config()[:duration_of_long_event]
|
||||
|
||||
@spec instance_repository :: String.t()
|
||||
def instance_repository, do: instance_config()[:repository]
|
||||
|
||||
|
||||
@@ -202,6 +202,9 @@ type Config {
|
||||
"Whether the long events mode is enabled"
|
||||
longEvents: Boolean
|
||||
|
||||
"Events longer than this duration are considered long events"
|
||||
durationOfLongEvent: Int
|
||||
|
||||
"The country code from the IP"
|
||||
countryCode: String
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ export const CONFIG = gql`
|
||||
registrationsAllowlist
|
||||
demoMode
|
||||
longEvents
|
||||
durationOfLongEvent
|
||||
countryCode
|
||||
languages
|
||||
primaryColor
|
||||
|
||||
@@ -46,6 +46,7 @@ export interface IConfig {
|
||||
registrationsAllowlist: boolean;
|
||||
demoMode: boolean;
|
||||
longEvents: boolean;
|
||||
durationOfLongEvent: number;
|
||||
countryCode: string;
|
||||
eventCategories: { id: string; label: string }[];
|
||||
languages: string[];
|
||||
|
||||
Reference in New Issue
Block a user