2023-06-15 01:41:54 +07:00
|
|
|
module BasicController
|
|
|
|
|
|
|
|
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
|
|
|
using JSON3
|
|
|
|
using SearchLight
|
|
|
|
using Server.DatabaseSupport, Server.TemplateEditor
|
|
|
|
|
|
|
|
controller = "basic"
|
|
|
|
dict_layouts = Dict(
|
2023-06-24 20:44:16 +07:00
|
|
|
:landing => generate_layout_html("main",controller,"landing",css=["landing"],libraries=["Leaflet"]),
|
2023-06-24 04:39:41 +07:00
|
|
|
:manifesto => generate_layout_html("main",controller,"manifesto"),
|
2023-06-24 20:44:16 +07:00
|
|
|
:join_us => generate_layout_html("main",controller,"join_us",libraries=["Leaflet"]),
|
|
|
|
:groups => generate_layout_html("main",controller,"groups",libraries=["Leaflet"]),
|
|
|
|
:cooperatives => generate_layout_html("main",controller,"cooperatives",libraries=["Leaflet"]),
|
2023-07-12 05:42:33 +07:00
|
|
|
:communes => generate_layout_html("main",controller,"communes",libraries=["Leaflet"]),
|
2023-07-03 03:07:45 +07:00
|
|
|
:partners => generate_layout_html("main",controller,"partners",libraries=["Leaflet"]),
|
2023-07-04 23:21:15 +07:00
|
|
|
:compass => generate_layout_html("main",controller,"compass"),
|
2023-06-15 01:41:54 +07:00
|
|
|
)
|
|
|
|
|
2023-07-04 18:38:42 +07:00
|
|
|
#---Page info-----------------------------------------------------
|
2023-06-15 01:41:54 +07:00
|
|
|
|
2023-07-04 18:38:42 +07:00
|
|
|
const landing_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - A Global Network of Libertarian Socialists",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Глобальная сеть либертарных социалистов",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
const manifesto_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Manifesto",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Манифест",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
const join_us_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Manifesto",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Присоединяйся",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
)
|
|
|
|
|
|
|
|
const groups_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Groups",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Группы",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
const cooperatives_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Cooperatives",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Кооперативы",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-07-12 05:42:33 +07:00
|
|
|
const communes_info = Dict(
|
2023-07-04 18:38:42 +07:00
|
|
|
"en" => Dict(
|
2023-07-12 05:42:33 +07:00
|
|
|
:title => "LibSoc - Communes",
|
2023-07-04 18:38:42 +07:00
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Коммуны",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
const partners_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Partners",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Партнеры",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-07-04 23:21:15 +07:00
|
|
|
const compass_info = Dict(
|
|
|
|
"en" => Dict(
|
|
|
|
:title => "LibSoc - Political Compass",
|
|
|
|
:description => ""
|
|
|
|
),
|
|
|
|
"ru" => Dict(
|
|
|
|
:title => "LibSoc - Политический компас",
|
|
|
|
:description => ""
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
2023-07-04 18:38:42 +07:00
|
|
|
function get_locale()
|
|
|
|
data = payload()
|
|
|
|
if :locale in keys(data)
|
|
|
|
return data[:locale]
|
|
|
|
else
|
|
|
|
return "en"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
#---Functions---------------------------------------------------------
|
2023-06-15 01:41:54 +07:00
|
|
|
|
|
|
|
function landing()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-06-15 01:41:54 +07:00
|
|
|
html(:basic,:landing, layout = dict_layouts[:landing], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = landing_info[locale][:title],
|
|
|
|
description = landing_info[locale][:description]
|
2023-06-15 01:41:54 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2023-06-24 04:39:41 +07:00
|
|
|
function manifesto()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-06-24 04:39:41 +07:00
|
|
|
html(:basic,:manifesto, layout = dict_layouts[:manifesto], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = manifesto_info[locale][:title],
|
|
|
|
description = manifesto_info[locale][:description]
|
2023-06-24 04:39:41 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
function join_us()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-06-24 04:39:41 +07:00
|
|
|
html(:basic,:join_us, layout = dict_layouts[:join_us], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = join_us_info[locale][:title],
|
|
|
|
description = join_us_info[locale][:description]
|
2023-06-24 04:39:41 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
function groups()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-06-24 04:39:41 +07:00
|
|
|
html(:basic,:groups, layout = dict_layouts[:groups], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = groups_info[locale][:title],
|
|
|
|
description = groups_info[locale][:description]
|
2023-06-24 04:39:41 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
function cooperatives()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-06-24 04:39:41 +07:00
|
|
|
html(:basic,:cooperatives, layout = dict_layouts[:cooperatives], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = cooperatives_info[locale][:title],
|
|
|
|
description = cooperatives_info[locale][:description]
|
2023-06-24 04:39:41 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2023-07-12 05:42:33 +07:00
|
|
|
function communes()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-07-12 05:42:33 +07:00
|
|
|
html(:basic,:communes, layout = dict_layouts[:communes], context = @__MODULE__,
|
|
|
|
title = communes_info[locale][:title],
|
|
|
|
description = communes_info[locale][:description]
|
2023-06-24 04:39:41 +07:00
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2023-07-03 03:07:45 +07:00
|
|
|
function partners()
|
2023-07-04 18:38:42 +07:00
|
|
|
locale = get_locale()
|
2023-07-03 03:07:45 +07:00
|
|
|
html(:basic,:partners, layout = dict_layouts[:partners], context = @__MODULE__,
|
2023-07-04 18:38:42 +07:00
|
|
|
title = partners_info[locale][:title],
|
|
|
|
description = partners_info[locale][:description]
|
2023-06-26 00:39:06 +07:00
|
|
|
)
|
|
|
|
end
|
2023-06-15 01:41:54 +07:00
|
|
|
|
2023-07-04 23:21:15 +07:00
|
|
|
function political_compass()
|
|
|
|
locale = get_locale()
|
|
|
|
html(:basic,:compass, layout = dict_layouts[:compass], context = @__MODULE__,
|
|
|
|
title = compass_info[locale][:title],
|
|
|
|
description = compass_info[locale][:description]
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
2023-06-15 01:41:54 +07:00
|
|
|
end
|