Moved all entries to db
This commit is contained in:
@@ -10,12 +10,6 @@ dict_layouts = Dict(
|
||||
:landing => generate_layout_html("main",controller,"landing",css=["landing"],libraries=["Leaflet"]),
|
||||
:manifesto => generate_layout_html("main",controller,"manifesto"),
|
||||
:join_us => generate_layout_html("main",controller,"join_us",libraries=["Leaflet"]),
|
||||
:groups => generate_layout_html("main",controller,"groups",libraries=["Leaflet"]),
|
||||
:groups_add => generate_layout_html("main",controller,"groups_add",libraries=["Leaflet"]),
|
||||
:cooperatives => generate_layout_html("main",controller,"cooperatives",libraries=["Leaflet"]),
|
||||
:communes => generate_layout_html("main",controller,"communes",libraries=["Leaflet"]),
|
||||
:parties => generate_layout_html("main",controller,"parties",libraries=["Leaflet"]),
|
||||
:partners => generate_layout_html("main",controller,"partners",libraries=["Leaflet"]),
|
||||
:compass => generate_layout_html("main",controller,"compass"),
|
||||
)
|
||||
|
||||
@@ -54,61 +48,6 @@ const join_us_info = Dict(
|
||||
),
|
||||
)
|
||||
|
||||
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 => ""
|
||||
)
|
||||
)
|
||||
|
||||
const communes_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Communes",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Коммуны",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
const partners_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Partners",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Партнеры",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
const parties_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Parties",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Партии",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
const compass_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Political Compass",
|
||||
@@ -147,62 +86,6 @@ function manifesto()
|
||||
)
|
||||
end
|
||||
|
||||
function join_us()
|
||||
locale = get_locale()
|
||||
html(:basic,:join_us, layout = dict_layouts[:join_us], context = @__MODULE__,
|
||||
title = join_us_info[locale][:title],
|
||||
description = join_us_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function groups()
|
||||
locale = get_locale()
|
||||
html(:basic,:groups, layout = dict_layouts[:groups], context = @__MODULE__,
|
||||
title = groups_info[locale][:title],
|
||||
description = groups_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function groups_add()
|
||||
locale = get_locale()
|
||||
html(:basic,:groups_add, layout = dict_layouts[:groups_add], context = @__MODULE__,
|
||||
title = groups_info[locale][:title],
|
||||
description = groups_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function cooperatives()
|
||||
locale = get_locale()
|
||||
html(:basic,:cooperatives, layout = dict_layouts[:cooperatives], context = @__MODULE__,
|
||||
title = cooperatives_info[locale][:title],
|
||||
description = cooperatives_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function communes()
|
||||
locale = get_locale()
|
||||
html(:basic,:communes, layout = dict_layouts[:communes], context = @__MODULE__,
|
||||
title = communes_info[locale][:title],
|
||||
description = communes_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function partners()
|
||||
locale = get_locale()
|
||||
html(:basic,:partners, layout = dict_layouts[:partners], context = @__MODULE__,
|
||||
title = partners_info[locale][:title],
|
||||
description = partners_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function parties()
|
||||
locale = get_locale()
|
||||
html(:basic,:parties, layout = dict_layouts[:parties], context = @__MODULE__,
|
||||
title = parties_info[locale][:title],
|
||||
description = parties_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function political_compass()
|
||||
locale = get_locale()
|
||||
html(:basic,:compass, layout = dict_layouts[:compass], context = @__MODULE__,
|
||||
@@ -211,9 +94,12 @@ function political_compass()
|
||||
)
|
||||
end
|
||||
|
||||
function groups_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("groups_requests",data)
|
||||
function join_us()
|
||||
locale = get_locale()
|
||||
html(:basic,:join_us, layout = dict_layouts[:join_us], context = @__MODULE__,
|
||||
title = join_us_info[locale][:title],
|
||||
description = join_us_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
end
|
||||
|
59
Server/app/resources/communes/CommunesController.jl
Normal file
59
Server/app/resources/communes/CommunesController.jl
Normal file
@@ -0,0 +1,59 @@
|
||||
module CommunesController
|
||||
|
||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
||||
using JSON3
|
||||
using SearchLight
|
||||
using Server.DatabaseSupport, Server.TemplateEditor
|
||||
|
||||
controller = "communes"
|
||||
dict_layouts = Dict(
|
||||
:communes => generate_layout_html("main",controller,"communes",libraries=["Leaflet"]),
|
||||
:communes_add => generate_layout_html("main",controller,"communes_add",libraries=["Leaflet"]),
|
||||
)
|
||||
|
||||
#---Page info-----------------------------------------------------
|
||||
|
||||
const communes_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Communes",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Коммуны",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
function get_locale()
|
||||
data = payload()
|
||||
if :locale in keys(data)
|
||||
return data[:locale]
|
||||
else
|
||||
return "en"
|
||||
end
|
||||
end
|
||||
|
||||
#---Functions---------------------------------------------------------
|
||||
|
||||
function communes()
|
||||
locale = get_locale()
|
||||
html(:communes,:communes, layout = dict_layouts[:communes], context = @__MODULE__,
|
||||
title = communes_info[locale][:title],
|
||||
description = communes_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function communes_add()
|
||||
locale = get_locale()
|
||||
html(:communes,:communes_add, layout = dict_layouts[:communes_add], context = @__MODULE__,
|
||||
title = communes_info[locale][:title],
|
||||
description = communes_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function communes_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("communes_requests",data)
|
||||
end
|
||||
|
||||
end
|
1
Server/app/resources/communes/views/communes_add.jl.html
Normal file
1
Server/app/resources/communes/views/communes_add.jl.html
Normal file
@@ -0,0 +1 @@
|
||||
<communes-add-component></communes-add-component>
|
60
Server/app/resources/cooperatives/CooperativesController.jl
Normal file
60
Server/app/resources/cooperatives/CooperativesController.jl
Normal file
@@ -0,0 +1,60 @@
|
||||
module CooperativesController
|
||||
|
||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
||||
using JSON3
|
||||
using SearchLight
|
||||
using Server.DatabaseSupport, Server.TemplateEditor
|
||||
|
||||
controller = "cooperatives"
|
||||
dict_layouts = Dict(
|
||||
:cooperatives => generate_layout_html("main",controller,"cooperatives",libraries=["Leaflet"]),
|
||||
:cooperatives_add => generate_layout_html("main",controller,"cooperatives_add",libraries=["Leaflet"]),
|
||||
)
|
||||
|
||||
#---Page info-----------------------------------------------------
|
||||
|
||||
const cooperatives_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Cooperatives",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Кооперативы",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
function get_locale()
|
||||
data = payload()
|
||||
if :locale in keys(data)
|
||||
return data[:locale]
|
||||
else
|
||||
return "en"
|
||||
end
|
||||
end
|
||||
|
||||
#---Functions---------------------------------------------------------
|
||||
|
||||
|
||||
function cooperatives_add()
|
||||
locale = get_locale()
|
||||
html(:cooperatives,:cooperatives_add, layout = dict_layouts[:cooperatives_add], context = @__MODULE__,
|
||||
title = cooperatives_info[locale][:title],
|
||||
description = cooperatives_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function cooperatives()
|
||||
locale = get_locale()
|
||||
html(:cooperatives,:cooperatives, layout = dict_layouts[:cooperatives], context = @__MODULE__,
|
||||
title = cooperatives_info[locale][:title],
|
||||
description = cooperatives_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function cooperatives_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("cooperatives_requests",data)
|
||||
end
|
||||
|
||||
end
|
@@ -0,0 +1 @@
|
||||
<cooperatives-add-component></cooperatives-add-component>
|
59
Server/app/resources/groups/GroupsController.jl
Normal file
59
Server/app/resources/groups/GroupsController.jl
Normal file
@@ -0,0 +1,59 @@
|
||||
module GroupsController
|
||||
|
||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
||||
using JSON3
|
||||
using SearchLight
|
||||
using Server.DatabaseSupport, Server.TemplateEditor
|
||||
|
||||
controller = "groups"
|
||||
dict_layouts = Dict(
|
||||
:groups => generate_layout_html("main",controller,"groups",libraries=["Leaflet"]),
|
||||
:groups_add => generate_layout_html("main",controller,"groups_add",libraries=["Leaflet"]),
|
||||
)
|
||||
|
||||
#---Page info-----------------------------------------------------
|
||||
|
||||
const groups_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Groups",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Группы",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
function get_locale()
|
||||
data = payload()
|
||||
if :locale in keys(data)
|
||||
return data[:locale]
|
||||
else
|
||||
return "en"
|
||||
end
|
||||
end
|
||||
|
||||
#---Functions---------------------------------------------------------
|
||||
|
||||
function groups()
|
||||
locale = get_locale()
|
||||
html(:groups,:groups, layout = dict_layouts[:groups], context = @__MODULE__,
|
||||
title = groups_info[locale][:title],
|
||||
description = groups_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function groups_add()
|
||||
locale = get_locale()
|
||||
html(:groups,:groups_add, layout = dict_layouts[:groups_add], context = @__MODULE__,
|
||||
title = groups_info[locale][:title],
|
||||
description = groups_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function groups_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("groups_requests",data)
|
||||
end
|
||||
|
||||
end
|
60
Server/app/resources/parties/PartiesController.jl
Normal file
60
Server/app/resources/parties/PartiesController.jl
Normal file
@@ -0,0 +1,60 @@
|
||||
module PartiesController
|
||||
|
||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
||||
using JSON3
|
||||
using SearchLight
|
||||
using Server.DatabaseSupport, Server.TemplateEditor
|
||||
|
||||
controller = "parties"
|
||||
dict_layouts = Dict(
|
||||
:parties_add => generate_layout_html("main",controller,"parties_add",libraries=["Leaflet"]),
|
||||
:parties => generate_layout_html("main",controller,"parties",libraries=["Leaflet"]),
|
||||
)
|
||||
|
||||
#---Page info-----------------------------------------------------
|
||||
|
||||
const parties_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Parties",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Партии",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
function get_locale()
|
||||
data = payload()
|
||||
if :locale in keys(data)
|
||||
return data[:locale]
|
||||
else
|
||||
return "en"
|
||||
end
|
||||
end
|
||||
|
||||
#---Functions---------------------------------------------------------
|
||||
|
||||
|
||||
function parties()
|
||||
locale = get_locale()
|
||||
html(:parties,:parties, layout = dict_layouts[:parties], context = @__MODULE__,
|
||||
title = parties_info[locale][:title],
|
||||
description = parties_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function parties_add()
|
||||
locale = get_locale()
|
||||
html(:parties,:parties_add, layout = dict_layouts[:parties_add], context = @__MODULE__,
|
||||
title = parties_info[locale][:title],
|
||||
description = parties_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function parties_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("parties_requests",data)
|
||||
end
|
||||
|
||||
end
|
1
Server/app/resources/parties/views/parties_add.jl.html
Normal file
1
Server/app/resources/parties/views/parties_add.jl.html
Normal file
@@ -0,0 +1 @@
|
||||
<parties-add-component></parties-add-component>
|
59
Server/app/resources/partners/PartnersController.jl
Normal file
59
Server/app/resources/partners/PartnersController.jl
Normal file
@@ -0,0 +1,59 @@
|
||||
module PartnersController
|
||||
|
||||
using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests
|
||||
using JSON3
|
||||
using SearchLight
|
||||
using Server.DatabaseSupport, Server.TemplateEditor
|
||||
|
||||
controller = "partners"
|
||||
dict_layouts = Dict(
|
||||
:partners => generate_layout_html("main",controller,"partners",libraries=["Leaflet"]),
|
||||
:partners_add => generate_layout_html("main",controller,"partners_add",libraries=["Leaflet"]),
|
||||
)
|
||||
|
||||
#---Page info-----------------------------------------------------
|
||||
|
||||
const partners_info = Dict(
|
||||
"en" => Dict(
|
||||
:title => "LibSoc - Partners",
|
||||
:description => ""
|
||||
),
|
||||
"ru" => Dict(
|
||||
:title => "LibSoc - Партнеры",
|
||||
:description => ""
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
function get_locale()
|
||||
data = payload()
|
||||
if :locale in keys(data)
|
||||
return data[:locale]
|
||||
else
|
||||
return "en"
|
||||
end
|
||||
end
|
||||
|
||||
#---Functions---------------------------------------------------------
|
||||
|
||||
function partners()
|
||||
locale = get_locale()
|
||||
html(:partners,:partners, layout = dict_layouts[:partners], context = @__MODULE__,
|
||||
title = partners_info[locale][:title],
|
||||
description = partners_info[locale][:description]
|
||||
)
|
||||
end
|
||||
function partners_add()
|
||||
locale = get_locale()
|
||||
html(:partners,:partners_add, layout = dict_layouts[:partners_add], context = @__MODULE__,
|
||||
title = partners_info[locale][:title],
|
||||
description = partners_info[locale][:description]
|
||||
)
|
||||
end
|
||||
|
||||
function partners_add_post()
|
||||
data = jsonpayload()
|
||||
insert_into_table("partners_requests",data)
|
||||
end
|
||||
|
||||
end
|
1
Server/app/resources/partners/views/partners_add.jl.html
Normal file
1
Server/app/resources/partners/views/partners_add.jl.html
Normal file
@@ -0,0 +1 @@
|
||||
<partners-add-component></partners-add-component>
|
Reference in New Issue
Block a user