From 9998d8f048c0861b14715b47fed25b4e54d2f49e Mon Sep 17 00:00:00 2001 From: a-ill Date: Thu, 17 Aug 2023 12:01:26 +0300 Subject: [PATCH] Added trade unions --- .../trade_unions/TradeUnionsController.jl | 279 +++++++++ .../trade_unions/views/trade_unions.jl.html | 1 + .../views/trade_unions_add.jl.html | 1 + .../svelte/public/js/libraries/miscTools.js | 6 +- Server/app/svelte/public/js/mapFuncs.js | 37 +- .../public/locales/en/landing-component.json | 6 +- .../public/locales/en/navbar-component.json | 1 + .../locales/en/trade-unions-component.json | 11 + .../public/locales/ru/landing-component.json | 2 + .../public/locales/ru/navbar-component.json | 1 + .../locales/ru/trade-unions-component.json | 11 + .../app/svelte/src/join-us-component.svelte | 32 +- .../app/svelte/src/landing-component.svelte | 37 +- .../svelte/src/navbar/navbar-logged.svelte | 5 +- .../src/navbar/navbar-not-logged.svelte | 5 +- .../src/profile/profile-component.svelte | 31 +- .../src/profile/profile-trade-unions.svelte | 29 + .../profile/trade-unions-add-component.svelte | 577 ++++++++++++++++++ .../svelte/src/trade-unions-component.svelte | 178 ++++++ .../10_create_table_trade_unions.jl | 32 + ...artners.jl => 11_create_table_partners.jl} | 0 ....jl => 12_create_table_groups_requests.jl} | 2 - ...l => 13_create_table_communes_requests.jl} | 0 ...s.jl => 14_create_table_coops_requests.jl} | 0 ...jl => 15_create_table_parties_requests.jl} | 0 .../16_create_table_trade_unions_requests.jl | 38 ++ ...ers.jl => 17_create_table_groups_users.jl} | 0 ...s.jl => 18_create_table_communes_users.jl} | 0 ... => 19_create_table_cooperatives_users.jl} | 0 ...table_users.jl => 1_create_table_users.jl} | 0 ...rs.jl => 20_create_table_parties_users.jl} | 0 ...ups.jl => 21_create_table_users_groups.jl} | 0 .../22_create_table_trade_unions_users.jl | 24 + ...table_roles.jl => 2_create_table_roles.jl} | 0 ...sions.jl => 3_create_table_permissions.jl} | 0 ...users.jl => 4_create_table_roles_users.jl} | 0 ...jl => 5_create_table_permissions_roles.jl} | 0 ...ble_groups.jl => 6_create_table_groups.jl} | 0 ...communes.jl => 7_create_table_communes.jl} | 0 ...ives.jl => 8_create_table_cooperatives.jl} | 0 ...e_parties.jl => 9_create_table_parties.jl} | 0 Server/public/assets/trade-unions.json | 1 + Server/public/img/common/coops.svg | 4 +- Server/public/img/common/groups.svg | 2 +- .../img/common/markers/marker-violet.png | Bin 0 -> 4190 bytes Server/public/img/common/trade-unions.svg | 8 + .../public/js/components/join-us-component.js | 2 +- .../public/js/components/landing-component.js | 2 +- Server/public/js/components/navbar-logged.js | 2 +- .../public/js/components/navbar-not-logged.js | 2 +- .../public/js/components/profile-component.js | 2 +- .../js/components/profile-trade-unions.js | 1 + .../components/trade-unions-add-component.js | 1 + .../js/components/trade-unions-component.js | 1 + Server/public/js/libraries/miscTools.js | 6 +- Server/public/js/mapFuncs.js | 37 +- .../public/locales/en/landing-component.json | 6 +- .../public/locales/en/navbar-component.json | 1 + .../locales/en/trade-unions-component.json | 11 + .../public/locales/ru/landing-component.json | 2 + .../public/locales/ru/navbar-component.json | 1 + .../locales/ru/trade-unions-component.json | 11 + Server/routes.jl | 8 + 63 files changed, 1402 insertions(+), 55 deletions(-) create mode 100644 Server/app/resources/trade_unions/TradeUnionsController.jl create mode 100644 Server/app/resources/trade_unions/views/trade_unions.jl.html create mode 100644 Server/app/resources/trade_unions/views/trade_unions_add.jl.html create mode 100644 Server/app/svelte/public/locales/en/trade-unions-component.json create mode 100644 Server/app/svelte/public/locales/ru/trade-unions-component.json create mode 100644 Server/app/svelte/src/profile/profile-trade-unions.svelte create mode 100644 Server/app/svelte/src/profile/trade-unions-add-component.svelte create mode 100644 Server/app/svelte/src/trade-unions-component.svelte create mode 100644 Server/db/migrations/10_create_table_trade_unions.jl rename Server/db/migrations/{2022026611846568_create_table_partners.jl => 11_create_table_partners.jl} (100%) rename Server/db/migrations/{2022026611846569_create_table_groups_requests.jl => 12_create_table_groups_requests.jl} (94%) rename Server/db/migrations/{2022026611846570_create_table_communes_requests.jl => 13_create_table_communes_requests.jl} (100%) rename Server/db/migrations/{2022026611846571_create_table_coops_requests.jl => 14_create_table_coops_requests.jl} (100%) rename Server/db/migrations/{2022026611846572_create_table_parties_requests.jl => 15_create_table_parties_requests.jl} (100%) create mode 100644 Server/db/migrations/16_create_table_trade_unions_requests.jl rename Server/db/migrations/{2022026611846573_create_table_groups_users.jl => 17_create_table_groups_users.jl} (100%) rename Server/db/migrations/{2022026611846574_create_table_communes_users.jl => 18_create_table_communes_users.jl} (100%) rename Server/db/migrations/{2022026611846575_create_table_cooperatives_users.jl => 19_create_table_cooperatives_users.jl} (100%) rename Server/db/migrations/{2019052410085235_create_table_users.jl => 1_create_table_users.jl} (100%) rename Server/db/migrations/{2022026611846576_create_table_parties_users.jl => 20_create_table_parties_users.jl} (100%) rename Server/db/migrations/{2022026611846577_create_table_users_groups.jl => 21_create_table_users_groups.jl} (100%) create mode 100644 Server/db/migrations/22_create_table_trade_unions_users.jl rename Server/db/migrations/{2021061519495560_create_table_roles.jl => 2_create_table_roles.jl} (100%) rename Server/db/migrations/{2021061519503270_create_table_permissions.jl => 3_create_table_permissions.jl} (100%) rename Server/db/migrations/{2021061519532446_create_table_roles_users.jl => 4_create_table_roles_users.jl} (100%) rename Server/db/migrations/{2021061519540214_create_table_permissions_roles.jl => 5_create_table_permissions_roles.jl} (100%) rename Server/db/migrations/{2022026611846565_create_table_groups.jl => 6_create_table_groups.jl} (100%) rename Server/db/migrations/{2022026611846566_create_table_communes.jl => 7_create_table_communes.jl} (100%) rename Server/db/migrations/{2022026611846567_create_table_cooperatives.jl => 8_create_table_cooperatives.jl} (100%) rename Server/db/migrations/{2022026611846567_create_table_parties.jl => 9_create_table_parties.jl} (100%) create mode 100644 Server/public/assets/trade-unions.json create mode 100644 Server/public/img/common/markers/marker-violet.png create mode 100644 Server/public/img/common/trade-unions.svg create mode 100644 Server/public/js/components/profile-trade-unions.js create mode 100644 Server/public/js/components/trade-unions-add-component.js create mode 100644 Server/public/js/components/trade-unions-component.js create mode 100644 Server/public/locales/en/trade-unions-component.json create mode 100644 Server/public/locales/ru/trade-unions-component.json diff --git a/Server/app/resources/trade_unions/TradeUnionsController.jl b/Server/app/resources/trade_unions/TradeUnionsController.jl new file mode 100644 index 0000000..068b489 --- /dev/null +++ b/Server/app/resources/trade_unions/TradeUnionsController.jl @@ -0,0 +1,279 @@ +module TradeUnionsController + +using Genie, Genie.Renderer, Genie.Renderer.Html, Genie.Requests, GenieAuthentication, DataFrames +using JSON3 +using SearchLight,SearchLightPostgreSQL, LibPQ, JSON3 +using Server.DatabaseSupport, Server.TemplateEditor, Server.Users +import Server.DatabaseSupport: select_from_table, insert_into_table, delete_from_table, exist_in_table + +controller = "trade_unions" +dict_layouts = Dict( + :trade_unions => generate_layout_html("main",controller,"trade_unions",libraries=["Leaflet"]), + :trade_unions_add => generate_layout_html("main",controller,"trade_unions_add",libraries=["Leaflet"]), +) + +#---Page info----------------------------------------------------- + +const trade_unions_info = Dict( + "en" => Dict( + :title => "LibSoc - Trade Unions", + :description => "" + ), + "ru" => Dict( + :title => "LibSoc - Профсоюзы", + :description => "" + ) +) + +function get_locale() + data = payload() + if :locale in keys(data) + return data[:locale] + else + return "en" + end +end + +#---Helpers----------------------------------------------------------- + + +function table_to_json(name,df) + ar = [] + for df_row in eachrow(df) + dict = Dict() + for id in names(df_row) + dict[id] = df_row[id] + end + push!(ar,dict) + end + open("public/assets/"*name*".json", "w") do io + JSON3.write(io, ar) + end +end + +function compile(name) + df = select_from_table([name => ["*"]]) + table_to_json(name,df) +end + +function move_requests(name) + df_requests = select_from_table(["$(name)_requests" => ["*"]], where_data=["verified" => true, "added" => false]) + df = select_from_table([name => ["*"]]) + latitudes = df.latitude + longitudes = df.longitude + for df_row in eachrow(df_requests) + ind_id_given = ismissing(df_row.id_given) ? nothing : findfirst(df_row.id_given.==df.id) + if (!isnothing(ind_id_given)) + id = df[ind_id_given,:id] + row_found = df[ind_id_given,Not(:id)] + dict = Dict(zip(names(row_found),values(row_found))) + dict["members"] += 1 + update_table(name,dict, where_data=["id" => id]) + else + id = df_row.id + dict_update = Dict("added" => true) + update_table("$(name)_requests",dict_update, where_data=["id" => id]) + + df_row_to_add = df_row[Not(:id_given)] + df_row_to_add = df_row_to_add[Not(:verified)] + df_row_to_add = df_row_to_add[Not(:added)] + df_row_to_add = df_row_to_add[Not(:id)] + dict = Dict(zip(names(df_row_to_add),values(df_row_to_add))) + dict["members"] = 1 + insert_into_table(name,dict) + end + end +end + +#---Functions--------------------------------------------------------- + +current_user() = findone(Users.User, id = get_authentication()) + +function trade_unions() + locale = get_locale() + html(:trade_unions,:trade_unions, layout = dict_layouts[:trade_unions], context = @__MODULE__, + title = trade_unions_info[locale][:title], + description = trade_unions_info[locale][:description] + ) +end + +function trade_unions_add() + locale = get_locale() + html(:trade_unions,:trade_unions_add, layout = dict_layouts[:trade_unions_add], context = @__MODULE__, + title = trade_unions_info[locale][:title], + description = trade_unions_info[locale][:description] + ) +end + +function trade_unions_add_post() + data = copy(jsonpayload()) + mode = data["mode"] + delete!(data,"mode") + user = current_user() + user_id = user.id + if mode==0 # Create + if user.verified + existing_user_group_data = select_from_table(["users_trade_unions" => ["*"]], where_data=["user_id" => user_id]) + has_group = !isempty(existing_user_group_data) + delete!(data,"group_id") + group_id = insert_into_table("trade_unions",data, "RETURNING id")[1,1] + if has_group + user_trade_unions_id = existing_user_group_data[1,"id"] + prev_group_id = existing_user_group_data[1,"group_id"] + update_table("users_trade_unions",Dict("group_id" => group_id), where_data=["id" => user_trade_unions_id]) + members = select_from_table(["trade_unions" => ["members"]], where_data=["id" => prev_group_id])[1,1] + if (members==1) + delete_from_table("trade_unions",["id" => prev_group_id]) + else + update_table("trade_unions",Dict("members" => members - 1), where_data=["id" => id]) + end + else + dict_users_trade_unions = Dict("user_id" => user.id, "group_id" => group_id) + insert_into_table("users_trade_unions",dict_users_trade_unions) + end + compile("trade_unions") + else + data["status"] = 0 + data["user_id"] = user_id + insert_into_table("trade_unions_requests",data) + end + elseif mode==1 # Join + data["user_id"] = user_id + if exist_in_table("users_trade_unions",["group_id" => data["group_id"]]) + if exist_in_table("trade_unions_requests",["user_id" => user_id]) + delete_from_table("trade_unions_requests",["user_id" => user_id]) + end + data["status"] = 0 + insert_into_table("trade_unions_requests",data) + else + group_id = data["group_id"] + members = select_from_table("trade_unions" => ["members"], where_data = ["id" => group_id])[1,1] + dict = Dict("members" => members + 1) + update_table("trade_unions",dict, where_data=["id" => group_id]) + dict_users_trade_unions = Dict("user_id" => user_id, "group_id" => group_id) + insert_into_table("users_trade_unions",dict_users_trade_unions) + end + + elseif mode==2 # Move + existing_user_group_data = select_from_table(["users_trade_unions" => ["*"]], where_data=["user_id" => user_id]) + group_id = existing_user_group_data[1,"group_id"] + delete!(data,"group_id") + delete!(data,"members") + delete!(data,"contact") + update_table("trade_unions",data, where_data=["id" => group_id]) + compile("trade_unions") + elseif mode==3 # Leave + existing_user_group_data = select_from_table(["users_trade_unions" => ["*"]], where_data=["user_id" => user_id]) + if size(existing_user_group_data,1)==0 + if exist_in_table("trade_unions_requests",["user_id" => user_id]) + delete_from_table("trade_unions_requests",["user_id" => user_id]) + end + else + delete_from_table("users_trade_unions",["user_id" => user_id]) + end + end + return nothing +end + +function get_user_trade_unions() + local data_dicts + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + data_dicts = [] + if isnothing(group_id) + local data + data = select_from_table("trade_unions_requests" => ["*"], where_data = ["user_id" => user_id,"status" => 0]) + if size(data,1)==0 + data = select_from_table("trade_unions_requests" => ["*"], where_data = ["user_id" => user_id,"status" => 2]) + if size(data,1)!=0 + data = data[[end],:] + end + end + for row in eachrow(data) + dict = Dict(zip(names(row),values(row))) + if (!ismissing(row["group_id"])) + extra_data = select_from_table("trade_unions" => ["*"], where_data = ["id" => row["group_id"]]) + merge!(dict, Dict(zip(names(extra_data[1,:]),values(extra_data[1,:])))) + end + push!(data_dicts, dict) + end + else + group_data = select_from_table("trade_unions" => ["*"], where_data = ["id" => group_id]) + ns = names(group_data) + data_dicts = map(x -> Dict(zip(ns,values(x))),eachrow(group_data)) + end + return JSON3.write(data_dicts) +end + +function get_group_requests() + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + data_dicts = [] + if !isnothing(group_id) + user_ids = select_from_table("trade_unions_requests" => ["user_id"], where_data = ["group_id" => group_id, "status" => 0])[:,1] + for user2_id in user_ids + email = select_from_table("users" => ["email"], where_data = ["id" => user2_id])[1,1] + push!(data_dicts,Dict("email" => email, "user_id" => user2_id)) + end + end + return JSON3.write(data_dicts) +end + +function approve_request() + data = copy(jsonpayload()) + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + members = select_from_table("trade_unions" => ["members"], where_data = ["id" => group_id])[1,1] + dict = Dict("members" => members + 1) + update_table("trade_unions",dict, where_data=["id" => group_id]) + update_table("trade_unions_requests",Dict("status" => 1), where_data=["group_id" => group_id, "user_id" => data["user_id"]]) + dict_users_trade_unions = Dict("user_id" => data["user_id"], "group_id" => group_id) + insert_into_table("users_trade_unions",dict_users_trade_unions) + compile("trade_unions") + return nothing +end + +function reject_request() + data = copy(jsonpayload()) + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + update_table("trade_unions_requests",Dict("status" => 2), where_data=["group_id" => group_id, "user_id" => data["user_id"]]) + return nothing +end + +function changeMemberCount() + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + data = copy(jsonpayload()) + update_table("trade_unions",data, where_data=["id" => group_id]) + compile("trade_unions") +end + +function change_group() + user_id = get_authentication() + trade_unions_ids = select_from_table("users_trade_unions" => ["group_id"], where_data = ["user_id" => user_id])[:,1] + group_id = isempty(trade_unions_ids) ? nothing : trade_unions_ids[1] + if !isnothing(group_id) + data = copy(jsonpayload()) + data_new = Dict() + ks = keys(data) + for x in ["members","contact"] + if x in ks + data_new[x] = data[x] + end + end + if !isempty(data_new) + update_table("trade_unions",data_new, where_data=["id" => group_id]) + compile("trade_unions") + end + end + return nothing +end + + +end diff --git a/Server/app/resources/trade_unions/views/trade_unions.jl.html b/Server/app/resources/trade_unions/views/trade_unions.jl.html new file mode 100644 index 0000000..fa97899 --- /dev/null +++ b/Server/app/resources/trade_unions/views/trade_unions.jl.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Server/app/resources/trade_unions/views/trade_unions_add.jl.html b/Server/app/resources/trade_unions/views/trade_unions_add.jl.html new file mode 100644 index 0000000..b0d0b6e --- /dev/null +++ b/Server/app/resources/trade_unions/views/trade_unions_add.jl.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Server/app/svelte/public/js/libraries/miscTools.js b/Server/app/svelte/public/js/libraries/miscTools.js index 64af615..0abfbf9 100644 --- a/Server/app/svelte/public/js/libraries/miscTools.js +++ b/Server/app/svelte/public/js/libraries/miscTools.js @@ -13,9 +13,9 @@ export function debounce(func, timeout){ } export function svgFromObject(object) { - var objectDoc = object.contentDocument; - var svgItem = objectDoc.querySelector("path"); - return svgItem + var objectDoc = object.contentDocument + var svgItems = objectDoc.querySelectorAll("path") + return svgItems } export function rem2px(rem) { diff --git a/Server/app/svelte/public/js/mapFuncs.js b/Server/app/svelte/public/js/mapFuncs.js index f37d0d7..b024f03 100644 --- a/Server/app/svelte/public/js/mapFuncs.js +++ b/Server/app/svelte/public/js/mapFuncs.js @@ -6,7 +6,15 @@ export function addGroupPinContent(g,content,locale) { for (let field of ["location","members","contact"]) { let fieldText = content[field] + ": " if (field=="contact") { - text += fieldText + "" + g.contact + "" + if (g.contact.includes("@") && g.contact.trim().split(" ").length==1) { + text += fieldText + "" + g.contact + "" + } + else if (g.contact.includes("http")) { + text += fieldText + "" + g.contact + "" + } + else { + text += fieldText + g.contact + "
" + } } else if (field=="location") { let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined) @@ -175,4 +183,31 @@ export function addPartnersPinContent(g,content,locale) { } } return {text,coordinates} +} + +export function addTradeUnionPinContent(g,content,locale) { + let coordinates + let text = ""+content["TradeUnion"]+"
" + for (let field of ["name","location","members","contact"]) { + let fieldText = content[field] + ": " + if (field=="contact") { + text += fieldText + "" + g.contact + "" + } + else if (field=="location") { + let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined) + let locationString + if (locale=="en") { + locationString = location.map(x => x).join(", ") + } + else { + locationString = location.map(x => translate(content, x)).join(", ") + } + text += fieldText + locationString + "
" + coordinates = [g.latitude,g.longitude] + } + else { + text += fieldText + g[field] + "
" + } + } + return {text,coordinates} } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/en/landing-component.json b/Server/app/svelte/public/locales/en/landing-component.json index 0e807c8..9199c05 100644 --- a/Server/app/svelte/public/locales/en/landing-component.json +++ b/Server/app/svelte/public/locales/en/landing-component.json @@ -1,13 +1,15 @@ { "top": "Our organization is a decentralized federation build upon the principle of free association. It consists of many groups of people united around a cause of bringing down exploitative politico-economic systems. We aim to replace them with libertarian socialist systems based on decentralization, direct democracy and worker-ownership of the means of production with the goal of creating an equitable, democratic and sustainable world by stopping exploitation of humans and nature.", "groupsTitle": "GROUPS", - "groupsText": "We organize groups for the purposes of education, advocacy, anti-fascist action and mutual aid. Our objective is to demonstrate how the current politico-economic systems detrimentally impact our well-being, present alternative approaches, and engage in mutual aid to alleviate the challenges of living under capitalism.", + "groupsText": "We organize groups for the purposes of education, advocacy, anti-fascist action and mutual aid. Our objective is to demonstrate how the current politico-economic systems detrimentally impact our well-being, present alternative approaches, and engage in mutual aid.", "communesTitle": "COMMUNES", "communesText": "We establish communes based on libertarian socialist principles, where commune members have ownership over land, houses, and the means of production as well as make decisions using direct democracy. We are gradually expanding our socialist world, one commune at a time.", "cooperativesTitle": "COOPERATIVES", - "cooperativesText": "We form worker cooperatives to finance the operations of our groups and communes. Recognizing that economic power influences political power, we consider the establishment of cooperatives to be one of the initial steps towards achieving socialism.", + "cooperativesText": "We form worker cooperatives to finance the operations of our groups and communes. Recognizing that economic power influences political power, we consider the establishment of cooperatives to be a vital activity.", "partiesTitle": "PARTIES", "partiesText": "We create political parties in order to push for reforms allowing us to easier further our goals, to move the Overton window as well as to gain popularity. However, we recognize that we cannot achieve libertarian socialism through institutions which act contrary to our goals.", + "tradeUnionsTitle": "TRADE UNIONS", + "tradeUnionsText": "We promote trade unions, which empower laborers to collectively advocate for fair treatment, just wages, and improved working conditions. Struggle at a place of work is an integral part of our strategy to achieve libertarian socialism.", "findUs": "Find Us", "whatNow": "What Now?", "joinUs": "Join Us", diff --git a/Server/app/svelte/public/locales/en/navbar-component.json b/Server/app/svelte/public/locales/en/navbar-component.json index 68b400b..c64073f 100644 --- a/Server/app/svelte/public/locales/en/navbar-component.json +++ b/Server/app/svelte/public/locales/en/navbar-component.json @@ -7,6 +7,7 @@ "communes": "Communes", "cooperatives": "Cooperatives", "parties": "Parties", + "tradeUnions": "Trade Unions", "partners": "Partners", "login": "Login", "profile": "Profile" diff --git a/Server/app/svelte/public/locales/en/trade-unions-component.json b/Server/app/svelte/public/locales/en/trade-unions-component.json new file mode 100644 index 0000000..cad5d69 --- /dev/null +++ b/Server/app/svelte/public/locales/en/trade-unions-component.json @@ -0,0 +1,11 @@ +{ + "tradeUnions": "Trade Unions", + "p1": "Trade unions play a pivotal role in safeguarding the rights and welfare of workers. Trade unions constitute an integral part of our organization, allowing workers to unite and collectively negotiate for fair wages, better working conditions, and improved labour rights. By fostering solidarity and mobilizing for collective action, trade unions contribute to our overarching mission of dismantling exploitative systems and ushering in a world centered on decentralized decision-making, direct democracy, and worker self-management.", + "subheading1": "Our Trade Unions", + "location": "Location", + "members": "Members", + "contact": "Contact", + "TradeUnion": "Trade union", + "tradeUnion": "trade union", + "map-prompt": "Want to appear on our map? Contact us!" +} \ No newline at end of file diff --git a/Server/app/svelte/public/locales/ru/landing-component.json b/Server/app/svelte/public/locales/ru/landing-component.json index 5eb789b..46c7729 100644 --- a/Server/app/svelte/public/locales/ru/landing-component.json +++ b/Server/app/svelte/public/locales/ru/landing-component.json @@ -8,6 +8,8 @@ "cooperativesText": "Мы формируем рабочие кооперативы для финансирования операций наших групп и коммун, а также формирования основы новой социалистической экономики. Признавая, что экономическая власть влияет на политическую власть, мы считаем создание кооперативов одним из первых шагов на пути к социализму.", "partiesTitle": "ПАРТИИ", "partiesText": "Мы создаем политические партии, чтобы продвигать реформы, которые позволят легче достичь наших целей, сдвигать окно Овертона и увеличивать нашу популярность. Однако мы признаем, что мы не можем достичь либертарианского социализма с помощью институтов, действующих против наших целей.", + "tradeUnionsTitle": "ПРОФСОЮЗЫ", + "tradeUnionsText": "Мы поддерживаем профсоюзы, которые дают возможность работникам коллективно выступать за справедливое обращение, справедливую заработную плату и улучшение условий труда. Борьба на месте работы — неотъемлемая часть нашей стратегии по достижению либертарного социализма.", "findUs": "Найди нас", "whatNow": "Что теперь?", "joinUs": "Присоединяйся", diff --git a/Server/app/svelte/public/locales/ru/navbar-component.json b/Server/app/svelte/public/locales/ru/navbar-component.json index b1df46c..eef8043 100644 --- a/Server/app/svelte/public/locales/ru/navbar-component.json +++ b/Server/app/svelte/public/locales/ru/navbar-component.json @@ -8,6 +8,7 @@ "cooperatives": "Кооперативы", "parties": "Партии", "partners": "Партнеры", + "tradeUnions": "Профсоюзы", "login": "Войти", "profile": "Профиль" } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/ru/trade-unions-component.json b/Server/app/svelte/public/locales/ru/trade-unions-component.json new file mode 100644 index 0000000..cd53368 --- /dev/null +++ b/Server/app/svelte/public/locales/ru/trade-unions-component.json @@ -0,0 +1,11 @@ +{ + "tradeUnions": "Профсоюзы", + "p1": "Профсоюзы играют ключевую роль в защите прав и благосостояния трудящихся. Профсоюзы составляют неотъемлемую часть нашей организации, позволяя работникам объединяться и вести коллективные переговоры о справедливой заработной плате, лучших условиях труда и улучшенных трудовых правах. Укрепляя солидарность и мобилизуя для коллективных действий, профсоюзы вносят свой вклад в нашу всеобъемлющую миссию по устранению эксплуататорских систем и установлению мира, основанного на децентрализованном принятии решений, прямой демократии и самоуправлении рабочих.", + "subheading1": "Наши профсоюзы", + "location": "Локация", + "members": "Участники", + "contact": "Контакт", + "TradeUnion": "Профсоюз", + "tradeUnion": "профсоюз", + "map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!" +} \ No newline at end of file diff --git a/Server/app/svelte/src/join-us-component.svelte b/Server/app/svelte/src/join-us-component.svelte index 2788e66..9cd2b08 100644 --- a/Server/app/svelte/src/join-us-component.svelte +++ b/Server/app/svelte/src/join-us-component.svelte @@ -21,6 +21,7 @@ loadLocaleContent(content,"communes-component",loaded) loadLocaleContent(content,"cooperatives-component",loaded) loadLocaleContent(content,"parties-component",loaded) + loadLocaleContent(content,"trade-unions-component",loaded) loadLocaleContent(content,"countries",loaded) let locale = loadLocaleContent(content,"join-us-component",loaded) @@ -48,6 +49,7 @@ getData("/assets/communes.json",(response) => callback(response,"communes")) getData("/assets/cooperatives.json",(response) => callback(response,"cooperatives")) getData("/assets/parties.json",(response) => callback(response,"parties")) + getData("/assets/trade-unions.json",(response) => callback(response,"tradeUnions")) function mapCallback(createMap,content,locale) { let map = createMap([22, 0],2) @@ -55,15 +57,19 @@ enableCountryGrouping: true, } let groupsMarkersLayer = addMarkersEntries(entries["groups"],entriesByCountry["groups"],map,content,locale,addGroupPinContent,"green",options) - let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red",options) - let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue",options) let partiesMarkersLayer = addMarkersEntries(entries["parties"],entriesByCountry["parties"],map,content,locale,addPartyPinContent,"gold",options) + let tradeUnionsMarkersLayer = addMarkersEntries(entries["tradeUnions"],entriesByCountry["tradeUnions"],map,content,locale,addPartyPinContent,"violet",options) + let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue",options) + let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red",options) + let overlayMaps = {} overlayMaps[content.groups] = groupsMarkersLayer - overlayMaps[content.communes] = communesMarkersLayer - overlayMaps[content.cooperatives] = coopsMarkersLayer overlayMaps[content.parties] = partiesMarkersLayer + overlayMaps[content.tradeUnions] = tradeUnionsMarkersLayer + overlayMaps[content.cooperatives] = coopsMarkersLayer + overlayMaps[content.communes] = communesMarkersLayer + L.control.layers(null, overlayMaps).addTo(map) } @@ -73,7 +79,7 @@ {#key $loaded} - {#if $loaded==10} + {#if $loaded==12}

{$content.heading}

@@ -97,13 +103,14 @@

{$content.findOur}

  1. {$content.group},
  2. -
  3. {$content.commune}
  4. -
  5. {$content.cooperative} {$content.or}
  6. {$content.party}
  7. +
  8. {$content.tradeUnion}
  9. +
  10. {$content.cooperative} {$content.or}
  11. +
  12. {$content.commune}

{$content.nearYou}

-

{$content.noneNear} {$content.WhatsAppGroup} {$content.or} {$content.DiscordServer}{$content.helpStart}

+

{$content.noneNear} {$content.DiscordServer} {$content.or} {$content.WhatsAppGroup}{$content.helpStart}

mapCallback(createMap,$content,locale)} colors={["#23AC20","#CA2437","#217BC9","#FFD326"]}>

{$content["map-prompt"]}

@@ -138,13 +145,16 @@ background-image: url(https://www.libsoc.org/img/common/markers/marker-green.png); } #entities-list li:nth-of-type(2):before { - background-image: url(https://www.libsoc.org/img/common/markers/marker-red.png); + background-image: url(https://www.libsoc.org/img/common/markers/marker-gold.png); } #entities-list li:nth-of-type(3):before { - background-image: url(https://www.libsoc.org/img/common/markers/marker-blue.png); + background-image: url(https://www.libsoc.org/img/common/markers/marker-violet.png); } #entities-list li:nth-of-type(4):before { - background-image: url(https://www.libsoc.org/img/common/markers/marker-gold.png); + background-image: url(https://www.libsoc.org/img/common/markers/marker-blue.png); + } + #entities-list li:nth-of-type(5):before { + background-image: url(https://www.libsoc.org/img/common/markers/marker-red.png); } #entities-list li::marker { diff --git a/Server/app/svelte/src/landing-component.svelte b/Server/app/svelte/src/landing-component.svelte index 1c01994..5fd7805 100644 --- a/Server/app/svelte/src/landing-component.svelte +++ b/Server/app/svelte/src/landing-component.svelte @@ -51,11 +51,14 @@ getData("/assets/communes.json",(response) => callback(response,"communes")) getData("/assets/cooperatives.json",(response) => callback(response,"cooperatives")) getData("/assets/parties.json",(response) => callback(response,"parties")) + getData("/assets/trade-unions.json",(response) => callback(response,"tradeUnions")) loadLocaleContent(content,"groups-component",loaded) loadLocaleContent(content,"communes-component",loaded) loadLocaleContent(content,"cooperatives-component",loaded) loadLocaleContent(content,"parties-component",loaded) + loadLocaleContent(content,"trade-unions-component",loaded) + loadLocaleContent(content,"countries",loaded) let locale = loadLocaleContent(content,"landing-component",loaded,changeWidth) changeWidth(locale) @@ -66,15 +69,18 @@ enableCountryGrouping: true, } let groupsMarkersLayer = addMarkersEntries(entries["groups"],entriesByCountry["groups"],map,content,locale,addGroupPinContent,"green",options) - let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red",options) - let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue",options) let partiesMarkersLayer = addMarkersEntries(entries["parties"],entriesByCountry["parties"],map,content,locale,addPartyPinContent,"gold",options) + let tradeUnionsMarkersLayer = addMarkersEntries(entries["tradeUnions"],entriesByCountry["tradeUnions"],map,content,locale,addPartyPinContent,"violet",options) + let coopsMarkersLayer = addMarkersEntries(entries["cooperatives"],entriesByCountry["cooperatives"],map,content,locale,addCoopPinContent,"blue",options) + let communesMarkersLayer = addMarkersEntries(entries["communes"],entriesByCountry["communes"],map,content,locale,addCommunePinContent,"red",options) + let overlayMaps = {} overlayMaps[content.groups] = groupsMarkersLayer - overlayMaps[content.communes] = communesMarkersLayer - overlayMaps[content.cooperatives] = coopsMarkersLayer overlayMaps[content.parties] = partiesMarkersLayer + overlayMaps[content.tradeUnions] = tradeUnionsMarkersLayer + overlayMaps[content.cooperatives] = coopsMarkersLayer + overlayMaps[content.communes] = communesMarkersLayer L.control.layers(null, overlayMaps).addTo(map) } @@ -85,7 +91,7 @@ {#key $loaded} - {#if $loaded==10} + {#if $loaded==12}
@@ -105,6 +111,11 @@ coops

{$content.partiesText}

+
+

{$content.tradeUnionsTitle}

+ trade unions +

{$content.tradeUnionsText}

+

{$content.cooperativesTitle}

coops @@ -134,7 +145,7 @@
-->

{$content.findUs}

- mapCallback(createMap,$content,locale)} colors={["#23AC20","#CA2437","#217BC9","#FFD326"]}> + mapCallback(createMap,$content,locale)} colors={["#23AC20","#FFD326","#9D35CD","#217BC9","#CA2437"]}>

{$content.whatNow}

{$content.joinUs} @@ -188,7 +199,7 @@ text-align: center; } - #groups-img, #communes-img, #coops-img, #parties-img { + #groups-img, #communes-img, #coops-img, #parties-img, #trade-unions-img { position: absolute; left: 50%; transform: translate(-50%); @@ -202,6 +213,11 @@ height: 7.5rem; } + #trade-unions-img { + margin-top: 0.5rem; + height: 7.5rem; + } + #text-container { max-width: calc(100vw - 4rem); margin: auto; @@ -230,13 +246,18 @@ #container-grid { display: grid; grid-template-columns: var(--grid-width); - grid-template-rows: var(--grid-width); + grid-template-rows: 100% 100%; grid-gap: 4rem; row-gap: 2.5rem; margin-top: 2rem; margin-bottom: 1rem; } + #container-grid>:last-child { + grid-column: 1/span 2; + + } + #container-grid > div { position: relative; } diff --git a/Server/app/svelte/src/navbar/navbar-logged.svelte b/Server/app/svelte/src/navbar/navbar-logged.svelte index 2e547ea..c6bd220 100644 --- a/Server/app/svelte/src/navbar/navbar-logged.svelte +++ b/Server/app/svelte/src/navbar/navbar-logged.svelte @@ -115,9 +115,10 @@ diff --git a/Server/app/svelte/src/navbar/navbar-not-logged.svelte b/Server/app/svelte/src/navbar/navbar-not-logged.svelte index e3004ae..6c106c9 100644 --- a/Server/app/svelte/src/navbar/navbar-not-logged.svelte +++ b/Server/app/svelte/src/navbar/navbar-not-logged.svelte @@ -115,9 +115,10 @@ diff --git a/Server/app/svelte/src/profile/profile-component.svelte b/Server/app/svelte/src/profile/profile-component.svelte index 373d078..5b6fc29 100644 --- a/Server/app/svelte/src/profile/profile-component.svelte +++ b/Server/app/svelte/src/profile/profile-component.svelte @@ -15,6 +15,7 @@ import "/js/components/profile-communes.js" import "/js/components/profile-coops.js" import "/js/components/profile-parties.js" + import "/js/components/profile-trade-unions.js" import "/js/components/groups-add-component.js" // Main code @@ -26,6 +27,7 @@ let communes let coops let parties + let tradeUnions let panes let groupsAdd @@ -34,6 +36,7 @@ let communesButton let coopsButton let partiesButton + let tradeUnionsButton let buttons let currentPaneIndex = 0 @@ -66,18 +69,21 @@ setTimeout(f,100) } else { - let svgItem = svgFromObject(svgObject) - if (svgItem==null) { + let svgItems = svgFromObject(svgObject) + if (svgItems.length==0) { let f = () => styleField(div,weight,color) setTimeout(f,100) } else { div.style.fontWeight = weight - svgItem.setAttribute("fill", color) + for (let item of svgItems) { + let fill = item.getAttribute("fill") + if (fill!="#fff" && fill!=null) { + item.setAttribute("fill", color) + } + } } } - - } function fillFields() { @@ -98,10 +104,10 @@ function init() { panes = [general,groups,communes,coops,parties] - buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton] + buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton,tradeUnionsButton] if ($loaded==1 && panes.every(x => valid(x)) && buttons.every(x => valid(x))) { - panes = [general,groups,communes,coops,parties] - buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton] + panes = [general,groups,communes,coops,parties,tradeUnions] + buttons = [generalButton,groupsButton,communesButton,coopsButton,partiesButton,tradeUnionsButton] fillFields() general.style.display = "initial" @@ -155,6 +161,10 @@ parties +
diff --git a/Server/app/svelte/src/profile/profile-trade-unions.svelte b/Server/app/svelte/src/profile/profile-trade-unions.svelte new file mode 100644 index 0000000..66cb1eb --- /dev/null +++ b/Server/app/svelte/src/profile/profile-trade-unions.svelte @@ -0,0 +1,29 @@ + + + + +

Under development

+ +

Visit https://discord.gg/Qk8KUk787z and ask for your trade union to be added.

+ + \ No newline at end of file diff --git a/Server/app/svelte/src/profile/trade-unions-add-component.svelte b/Server/app/svelte/src/profile/trade-unions-add-component.svelte new file mode 100644 index 0000000..8bb25ed --- /dev/null +++ b/Server/app/svelte/src/profile/trade-unions-add-component.svelte @@ -0,0 +1,577 @@ + + + + +{#key $loaded} + {#if $loaded==3} +
+ + +
+ {#if !has_group} +
+ + +
+ {:else if has_group && !pendingGroup} +
+ + +
+ {:else} +
+ +
+ {/if} +
+ +
+ resizeInput(addressInput)} id="address-input" type="text" readonly> +
+
+
+ {#key mode} + {#if mode==0} +
+ +
+ validatePosNumber(event,membersInput,10000)}> +
+
+ {/if} + {#if mode==0 || mode==1} +
+ +
+ resizeInput(contactInput)} id="contact-input" type="text"> +
+
+
+ {/if} + {/key} + +

+ {#if !(has_group && pendingGroup)} + mapCallback(createMap,$content,locale)}> + {/if} +
+
+ {/if} +{/key} + + \ No newline at end of file diff --git a/Server/app/svelte/src/trade-unions-component.svelte b/Server/app/svelte/src/trade-unions-component.svelte new file mode 100644 index 0000000..5a15227 --- /dev/null +++ b/Server/app/svelte/src/trade-unions-component.svelte @@ -0,0 +1,178 @@ + + + + +{#key $loaded} + {#if $loaded==3} +
+ +
+

{$content.tradeUnions}

+ trade unions +

{$content.p1}

+

{$content.subheading1}

+ mapCallback(createMap,$content,locale)}> +

{$content["map-prompt"]}

+ {#each Object.entries(entriesByCountry) as [name,entries]} +

{getCountry(name)}

+
+ {#each entries as entry} +
+

{$content.name}: {entry.name}

+

{$content.location}: {getAddress(entry)}

+

{$content.members}: {entry.members}

+ {#if entry.contact.includes("@") && entry.contact.trim().split(" ").length==1} +

{$content.contact}: {entry.contact}

+ {:else if entry.contact.includes("http")} +

{$content.contact}: {entry.contact}

+ {:else} +

{$content.contact}: {entry.contact}

+ {/if} +
+ {/each} +
+ {/each} +
+
+ {/if} +{/key} + + \ No newline at end of file diff --git a/Server/db/migrations/10_create_table_trade_unions.jl b/Server/db/migrations/10_create_table_trade_unions.jl new file mode 100644 index 0000000..0ca2627 --- /dev/null +++ b/Server/db/migrations/10_create_table_trade_unions.jl @@ -0,0 +1,32 @@ +module CreateTableTradeUnions + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +include("../../lib/DatabaseSupport.jl") +import .DatabaseSupport: add_foreign_key + +function up() + create_table(:trade_unions) do + [ + primary_key() + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:name, :string) + column(:members, :int) + column(:user_id, :int) + ] + end + + add_foreign_key(:trade_unions,:user_id,:users,:id) + add_index(:trade_unions, :user_id) +end + +function down() + drop_table(:trade_unions) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846568_create_table_partners.jl b/Server/db/migrations/11_create_table_partners.jl similarity index 100% rename from Server/db/migrations/2022026611846568_create_table_partners.jl rename to Server/db/migrations/11_create_table_partners.jl diff --git a/Server/db/migrations/2022026611846569_create_table_groups_requests.jl b/Server/db/migrations/12_create_table_groups_requests.jl similarity index 94% rename from Server/db/migrations/2022026611846569_create_table_groups_requests.jl rename to Server/db/migrations/12_create_table_groups_requests.jl index f85fda4..d129966 100644 --- a/Server/db/migrations/2022026611846569_create_table_groups_requests.jl +++ b/Server/db/migrations/12_create_table_groups_requests.jl @@ -28,8 +28,6 @@ function up() add_index(:groups_requests, :user_id) - set_default("groups_requests","added",false) - end function down() diff --git a/Server/db/migrations/2022026611846570_create_table_communes_requests.jl b/Server/db/migrations/13_create_table_communes_requests.jl similarity index 100% rename from Server/db/migrations/2022026611846570_create_table_communes_requests.jl rename to Server/db/migrations/13_create_table_communes_requests.jl diff --git a/Server/db/migrations/2022026611846571_create_table_coops_requests.jl b/Server/db/migrations/14_create_table_coops_requests.jl similarity index 100% rename from Server/db/migrations/2022026611846571_create_table_coops_requests.jl rename to Server/db/migrations/14_create_table_coops_requests.jl diff --git a/Server/db/migrations/2022026611846572_create_table_parties_requests.jl b/Server/db/migrations/15_create_table_parties_requests.jl similarity index 100% rename from Server/db/migrations/2022026611846572_create_table_parties_requests.jl rename to Server/db/migrations/15_create_table_parties_requests.jl diff --git a/Server/db/migrations/16_create_table_trade_unions_requests.jl b/Server/db/migrations/16_create_table_trade_unions_requests.jl new file mode 100644 index 0000000..ef49665 --- /dev/null +++ b/Server/db/migrations/16_create_table_trade_unions_requests.jl @@ -0,0 +1,38 @@ +module CreateTableTradeUnionsRequests + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +include("../../lib/DatabaseSupport.jl") +using .DatabaseSupport +import .DatabaseSupport: add_foreign_key, set_default + +function up() + create_table(:trade_unions_requests) do + [ + primary_key() + column(:group_id, :integer) + column(:user_id, :integer) + column(:country, :string) + column(:state, :string) + column(:town, :string) + column(:contact, :string) + column(:latitude, :float) + column(:longitude, :float) + column(:members,:integer) + column(:name,:string) + column(:status,:integer) + ] + end + + add_foreign_key(:trade_unions_requests,:user_id,:users,:id) + add_foreign_key(:trade_unions_requests,:group_id,:trade_unions,:id) + + add_index(:trade_unions_requests, :user_id) + +end + +function down() + drop_table(:trade_unions_requests) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2022026611846573_create_table_groups_users.jl b/Server/db/migrations/17_create_table_groups_users.jl similarity index 100% rename from Server/db/migrations/2022026611846573_create_table_groups_users.jl rename to Server/db/migrations/17_create_table_groups_users.jl diff --git a/Server/db/migrations/2022026611846574_create_table_communes_users.jl b/Server/db/migrations/18_create_table_communes_users.jl similarity index 100% rename from Server/db/migrations/2022026611846574_create_table_communes_users.jl rename to Server/db/migrations/18_create_table_communes_users.jl diff --git a/Server/db/migrations/2022026611846575_create_table_cooperatives_users.jl b/Server/db/migrations/19_create_table_cooperatives_users.jl similarity index 100% rename from Server/db/migrations/2022026611846575_create_table_cooperatives_users.jl rename to Server/db/migrations/19_create_table_cooperatives_users.jl diff --git a/Server/db/migrations/2019052410085235_create_table_users.jl b/Server/db/migrations/1_create_table_users.jl similarity index 100% rename from Server/db/migrations/2019052410085235_create_table_users.jl rename to Server/db/migrations/1_create_table_users.jl diff --git a/Server/db/migrations/2022026611846576_create_table_parties_users.jl b/Server/db/migrations/20_create_table_parties_users.jl similarity index 100% rename from Server/db/migrations/2022026611846576_create_table_parties_users.jl rename to Server/db/migrations/20_create_table_parties_users.jl diff --git a/Server/db/migrations/2022026611846577_create_table_users_groups.jl b/Server/db/migrations/21_create_table_users_groups.jl similarity index 100% rename from Server/db/migrations/2022026611846577_create_table_users_groups.jl rename to Server/db/migrations/21_create_table_users_groups.jl diff --git a/Server/db/migrations/22_create_table_trade_unions_users.jl b/Server/db/migrations/22_create_table_trade_unions_users.jl new file mode 100644 index 0000000..4dcbd47 --- /dev/null +++ b/Server/db/migrations/22_create_table_trade_unions_users.jl @@ -0,0 +1,24 @@ +module CreateTableTradeUnionsUsers + +import SearchLight.Migrations: create_table, column, primary_key, add_index, drop_table + +function up() + create_table(:trade_unions_users) do + [ + primary_key() + column(:user_id, :int) + column(:trade_union_id, :int) + ] + end + + add_foreign_key(:trade_unions_users,:user_id,:users,:id) + add_foreign_key(:trade_unions_users,:trade_union_id,:trade_unions,:id) + add_index(:trade_unions_users, :user_id) + add_index(:trade_unions_users, :trade_union_id) +end + +function down() + drop_table(:trade_unions_users) +end + +end \ No newline at end of file diff --git a/Server/db/migrations/2021061519495560_create_table_roles.jl b/Server/db/migrations/2_create_table_roles.jl similarity index 100% rename from Server/db/migrations/2021061519495560_create_table_roles.jl rename to Server/db/migrations/2_create_table_roles.jl diff --git a/Server/db/migrations/2021061519503270_create_table_permissions.jl b/Server/db/migrations/3_create_table_permissions.jl similarity index 100% rename from Server/db/migrations/2021061519503270_create_table_permissions.jl rename to Server/db/migrations/3_create_table_permissions.jl diff --git a/Server/db/migrations/2021061519532446_create_table_roles_users.jl b/Server/db/migrations/4_create_table_roles_users.jl similarity index 100% rename from Server/db/migrations/2021061519532446_create_table_roles_users.jl rename to Server/db/migrations/4_create_table_roles_users.jl diff --git a/Server/db/migrations/2021061519540214_create_table_permissions_roles.jl b/Server/db/migrations/5_create_table_permissions_roles.jl similarity index 100% rename from Server/db/migrations/2021061519540214_create_table_permissions_roles.jl rename to Server/db/migrations/5_create_table_permissions_roles.jl diff --git a/Server/db/migrations/2022026611846565_create_table_groups.jl b/Server/db/migrations/6_create_table_groups.jl similarity index 100% rename from Server/db/migrations/2022026611846565_create_table_groups.jl rename to Server/db/migrations/6_create_table_groups.jl diff --git a/Server/db/migrations/2022026611846566_create_table_communes.jl b/Server/db/migrations/7_create_table_communes.jl similarity index 100% rename from Server/db/migrations/2022026611846566_create_table_communes.jl rename to Server/db/migrations/7_create_table_communes.jl diff --git a/Server/db/migrations/2022026611846567_create_table_cooperatives.jl b/Server/db/migrations/8_create_table_cooperatives.jl similarity index 100% rename from Server/db/migrations/2022026611846567_create_table_cooperatives.jl rename to Server/db/migrations/8_create_table_cooperatives.jl diff --git a/Server/db/migrations/2022026611846567_create_table_parties.jl b/Server/db/migrations/9_create_table_parties.jl similarity index 100% rename from Server/db/migrations/2022026611846567_create_table_parties.jl rename to Server/db/migrations/9_create_table_parties.jl diff --git a/Server/public/assets/trade-unions.json b/Server/public/assets/trade-unions.json new file mode 100644 index 0000000..0637a08 --- /dev/null +++ b/Server/public/assets/trade-unions.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/Server/public/img/common/coops.svg b/Server/public/img/common/coops.svg index 9e4b1c2..6732046 100644 --- a/Server/public/img/common/coops.svg +++ b/Server/public/img/common/coops.svg @@ -1,3 +1,3 @@ - - + + \ No newline at end of file diff --git a/Server/public/img/common/groups.svg b/Server/public/img/common/groups.svg index c58da8d..23f843c 100644 --- a/Server/public/img/common/groups.svg +++ b/Server/public/img/common/groups.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/Server/public/img/common/markers/marker-violet.png b/Server/public/img/common/markers/marker-violet.png new file mode 100644 index 0000000000000000000000000000000000000000..ea748aa32933206dee2dec724aa8d9724384a41d GIT binary patch literal 4190 zcmV-k5TWmhP)&xSZ@FT59>)p zK~#9!-J5BQomYLvf9IU{eeX6ip3QbV-jYB`pd>&sq>zfOt*QVbqyecFl_(Y10gC#e zgnS^06NTVQUKrH8eC<5FuvQfX5#bMEcq_f&?c2V)A)Ap+iO42IZ5EMD8tnsvqGUiRH7E%K zM=zKgzWZzMOjl}Ob+(NBg+~45tG|7jQSuIjz8W}xkzbtx_K3*+YxCJh-~H$tlII1; zXa4N_eU&u+Fz^mw^GS;;g)s&{@bEkjG^BA#5~n0dg0=S4<)(o>N^|Q!KYqn;&IyoR z+rF7M#$0QZd<4ihUe6bD6xs_E+Vc3p!WNsRDdl37aWie5pZ`Yj6Z(!zAI-} z4an}x9(uP@>K336!1E1VJzcc57cj=0_IVLO>St8iF?H&&)>1B2n3}tvTs%Nn}ZC7D)x0I3TB*oYJ6ug%@Z{ zpi%n7`*XANOpQ;Irp>c|tLoXm+4-Zl70(*TjhF4|X;c0K!0P}yIy>m;?QSw)Qz5RV zq@iHbrJ1SH-~}4LV9-W28JeD&VRpJ{S%>0;w|;c*TaPar$gXYQyx2GDn}U4-z`FC+ zv8J=5X*O}m5>->wO5}m;$$-kG3ZuiL4gVR%>MO5%>Mc($8OW~JJb1pc`bh(8jWL|p zcOJQ1&Y4in5|`5@Gq4zj{DQ&HIkv+vWMpWBBuPl292j}chkyLGLyHFT@i*SzW-7ts zz@>o~uxaZ?Jmb5tQc8#`c6GCKR+H&)kuOOSh6aWR;}GCkjeXU1|992Yso&A3t)hRR zOeOdVaH-O;VdDlo<0B$eXW~@{(O|qf6Cdvk6IU=}Z`3p^OW;HWt!YmStwyPDjA>^fVKb;{d5|)FmJJ$yHB3 zXVI95+y;1=Oos06Zmf2jV#rU>XZHvBVX-s9=%QEa6;Arrprp*-fcb zqFSq%T0%eY*3(SuwpZ=BTtu!C5!UvuLy1DALR4N{focLxVXaS4FnED(f{2ocFb)wV zO_uzeA=mBUW%Z)gj;kq2`OGo<}3PBdH!y^nVNiij9!A?|6$@FO2 zvw7AO+L1By=E^e+ zkB_2$tGZRnnV3E0wceh!tn2J073Cu0bb_=1lkf0QS&dC14j+4_vDW3+KlzRydjL_I z{@W2!klj9Ui^YpFTM9$BU?eGYv;sy7s6jM5~8si1za|J5ZGS=Fw00+dt z)gnS6-$qgoePS)CS~!}Rj3Ni3|ZfmAygN()m*{g8$~US z8JQf#V!8a?7cCkDK=1h-TygCyuvn&MCn;9T&G5b8sGrRMuX&QqzD5fT36?H6JKy{x+GPv3QsD}ibimuEC6vv6b3 zs75^BH2&_>g54xod>uF-Ey{?-CL%&LsvuZ4{&CN;3&g&QyGfOh+JwkexXlN3MxU>r z(NjKxMX(!n3Y!2jp694*F||=(A&hERYf&0DT-?2EAen+s??#t^OSKBr_gLr*HgRT_ z@tXO(Pa9|hP-sM4ySh+Sigs+I)+Ngz?-69rPUp*aW$Lz`AR?&x9<8Q2QDGIdhzy7b zwIp)1n#Iv-yeuL@tr#;sP+T?$5n=T3Y`t7}&YOnPvXca;B~b&^pcd>=!IIX2s1`nJ z6PI5y+H<`Mmg9#emJMX`=sZy^0wv^wtOJrPTv9Y1cA7*DA33gpV*s@{Myzw@R`!|3 zF8mb&r_cTRiQ#1fIsEvLGtnSGi#d@37C3`a?u>C9H|nk9+G3AcEMZ)2qHW1a-Ml(- zYp_`MJ@gxn>>XV)h?(IMkKDT-i=`{q)m&TbBEx@N#bQY%J+1}&6A_^p&YdW^TO_5p zWa~h>=+1Xzt>uB6A1AIYO^5#a&i|!a4#@^t)^@n6Agc{i*)d znt>k!b0R`HbWZEHXn4}dlGJOlzOK!9+GA>Po-b_wHWNo%OSa|d8ejeJqa4{gic*TL zJr|(Rq@gTaG}en%7pmtQ$*^MAn8(c1&pu`!xp&_-lzNG;J=$|?+>>dsU=mrpjK+9| zT##k1I?L=>nWy#~#`v1GThDBDcNq1wxE+2 zt$#5?(?^*Pi#+_vr+E02Ptn!a#+FOh5oA4%ADUp|*|}zemGQD{?YV%w-;UJRYSmbo zK)XCsVkS$Y zjLZ*{+Jxz$BGW@B=NPRuy@j=GShE?eOjF>97oiP!^>(^kEfS?6fDIG<&`EO8b+7pR zw-9wjPp*e8-7j=s7>|&&wX*ALFkPnUhyanTQ3=abq7s57@3)i7=E;~GN>o!(NoEt` zMZ^eSLuS2eGmcF?!*p#Lt>hcG?t9;rr^-Q}7VH&M)hYU9E1vT4bB3tYS_+CS#8WA` zHbEB*N<*Nt1i37oxl;E*tr3<&|`d$&!HD^{z>AO!8=q^+@>#Hw4?>E5t zn>)^DT}K}(7Ah0*lJkQ$3Y~GER@kS3P>TF|AFE+xc97xHaTNOL z-3Q+HlGAjpBeK&X>Ry2H@|Y_ijlyIUsVr^A34~>#GHWSKCRD}~$}=fRS%@Q+yq;tf zDWFneyy6nC7WwoUwcoaYF9KnhR++2LxHz5F=S=TC)6C}G8K$aJBsM}s<|CVY>5M>j z?%h5K{1?Djc?1JwvKmi=;rW?<;7Sq$jFyKQruHA7`1uD)3##!6_A>ybaE?mq>My_T z`D3LaMiiqG)wm2GN^?)kYlXWGy#EQ{X8@BWXODi)IK@!T?KGao)Ju|y;z;8`e`oi; z9nZAB=yA=?od6TnF{<@GI%qfNoDJ3Hiq~3HVLFF0Gzbz>!m2{hR{8-vAx#$g}pKd|G`MFTk^J1t6XY_Jk0wI(ZwIwvz|cfL`HO3X&n zuDsLSu)w9jbC3T0*X#lI0t}Z15fQwc0<-!ir327`>*tS^n%CB_>zIt^ZxY! zQ{jZuu^eazyF%=B-kGT43`H^sPLX%y+{=}l^ z0t{7-I}zJ=jn|6%M!nF)!tqMeH@^0X13P|x)<9e}n_dqvAJ0*aN~;#Z8f+A!S!!w7 zT|+B#)1uC}m=E2)@BL2!4+0F=+>4F!ba9H4JX)8N`3j3{qH@zVnCe7sT%+( zCi4`d*%kMd#&1vNYSVMbpR2;_^w|$TQ^oiw5hu zpZ(M=2X>6FIuHQmu?whHrOI41={mWNC3cZm{B{>8W}$}sQ%@gX<0yS-@AQ8 zFA<8Y8l(>E#TbQfO-#j-5Lgr9QFy;59Sn3=v4l)UmUc+Pi z*_`F9fZXxKKhBHDZooa+GLm45F zxXFfyeEf6Id?=s=SdQBIvyC$nJ+E)kAK!-)H_yc_S9cq9$(0}m7_pjvMD+=U@?6j&b-OR`Y zp{+IF3vG=_T+*~6H)3Bezq3F9cJJT*0Ps_Q5j)(BTElgQfG6)f@cwVC^u8+&q`v6& z0JBUI+8Q-mVGbumi*@g<^iZqyzq;4H?6W@tE^nvPX;sVu{ILJPj@Pf!!&{w^hAUyZr~Z|M2$?NPV2}2W@Xy&5hJ*|3CY+FZ=9+0R0Dc oT)CS2c&p3^Y1;ZqU?s-?0}~2Jef8zF+5i9m07*qoM6N<$f>oOwwg3PC literal 0 HcmV?d00001 diff --git a/Server/public/img/common/trade-unions.svg b/Server/public/img/common/trade-unions.svg new file mode 100644 index 0000000..f083786 --- /dev/null +++ b/Server/public/img/common/trade-unions.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Server/public/js/components/join-us-component.js b/Server/public/js/components/join-us-component.js index 704e5d2..da8f049 100644 --- a/Server/public/js/components/join-us-component.js +++ b/Server/public/js/components/join-us-component.js @@ -1 +1 @@ -import{S as o,i as t,a as i,b as e,s as r,e as n,n as s,d as a,c as m,o as l,h as p,t as c,j as u,w as g,k as d,x as h,l as f,y as b}from"./index-0d9f0c09.js";import{w as v}from"./index-1c123138.js";import{loadLocaleContent as k,getData as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as w}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as y,addCommunePinContent as x,addCoopPinContent as P,addPartyPinContent as T}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function A(o){let t,i,r,n,s,m,l,v,k,j,w,y,x,P,T,A,N,S,z,C,D,O,U,H,L,F,G,K,M,B,E,J,Q,R,W,Y,_,q,I,V,X,Z,$,oo,to,io,eo,ro,no,so,ao,mo,lo,po,co,uo,go,ho,fo,bo,vo,ko,jo,wo,yo,xo,Po,To,Ao,No,So,zo,Co,Do,Oo,Uo,Ho,Lo,Fo,Go,Ko,Mo,Bo,Eo,Jo,Qo,Ro=o[1].heading+"",Wo=o[1].condition1+"",Yo=o[1].condition2+"",_o=o[1].condition3+"",qo=o[1].conditionsOutcome+"",Io=o[1].subheading1+"",Vo=o[1].valueProposition1+"",Xo=o[1].valueProposition2+"",Zo=o[1].valueProposition3+"",$o=o[1].valueProposition4+"",ot=o[1].valueProposition5+"",tt=o[1].subheading2+"",it=o[1].findOur+"",et=o[1].group+"",rt=o[1].commune+"",nt=o[1].cooperative+"",st=o[1].or+"",at=o[1].party+"",mt=o[1].nearYou+"",lt=o[1].noneNear+"",pt=o[1].WhatsAppGroup+"",ct=o[1].or+"",ut=o[1].DiscordServer+"",gt=o[1].helpStart+"",dt=o[1]["map-prompt"]+"";return{c(){t=p("div"),i=p("div"),r=p("h1"),n=c(Ro),s=u(),m=p("img"),v=u(),k=p("ol"),j=p("li"),w=c(Wo),y=u(),x=p("li"),P=c(Yo),T=u(),A=p("li"),N=c(_o),S=u(),z=p("p"),C=u(),D=p("h2"),O=c(Io),U=u(),H=p("ol"),L=p("li"),F=c(Vo),G=u(),K=p("li"),M=c(Xo),B=u(),E=p("li"),J=c(Zo),Q=u(),R=p("li"),W=c($o),Y=u(),_=p("p"),q=c(ot),I=u(),V=p("h2"),X=c(tt),Z=u(),$=p("div"),oo=p("p"),to=c(it),io=u(),eo=p("ol"),ro=p("li"),no=p("a"),so=c(et),ao=c(","),mo=u(),lo=p("li"),po=p("a"),co=c(rt),uo=u(),go=p("li"),ho=p("a"),fo=c(nt),bo=u(),vo=c(st),ko=u(),jo=p("li"),wo=p("a"),yo=c(at),xo=u(),Po=p("p"),To=c(mt),Ao=u(),No=p("p"),So=c(lt),zo=u(),Co=p("a"),Do=c(pt),Oo=u(),Uo=c(ct),Ho=u(),Lo=p("a"),Fo=c(ut),Go=c(gt),Ko=u(),Mo=p("map-component"),Eo=u(),Jo=p("p"),Qo=c(dt),g(m.src,l="/img/common/join-group.svg")||d(m,"src","/img/common/join-group.svg"),d(m,"id","join-group"),d(m,"alt","join group"),d(k,"id","condition-list"),d(H,"id","value-proposition-list"),d(no,"href","/"+o[4]+"/groups"),d(po,"href","/"+o[4]+"/communes"),d(ho,"href","/"+o[4]+"/cooperatives"),d(wo,"href","/"+o[4]+"/parties"),d(eo,"id","entities-list"),d($,"id","call-to-action-list"),d(Co,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),d(Co,"target","_blank"),d(Co,"rel","noreferrer"),d(Lo,"href","https://discord.gg/Qk8KUk787z"),d(Lo,"target","_blank"),d(Lo,"rel","noreferrer"),h(Mo,"id","map"),h(Mo,"callback",Bo=o[6]),h(Mo,"colors",["#23AC20","#CA2437","#217BC9","#FFD326"]),d(Jo,"id","add-prompt"),d(i,"id","text-container"),d(t,"id","container")},m(o,a){e(o,t,a),f(t,i),f(i,r),f(r,n),f(i,s),f(i,m),f(i,v),f(i,k),f(k,j),f(j,w),f(k,y),f(k,x),f(x,P),f(k,T),f(k,A),f(A,N),f(k,S),f(k,z),z.innerHTML=qo,f(i,C),f(i,D),f(D,O),f(i,U),f(i,H),f(H,L),f(L,F),f(H,G),f(H,K),f(K,M),f(H,B),f(H,E),f(E,J),f(H,Q),f(H,R),f(R,W),f(H,Y),f(H,_),f(_,q),f(i,I),f(i,V),f(V,X),f(i,Z),f(i,$),f($,oo),f(oo,to),f($,io),f($,eo),f(eo,ro),f(ro,no),f(no,so),f(ro,ao),f(eo,mo),f(eo,lo),f(lo,po),f(po,co),f(eo,uo),f(eo,go),f(go,ho),f(ho,fo),f(go,bo),f(go,vo),f(eo,ko),f(eo,jo),f(jo,wo),f(wo,yo),f($,xo),f($,Po),f(Po,To),f(i,Ao),f(i,No),f(No,So),f(No,zo),f(No,Co),f(Co,Do),f(No,Oo),f(No,Uo),f(No,Ho),f(No,Lo),f(Lo,Fo),f(No,Go),f(i,Ko),f(i,Mo),f(i,Eo),f(i,Jo),f(Jo,Qo)},p(o,t){2&t&&Ro!==(Ro=o[1].heading+"")&&b(n,Ro),2&t&&Wo!==(Wo=o[1].condition1+"")&&b(w,Wo),2&t&&Yo!==(Yo=o[1].condition2+"")&&b(P,Yo),2&t&&_o!==(_o=o[1].condition3+"")&&b(N,_o),2&t&&qo!==(qo=o[1].conditionsOutcome+"")&&(z.innerHTML=qo),2&t&&Io!==(Io=o[1].subheading1+"")&&b(O,Io),2&t&&Vo!==(Vo=o[1].valueProposition1+"")&&b(F,Vo),2&t&&Xo!==(Xo=o[1].valueProposition2+"")&&b(M,Xo),2&t&&Zo!==(Zo=o[1].valueProposition3+"")&&b(J,Zo),2&t&&$o!==($o=o[1].valueProposition4+"")&&b(W,$o),2&t&&ot!==(ot=o[1].valueProposition5+"")&&b(q,ot),2&t&&tt!==(tt=o[1].subheading2+"")&&b(X,tt),2&t&&it!==(it=o[1].findOur+"")&&b(to,it),2&t&&et!==(et=o[1].group+"")&&b(so,et),2&t&&rt!==(rt=o[1].commune+"")&&b(co,rt),2&t&&nt!==(nt=o[1].cooperative+"")&&b(fo,nt),2&t&&st!==(st=o[1].or+"")&&b(vo,st),2&t&&at!==(at=o[1].party+"")&&b(yo,at),2&t&&mt!==(mt=o[1].nearYou+"")&&b(To,mt),2&t&<!==(lt=o[1].noneNear+"")&&b(So,lt),2&t&&pt!==(pt=o[1].WhatsAppGroup+"")&&b(Do,pt),2&t&&ct!==(ct=o[1].or+"")&&b(Uo,ct),2&t&&ut!==(ut=o[1].DiscordServer+"")&&b(Fo,ut),2&t&>!==(gt=o[1].helpStart+"")&&b(Go,gt),2&t&&Bo!==(Bo=o[6])&&h(Mo,"callback",Bo),2&t&&dt!==(dt=o[1]["map-prompt"]+"")&&b(Qo,dt)},d(o){o&&a(t)}}}function N(o){let t,i=10==o[0]&&A(o);return{c(){i&&i.c(),t=n()},m(o,r){i&&i.m(o,r),e(o,t,r)},p(o,e){10==o[0]?i?i.p(o,e):(i=A(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(o){i&&i.d(o),o&&a(t)}}}function S(o){let t,i=o[0],m=N(o);return{c(){m.c(),t=n(),this.c=s},m(o,i){m.m(o,i),e(o,t,i)},p(o,[e]){1&e&&r(i,i=o[0])?(m.d(1),m=N(o),m.c(),m.m(t.parentNode,t)):m.p(o,e)},i:s,o:s,d(o){o&&a(t),m.d(o)}}}function z(o,t,i){let e,r,n=v(0);m(o,n,(o=>i(0,e=o)));let s=v({});m(o,s,(o=>i(1,r=o)));let a={},p={};k(s,"groups-component",n),k(s,"communes-component",n),k(s,"cooperatives-component",n),k(s,"parties-component",n),k(s,"countries",n);let c=k(s,"join-us-component",n),u=(o,t)=>{a[t]=JSON.parse(o),p[t]={};for(let o of a[t]){let i=o.country;null==o.contact&&(o.contact="https://discord.gg/Qk8KUk787z"),i in p[t]?p[t][i].push(o):p[t][i]=[o]}n.update((o=>o+1))};function g(o,t,i){let e=o([22,0],2),r={enableCountryGrouping:!0},n=w(a.groups,p.groups,e,t,i,y,"green",r),s=w(a.communes,p.communes,e,t,i,x,"red",r),m=w(a.cooperatives,p.cooperatives,e,t,i,P,"blue",r),l=w(a.parties,p.parties,e,t,i,T,"gold",r),c={};c[t.groups]=n,c[t.communes]=s,c[t.cooperatives]=m,c[t.parties]=l,L.control.layers(null,c).addTo(e)}j("/assets/groups.json",(o=>u(o,"groups"))),j("/assets/communes.json",(o=>u(o,"communes"))),j("/assets/cooperatives.json",(o=>u(o,"cooperatives"))),j("/assets/parties.json",(o=>u(o,"parties"))),l((()=>{}));return[e,r,n,s,c,g,o=>g(o,r,c)]}class C extends o{constructor(o){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},z,S,r,{},null),o&&o.target&&e(o.target,this,o.anchor)}}customElements.define("join-us-component",C);export{C as default}; +import{S as o,i as t,a as i,b as e,s as r,e as n,n as s,d as a,c as m,o as l,h as p,t as c,j as u,w as g,k as d,x as h,l as f,y as b}from"./index-0d9f0c09.js";import{w as v}from"./index-1c123138.js";import{loadLocaleContent as k,getData as w}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as j}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as y,addPartyPinContent as x,addCoopPinContent as U,addCommunePinContent as P}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function T(o){let t,i,r,n,s,m,l,v,k,w,j,y,x,U,P,T,A,N,S,z,C,D,O,H,L,F,G,K,M,B,E,J,Q,R,W,Y,_,q,I,V,X,Z,$,oo,to,io,eo,ro,no,so,ao,mo,lo,po,co,uo,go,ho,fo,bo,vo,ko,wo,jo,yo,xo,Uo,Po,To,Ao,No,So,zo,Co,Do,Oo,Ho,Lo,Fo,Go,Ko,Mo,Bo,Eo,Jo,Qo,Ro,Wo,Yo,_o,qo=o[1].heading+"",Io=o[1].condition1+"",Vo=o[1].condition2+"",Xo=o[1].condition3+"",Zo=o[1].conditionsOutcome+"",$o=o[1].subheading1+"",ot=o[1].valueProposition1+"",tt=o[1].valueProposition2+"",it=o[1].valueProposition3+"",et=o[1].valueProposition4+"",rt=o[1].valueProposition5+"",nt=o[1].subheading2+"",st=o[1].findOur+"",at=o[1].group+"",mt=o[1].party+"",lt=o[1].tradeUnion+"",pt=o[1].cooperative+"",ct=o[1].or+"",ut=o[1].commune+"",gt=o[1].nearYou+"",dt=o[1].noneNear+"",ht=o[1].DiscordServer+"",ft=o[1].or+"",bt=o[1].WhatsAppGroup+"",vt=o[1].helpStart+"",kt=o[1]["map-prompt"]+"";return{c(){t=p("div"),i=p("div"),r=p("h1"),n=c(qo),s=u(),m=p("img"),v=u(),k=p("ol"),w=p("li"),j=c(Io),y=u(),x=p("li"),U=c(Vo),P=u(),T=p("li"),A=c(Xo),N=u(),S=p("p"),z=u(),C=p("h2"),D=c($o),O=u(),H=p("ol"),L=p("li"),F=c(ot),G=u(),K=p("li"),M=c(tt),B=u(),E=p("li"),J=c(it),Q=u(),R=p("li"),W=c(et),Y=u(),_=p("p"),q=c(rt),I=u(),V=p("h2"),X=c(nt),Z=u(),$=p("div"),oo=p("p"),to=c(st),io=u(),eo=p("ol"),ro=p("li"),no=p("a"),so=c(at),ao=c(","),mo=u(),lo=p("li"),po=p("a"),co=c(mt),uo=u(),go=p("li"),ho=p("a"),fo=c(lt),bo=u(),vo=p("li"),ko=p("a"),wo=c(pt),jo=u(),yo=c(ct),xo=u(),Uo=p("li"),Po=p("a"),To=c(ut),Ao=u(),No=p("p"),So=c(gt),zo=u(),Co=p("p"),Do=c(dt),Oo=u(),Ho=p("a"),Lo=c(ht),Fo=u(),Go=c(ft),Ko=u(),Mo=p("a"),Bo=c(bt),Eo=c(vt),Jo=u(),Qo=p("map-component"),Wo=u(),Yo=p("p"),_o=c(kt),g(m.src,l="/img/common/join-group.svg")||d(m,"src","/img/common/join-group.svg"),d(m,"id","join-group"),d(m,"alt","join group"),d(k,"id","condition-list"),d(H,"id","value-proposition-list"),d(no,"href","/"+o[4]+"/groups"),d(po,"href","/"+o[4]+"/parties"),d(ho,"href","/"+o[4]+"/trade-unions"),d(ko,"href","/"+o[4]+"/cooperatives"),d(Po,"href","/"+o[4]+"/communes"),d(eo,"id","entities-list"),d($,"id","call-to-action-list"),d(Ho,"href","https://discord.gg/Qk8KUk787z"),d(Ho,"target","_blank"),d(Ho,"rel","noreferrer"),d(Mo,"href","https://chat.whatsapp.com/BhnmUNljUxJ2AjeHUwyTKh"),d(Mo,"target","_blank"),d(Mo,"rel","noreferrer"),h(Qo,"id","map"),h(Qo,"callback",Ro=o[6]),h(Qo,"colors",["#23AC20","#CA2437","#217BC9","#FFD326"]),d(Yo,"id","add-prompt"),d(i,"id","text-container"),d(t,"id","container")},m(o,a){e(o,t,a),f(t,i),f(i,r),f(r,n),f(i,s),f(i,m),f(i,v),f(i,k),f(k,w),f(w,j),f(k,y),f(k,x),f(x,U),f(k,P),f(k,T),f(T,A),f(k,N),f(k,S),S.innerHTML=Zo,f(i,z),f(i,C),f(C,D),f(i,O),f(i,H),f(H,L),f(L,F),f(H,G),f(H,K),f(K,M),f(H,B),f(H,E),f(E,J),f(H,Q),f(H,R),f(R,W),f(H,Y),f(H,_),f(_,q),f(i,I),f(i,V),f(V,X),f(i,Z),f(i,$),f($,oo),f(oo,to),f($,io),f($,eo),f(eo,ro),f(ro,no),f(no,so),f(ro,ao),f(eo,mo),f(eo,lo),f(lo,po),f(po,co),f(eo,uo),f(eo,go),f(go,ho),f(ho,fo),f(eo,bo),f(eo,vo),f(vo,ko),f(ko,wo),f(vo,jo),f(vo,yo),f(eo,xo),f(eo,Uo),f(Uo,Po),f(Po,To),f($,Ao),f($,No),f(No,So),f(i,zo),f(i,Co),f(Co,Do),f(Co,Oo),f(Co,Ho),f(Ho,Lo),f(Co,Fo),f(Co,Go),f(Co,Ko),f(Co,Mo),f(Mo,Bo),f(Co,Eo),f(i,Jo),f(i,Qo),f(i,Wo),f(i,Yo),f(Yo,_o)},p(o,t){2&t&&qo!==(qo=o[1].heading+"")&&b(n,qo),2&t&&Io!==(Io=o[1].condition1+"")&&b(j,Io),2&t&&Vo!==(Vo=o[1].condition2+"")&&b(U,Vo),2&t&&Xo!==(Xo=o[1].condition3+"")&&b(A,Xo),2&t&&Zo!==(Zo=o[1].conditionsOutcome+"")&&(S.innerHTML=Zo),2&t&&$o!==($o=o[1].subheading1+"")&&b(D,$o),2&t&&ot!==(ot=o[1].valueProposition1+"")&&b(F,ot),2&t&&tt!==(tt=o[1].valueProposition2+"")&&b(M,tt),2&t&&it!==(it=o[1].valueProposition3+"")&&b(J,it),2&t&&et!==(et=o[1].valueProposition4+"")&&b(W,et),2&t&&rt!==(rt=o[1].valueProposition5+"")&&b(q,rt),2&t&&nt!==(nt=o[1].subheading2+"")&&b(X,nt),2&t&&st!==(st=o[1].findOur+"")&&b(to,st),2&t&&at!==(at=o[1].group+"")&&b(so,at),2&t&&mt!==(mt=o[1].party+"")&&b(co,mt),2&t&<!==(lt=o[1].tradeUnion+"")&&b(fo,lt),2&t&&pt!==(pt=o[1].cooperative+"")&&b(wo,pt),2&t&&ct!==(ct=o[1].or+"")&&b(yo,ct),2&t&&ut!==(ut=o[1].commune+"")&&b(To,ut),2&t&>!==(gt=o[1].nearYou+"")&&b(So,gt),2&t&&dt!==(dt=o[1].noneNear+"")&&b(Do,dt),2&t&&ht!==(ht=o[1].DiscordServer+"")&&b(Lo,ht),2&t&&ft!==(ft=o[1].or+"")&&b(Go,ft),2&t&&bt!==(bt=o[1].WhatsAppGroup+"")&&b(Bo,bt),2&t&&vt!==(vt=o[1].helpStart+"")&&b(Eo,vt),2&t&&Ro!==(Ro=o[6])&&h(Qo,"callback",Ro),2&t&&kt!==(kt=o[1]["map-prompt"]+"")&&b(_o,kt)},d(o){o&&a(t)}}}function A(o){let t,i=12==o[0]&&T(o);return{c(){i&&i.c(),t=n()},m(o,r){i&&i.m(o,r),e(o,t,r)},p(o,e){12==o[0]?i?i.p(o,e):(i=T(o),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(o){i&&i.d(o),o&&a(t)}}}function N(o){let t,i=o[0],m=A(o);return{c(){m.c(),t=n(),this.c=s},m(o,i){m.m(o,i),e(o,t,i)},p(o,[e]){1&e&&r(i,i=o[0])?(m.d(1),m=A(o),m.c(),m.m(t.parentNode,t)):m.p(o,e)},i:s,o:s,d(o){o&&a(t),m.d(o)}}}function S(o,t,i){let e,r,n=v(0);m(o,n,(o=>i(0,e=o)));let s=v({});m(o,s,(o=>i(1,r=o)));let a={},p={};k(s,"groups-component",n),k(s,"communes-component",n),k(s,"cooperatives-component",n),k(s,"parties-component",n),k(s,"trade-unions-component",n),k(s,"countries",n);let c=k(s,"join-us-component",n),u=(o,t)=>{a[t]=JSON.parse(o),p[t]={};for(let o of a[t]){let i=o.country;null==o.contact&&(o.contact="https://discord.gg/Qk8KUk787z"),i in p[t]?p[t][i].push(o):p[t][i]=[o]}n.update((o=>o+1))};function g(o,t,i){let e=o([22,0],2),r={enableCountryGrouping:!0},n=j(a.groups,p.groups,e,t,i,y,"green",r),s=j(a.parties,p.parties,e,t,i,x,"gold",r),m=j(a.tradeUnions,p.tradeUnions,e,t,i,x,"violet",r),l=j(a.cooperatives,p.cooperatives,e,t,i,U,"blue",r),c=j(a.communes,p.communes,e,t,i,P,"red",r),u={};u[t.groups]=n,u[t.parties]=s,u[t.tradeUnions]=m,u[t.cooperatives]=l,u[t.communes]=c,L.control.layers(null,u).addTo(e)}w("/assets/groups.json",(o=>u(o,"groups"))),w("/assets/communes.json",(o=>u(o,"communes"))),w("/assets/cooperatives.json",(o=>u(o,"cooperatives"))),w("/assets/parties.json",(o=>u(o,"parties"))),w("/assets/trade-unions.json",(o=>u(o,"tradeUnions"))),l((()=>{}));return[e,r,n,s,c,g,o=>g(o,r,c)]}class z extends o{constructor(o){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:i(this.attributes),customElement:!0},S,N,r,{},null),o&&o.target&&e(o.target,this,o.anchor)}}customElements.define("join-us-component",z);export{z as default}; diff --git a/Server/public/js/components/landing-component.js b/Server/public/js/components/landing-component.js index 191562d..7480c4e 100644 --- a/Server/public/js/components/landing-component.js +++ b/Server/public/js/components/landing-component.js @@ -1 +1 @@ -import{S as t,i as e,a as o,b as i,s as r,e as s,n,d as a,c as m,o as c,f as p,h as g,j as d,t as l,k as u,w as h,z as f,x as v,l as x,y as w}from"./index-0d9f0c09.js";import{w as b}from"./index-1c123138.js";import{getData as T,loadLocaleContent as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as y,addCommunePinContent as U,addCoopPinContent as z,addPartyPinContent as N}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function C(t){let e,o,r,s,n,m,c,p,b,T,j,k,y,U,z,N,C,F,L,A,E,H,K,M,Q,R,S,W,B,D,G,J,O,_,q,I,P,V,X,Y,Z,$,tt,et,ot,it,rt,st,nt,at,mt,ct,pt,gt,dt,lt,ut,ht,ft,vt,xt,wt,bt,Tt,jt,kt,yt,Ut=t[3].top+"",zt=t[3].groupsTitle+"",Nt=t[3].groupsText+"",Ct=t[3].partiesTitle+"",Ft=t[3].partiesText+"",Lt=t[3].cooperativesTitle+"",At=t[3].cooperativesText+"",Et=t[3].communesTitle+"",Ht=t[3].communesText+"",Kt=t[3].findUs+"",Mt=t[3].whatNow+"",Qt=t[3].joinUs+"",Rt=t[3].talkWithUs+"";return{c(){e=g("div"),o=g("picture"),o.innerHTML=' \n \n crowd',r=d(),s=g("div"),n=g("p"),m=l(Ut),c=d(),p=g("div"),b=g("div"),T=g("a"),j=g("h2"),k=l(zt),y=d(),U=g("img"),N=d(),C=g("p"),F=l(Nt),L=d(),A=g("div"),E=g("a"),H=g("h2"),K=l(Ct),M=d(),Q=g("img"),S=d(),W=g("p"),B=l(Ft),D=d(),G=g("div"),J=g("a"),O=g("h2"),_=l(Lt),q=d(),I=g("img"),V=d(),X=g("p"),Y=l(At),Z=d(),$=g("div"),tt=g("a"),et=g("h2"),ot=l(Et),it=d(),rt=g("img"),nt=d(),at=g("p"),mt=l(Ht),ct=d(),pt=g("h1"),gt=l(Kt),dt=d(),lt=g("map-component"),ht=d(),ft=g("h1"),vt=l(Mt),xt=d(),wt=g("div"),bt=g("a"),Tt=l(Qt),jt=d(),kt=g("a"),yt=l(Rt),u(T,"href","/"+t[6]+"/groups"),u(U,"id","groups-img"),h(U.src,z="/img/common/groups.svg")||u(U,"src","/img/common/groups.svg"),u(U,"alt","groups"),u(E,"href","/"+t[6]+"/parties"),u(Q,"id","parties-img"),h(Q.src,R="/img/common/parties.svg")||u(Q,"src","/img/common/parties.svg"),u(Q,"alt","coops"),u(J,"href","/"+t[6]+"/coops"),u(I,"id","coops-img"),h(I.src,P="/img/common/coops.svg")||u(I,"src","/img/common/coops.svg"),u(I,"alt","coops"),u(tt,"href","/"+t[6]+"/communes"),u(rt,"id","communes-img"),h(rt.src,st="/img/common/communes.svg")||u(rt,"src","/img/common/communes.svg"),u(rt,"alt","communes"),u(p,"id","container-grid"),f(p,"--grid-width",t[1]),u(pt,"id","find-us"),v(lt,"id","map"),v(lt,"callback",ut=t[9]),v(lt,"colors",["#23AC20","#CA2437","#217BC9","#FFD326"]),u(bt,"class","link-button"),u(bt,"href","/"+t[6]+"/join-us"),u(kt,"class","link-button"),u(kt,"href","https://discord.gg/Qk8KUk787z"),u(kt,"target","_blank"),u(kt,"rel","noreferrer"),u(wt,"id","action-container"),u(s,"id","text-container"),u(e,"id","container")},m(a,g){i(a,e,g),x(e,o),x(e,r),x(e,s),x(s,n),x(n,m),x(s,c),x(s,p),x(p,b),x(b,T),x(T,j),x(j,k),x(b,y),x(b,U),x(b,N),x(b,C),x(C,F),x(p,L),x(p,A),x(A,E),x(E,H),x(H,K),x(A,M),x(A,Q),x(A,S),x(A,W),x(W,B),x(p,D),x(p,G),x(G,J),x(J,O),x(O,_),x(G,q),x(G,I),x(G,V),x(G,X),x(X,Y),x(p,Z),x(p,$),x($,tt),x(tt,et),x(et,ot),x($,it),x($,rt),x($,nt),x($,at),x(at,mt),t[8](p),x(s,ct),x(s,pt),x(pt,gt),x(s,dt),x(s,lt),x(s,ht),x(s,ft),x(ft,vt),x(s,xt),x(s,wt),x(wt,bt),x(bt,Tt),x(wt,jt),x(wt,kt),x(kt,yt)},p(t,e){8&e&&Ut!==(Ut=t[3].top+"")&&w(m,Ut),8&e&&zt!==(zt=t[3].groupsTitle+"")&&w(k,zt),8&e&&Nt!==(Nt=t[3].groupsText+"")&&w(F,Nt),8&e&&Ct!==(Ct=t[3].partiesTitle+"")&&w(K,Ct),8&e&&Ft!==(Ft=t[3].partiesText+"")&&w(B,Ft),8&e&&Lt!==(Lt=t[3].cooperativesTitle+"")&&w(_,Lt),8&e&&At!==(At=t[3].cooperativesText+"")&&w(Y,At),8&e&&Et!==(Et=t[3].communesTitle+"")&&w(ot,Et),8&e&&Ht!==(Ht=t[3].communesText+"")&&w(mt,Ht),2&e&&f(p,"--grid-width",t[1]),8&e&&Kt!==(Kt=t[3].findUs+"")&&w(gt,Kt),8&e&&ut!==(ut=t[9])&&v(lt,"callback",ut),8&e&&Mt!==(Mt=t[3].whatNow+"")&&w(vt,Mt),8&e&&Qt!==(Qt=t[3].joinUs+"")&&w(Tt,Qt),8&e&&Rt!==(Rt=t[3].talkWithUs+"")&&w(yt,Rt)},d(o){o&&a(e),t[8](null)}}}function F(t){let e,o=10==t[2]&&C(t);return{c(){o&&o.c(),e=s()},m(t,r){o&&o.m(t,r),i(t,e,r)},p(t,i){10==t[2]?o?o.p(t,i):(o=C(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&a(e)}}}function A(t){let e,o=t[2],m=F(t);return{c(){m.c(),e=s(),this.c=n},m(t,o){m.m(t,o),i(t,e,o)},p(t,[i]){4&i&&r(o,o=t[2])?(m.d(1),m=F(t),m.c(),m.m(e.parentNode,e)):m.p(t,i)},i:n,o:n,d(t){t&&a(e),m.d(t)}}}function E(t,e,o){let i,r,s,n,a=b(0);m(t,a,(t=>o(2,i=t)));let g=b({});m(t,g,(t=>o(3,r=t)));let d={},l={};function u(t){o(1,n="1fr 1fr")}let h=(t,e)=>{d[e]=JSON.parse(t),l[e]={};for(let t of d[e]){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in l[e]?l[e][o].push(t):l[e][o]=[t]}a.update((t=>t+1))};T("/assets/groups.json",(t=>h(t,"groups"))),T("/assets/communes.json",(t=>h(t,"communes"))),T("/assets/cooperatives.json",(t=>h(t,"cooperatives"))),T("/assets/parties.json",(t=>h(t,"parties"))),j(g,"groups-component",a),j(g,"communes-component",a),j(g,"cooperatives-component",a),j(g,"parties-component",a),j(g,"countries",a);let f=j(g,"landing-component",a,u);function v(t,e,o){let i=t([22,0],2),r={enableCountryGrouping:!0},s=k(d.groups,l.groups,i,e,o,y,"green",r),n=k(d.communes,l.communes,i,e,o,U,"red",r),a=k(d.cooperatives,l.cooperatives,i,e,o,z,"blue",r),m=k(d.parties,l.parties,i,e,o,N,"gold",r),c={};c[e.groups]=s,c[e.communes]=n,c[e.cooperatives]=a,c[e.parties]=m,L.control.layers(null,c).addTo(i)}u(),c((()=>{}));return[s,n,i,r,a,g,f,v,function(t){p[t?"unshift":"push"]((()=>{s=t,o(0,s)}))},t=>v(t,r,f)]}class H extends t{constructor(t){super(),this.shadowRoot.innerHTML="",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},E,A,r,{},null),t&&t.target&&i(t.target,this,t.anchor)}}customElements.define("landing-component",H);export{H as default}; +import{S as t,i as e,a as o,b as i,s as n,e as r,n as s,d as a,c as m,o as c,f as p,h as d,j as g,t as l,k as u,w as h,z as f,x as v,l as x,y as w}from"./index-0d9f0c09.js";import{w as T}from"./index-1c123138.js";import{getData as b,loadLocaleContent as j}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as U}from"../../../../../../../../../js/libraries/mapTools.js";import{addGroupPinContent as k,addPartyPinContent as y,addCoopPinContent as z,addCommunePinContent as C}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t){let e,o,n,r,s,m,c,p,T,b,j,U,k,y,z,C,N,D,F,L,A,E,H,K,M,Q,R,S,W,B,G,J,O,_,q,I,P,V,X,Y,Z,$,tt,et,ot,it,nt,rt,st,at,mt,ct,pt,dt,gt,lt,ut,ht,ft,vt,xt,wt,Tt,bt,jt,Ut,kt,yt,zt,Ct,Nt,Dt,Ft,Lt,At,Et,Ht,Kt,Mt=t[3].top+"",Qt=t[3].groupsTitle+"",Rt=t[3].groupsText+"",St=t[3].partiesTitle+"",Wt=t[3].partiesText+"",Bt=t[3].tradeUnionsTitle+"",Gt=t[3].tradeUnionsText+"",Jt=t[3].cooperativesTitle+"",Ot=t[3].cooperativesText+"",_t=t[3].communesTitle+"",qt=t[3].communesText+"",It=t[3].findUs+"",Pt=t[3].whatNow+"",Vt=t[3].joinUs+"",Xt=t[3].talkWithUs+"";return{c(){e=d("div"),o=d("picture"),o.innerHTML=' \n \n crowd',n=g(),r=d("div"),s=d("p"),m=l(Mt),c=g(),p=d("div"),T=d("div"),b=d("a"),j=d("h2"),U=l(Qt),k=g(),y=d("img"),C=g(),N=d("p"),D=l(Rt),F=g(),L=d("div"),A=d("a"),E=d("h2"),H=l(St),K=g(),M=d("img"),R=g(),S=d("p"),W=l(Wt),B=g(),G=d("div"),J=d("a"),O=d("h2"),_=l(Bt),q=g(),I=d("img"),V=g(),X=d("p"),Y=l(Gt),Z=g(),$=d("div"),tt=d("a"),et=d("h2"),ot=l(Jt),it=g(),nt=d("img"),st=g(),at=d("p"),mt=l(Ot),ct=g(),pt=d("div"),dt=d("a"),gt=d("h2"),lt=l(_t),ut=g(),ht=d("img"),vt=g(),xt=d("p"),wt=l(qt),Tt=g(),bt=d("h1"),jt=l(It),Ut=g(),kt=d("map-component"),zt=g(),Ct=d("h1"),Nt=l(Pt),Dt=g(),Ft=d("div"),Lt=d("a"),At=l(Vt),Et=g(),Ht=d("a"),Kt=l(Xt),u(b,"href","/"+t[6]+"/groups"),u(y,"id","groups-img"),h(y.src,z="/img/common/groups.svg")||u(y,"src","/img/common/groups.svg"),u(y,"alt","groups"),u(A,"href","/"+t[6]+"/parties"),u(M,"id","parties-img"),h(M.src,Q="/img/common/parties.svg")||u(M,"src","/img/common/parties.svg"),u(M,"alt","coops"),u(J,"href","/"+t[6]+"/trade-unions"),u(I,"id","trade-unions-img"),h(I.src,P="/img/common/trade-unions.svg")||u(I,"src","/img/common/trade-unions.svg"),u(I,"alt","trade unions"),u(tt,"href","/"+t[6]+"/coops"),u(nt,"id","coops-img"),h(nt.src,rt="/img/common/coops.svg")||u(nt,"src","/img/common/coops.svg"),u(nt,"alt","coops"),u(dt,"href","/"+t[6]+"/communes"),u(ht,"id","communes-img"),h(ht.src,ft="/img/common/communes.svg")||u(ht,"src","/img/common/communes.svg"),u(ht,"alt","communes"),u(p,"id","container-grid"),f(p,"--grid-width",t[1]),u(bt,"id","find-us"),v(kt,"id","map"),v(kt,"callback",yt=t[9]),v(kt,"colors",["#23AC20","#FFD326","#9D35CD","#217BC9","#CA2437"]),u(Lt,"class","link-button"),u(Lt,"href","/"+t[6]+"/join-us"),u(Ht,"class","link-button"),u(Ht,"href","https://discord.gg/Qk8KUk787z"),u(Ht,"target","_blank"),u(Ht,"rel","noreferrer"),u(Ft,"id","action-container"),u(r,"id","text-container"),u(e,"id","container")},m(a,d){i(a,e,d),x(e,o),x(e,n),x(e,r),x(r,s),x(s,m),x(r,c),x(r,p),x(p,T),x(T,b),x(b,j),x(j,U),x(T,k),x(T,y),x(T,C),x(T,N),x(N,D),x(p,F),x(p,L),x(L,A),x(A,E),x(E,H),x(L,K),x(L,M),x(L,R),x(L,S),x(S,W),x(p,B),x(p,G),x(G,J),x(J,O),x(O,_),x(G,q),x(G,I),x(G,V),x(G,X),x(X,Y),x(p,Z),x(p,$),x($,tt),x(tt,et),x(et,ot),x($,it),x($,nt),x($,st),x($,at),x(at,mt),x(p,ct),x(p,pt),x(pt,dt),x(dt,gt),x(gt,lt),x(pt,ut),x(pt,ht),x(pt,vt),x(pt,xt),x(xt,wt),t[8](p),x(r,Tt),x(r,bt),x(bt,jt),x(r,Ut),x(r,kt),x(r,zt),x(r,Ct),x(Ct,Nt),x(r,Dt),x(r,Ft),x(Ft,Lt),x(Lt,At),x(Ft,Et),x(Ft,Ht),x(Ht,Kt)},p(t,e){8&e&&Mt!==(Mt=t[3].top+"")&&w(m,Mt),8&e&&Qt!==(Qt=t[3].groupsTitle+"")&&w(U,Qt),8&e&&Rt!==(Rt=t[3].groupsText+"")&&w(D,Rt),8&e&&St!==(St=t[3].partiesTitle+"")&&w(H,St),8&e&&Wt!==(Wt=t[3].partiesText+"")&&w(W,Wt),8&e&&Bt!==(Bt=t[3].tradeUnionsTitle+"")&&w(_,Bt),8&e&&Gt!==(Gt=t[3].tradeUnionsText+"")&&w(Y,Gt),8&e&&Jt!==(Jt=t[3].cooperativesTitle+"")&&w(ot,Jt),8&e&&Ot!==(Ot=t[3].cooperativesText+"")&&w(mt,Ot),8&e&&_t!==(_t=t[3].communesTitle+"")&&w(lt,_t),8&e&&qt!==(qt=t[3].communesText+"")&&w(wt,qt),2&e&&f(p,"--grid-width",t[1]),8&e&&It!==(It=t[3].findUs+"")&&w(jt,It),8&e&&yt!==(yt=t[9])&&v(kt,"callback",yt),8&e&&Pt!==(Pt=t[3].whatNow+"")&&w(Nt,Pt),8&e&&Vt!==(Vt=t[3].joinUs+"")&&w(At,Vt),8&e&&Xt!==(Xt=t[3].talkWithUs+"")&&w(Kt,Xt)},d(o){o&&a(e),t[8](null)}}}function D(t){let e,o=12==t[2]&&N(t);return{c(){o&&o.c(),e=r()},m(t,n){o&&o.m(t,n),i(t,e,n)},p(t,i){12==t[2]?o?o.p(t,i):(o=N(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(t){o&&o.d(t),t&&a(e)}}}function F(t){let e,o=t[2],m=D(t);return{c(){m.c(),e=r(),this.c=s},m(t,o){m.m(t,o),i(t,e,o)},p(t,[i]){4&i&&n(o,o=t[2])?(m.d(1),m=D(t),m.c(),m.m(e.parentNode,e)):m.p(t,i)},i:s,o:s,d(t){t&&a(e),m.d(t)}}}function A(t,e,o){let i,n,r,s,a=T(0);m(t,a,(t=>o(2,i=t)));let d=T({});m(t,d,(t=>o(3,n=t)));let g={},l={};function u(t){o(1,s="1fr 1fr")}let h=(t,e)=>{g[e]=JSON.parse(t),l[e]={};for(let t of g[e]){let o=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),o in l[e]?l[e][o].push(t):l[e][o]=[t]}a.update((t=>t+1))};b("/assets/groups.json",(t=>h(t,"groups"))),b("/assets/communes.json",(t=>h(t,"communes"))),b("/assets/cooperatives.json",(t=>h(t,"cooperatives"))),b("/assets/parties.json",(t=>h(t,"parties"))),b("/assets/trade-unions.json",(t=>h(t,"tradeUnions"))),j(d,"groups-component",a),j(d,"communes-component",a),j(d,"cooperatives-component",a),j(d,"parties-component",a),j(d,"trade-unions-component",a),j(d,"countries",a);let f=j(d,"landing-component",a,u);function v(t,e,o){let i=t([22,0],2),n={enableCountryGrouping:!0},r=U(g.groups,l.groups,i,e,o,k,"green",n),s=U(g.parties,l.parties,i,e,o,y,"gold",n),a=U(g.tradeUnions,l.tradeUnions,i,e,o,y,"violet",n),m=U(g.cooperatives,l.cooperatives,i,e,o,z,"blue",n),c=U(g.communes,l.communes,i,e,o,C,"red",n),p={};p[e.groups]=r,p[e.parties]=s,p[e.tradeUnions]=a,p[e.cooperatives]=m,p[e.communes]=c,L.control.layers(null,p).addTo(i)}u(),c((()=>{}));return[r,s,i,n,a,d,f,v,function(t){p[t?"unshift":"push"]((()=>{r=t,o(0,r)}))},t=>v(t,n,f)]}class E extends t{constructor(t){super(),this.shadowRoot.innerHTML="",e(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},A,F,n,{},null),t&&t.target&&i(t.target,this,t.anchor)}}customElements.define("landing-component",E);export{E as default}; diff --git a/Server/public/js/components/navbar-logged.js b/Server/public/js/components/navbar-logged.js index 8ac4457..6078bcc 100644 --- a/Server/public/js/components/navbar-logged.js +++ b/Server/public/js/components/navbar-logged.js @@ -1 +1 @@ -import{S as e,i as t,a as n,b as i,s,e as o,n as l,d as r,c as a,o as c,h as u,j as d,t as p,k as h,w as m,l as f,m as g,y as b,p as y,r as w,f as v}from"./index-0d9f0c09.js";import{w as j}from"./index-1c123138.js";import{loadLocaleContent as k,locales as H}from"../../../../../../../../../js/libraries/serverTools.js";function T(e,t,n){const i=e.slice();return i[23]=t[n][0],i[24]=t[n][1],i}function x(e){let t,n,s,o,l,a,c,v,j,k,x,W,M,O,E,N,S,R,U,z,I,q,A,B,C,D,F,G,J,K,P,Q,V,X,Y,Z,$,_,ee,te,ne,ie,se,oe,le,re,ae,ce,ue,de,pe,he=e[5].orgName+"",me=e[5].joinUs+"",fe=e[5].manifesto+"",ge=e[5].initiatives+"",be=e[5].groups+"",ye=e[5].communes+"",we=e[5].cooperatives+"",ve=e[5].parties+"",je=e[5].partners+"",ke=e[5].profile+"",He=Object.entries(H),Te=[];for(let t=0;t',l=d(),a=u("a"),c=u("img"),j=d(),k=u("span"),x=d(),W=u("nav"),M=u("ul"),O=u("li"),E=u("a"),N=p(me),S=d(),R=u("li"),U=u("a"),z=p(fe),I=d(),q=u("li"),A=u("button"),B=p(ge),C=d(),D=u("div"),F=u("a"),G=p(be),J=d(),K=u("a"),P=p(ye),Q=d(),V=u("a"),X=p(we),Y=d(),Z=u("a"),$=p(ve),_=d(),ee=u("a"),te=p(je),ne=d(),ie=u("li"),se=u("a"),oe=p(ke),le=d(),re=u("li"),ae=u("button"),ae.innerHTML=' \n \n globe',ce=d(),ue=u("div");for(let e=0;e{e.style.display="none"}),100)}function O(e,t,n){let i,s,o,l,r,u,d=j(0),p=j({});a(e,p,(e=>n(5,i=e)));let h=k(p,"navbar-component",d);function m(e){let t=e.style.display;n(3,r.style.display="none",r),n(2,l.style.display="none",l),e.style.display="block"==t?"none":"block"}function f(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(H);t=t.filter((e=>!n.includes(e)));let i=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=i}c((()=>{!function(){if("ru"==h){let e=()=>{null==u?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=u.style.lineHeight?(n(4,u.style.lineHeight="120%",u),n(4,u.style.top="1rem",u),n(4,u.style.width="16rem",u)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=u.style.lineHeight&&(n(4,u.style.lineHeight="400%",u),n(4,u.style.top="0rem",u),n(4,u.style.width="auto",u))};e(),addEventListener("resize",e)}}()}));return[s,o,l,r,u,i,d,p,h,function(){s.checked?n(1,o.style.background="white",o):setTimeout((()=>{n(1,o.style.position="relative",o),n(1,o.style.background="",o),n(1,o.style.boxShadow="",o)}),510)},m,f,function(e){v[e?"unshift":"push"]((()=>{s=e,n(0,s)}))},function(e){v[e?"unshift":"push"]((()=>{u=e,n(4,u)}))},()=>m(r),()=>M(r),function(e){v[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},()=>m(l),()=>M(l),e=>f(e),function(e){v[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){v[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class E extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},O,W,s,{},null),e&&e.target&&i(e.target,this,e.anchor)}}customElements.define("navbar-logged",E);export{E as default}; +import{S as e,i as t,a as n,b as i,s,e as o,n as l,d as r,c as a,o as c,h as u,j as d,t as p,k as h,w as m,l as f,m as g,y as b,p as y,r as w,f as v}from"./index-0d9f0c09.js";import{w as j}from"./index-1c123138.js";import{loadLocaleContent as k,locales as H}from"../../../../../../../../../js/libraries/serverTools.js";function T(e,t,n){const i=e.slice();return i[23]=t[n][0],i[24]=t[n][1],i}function x(e){let t,n,s,o,l,a,c,v,j,k,x,W,M,O,U,E,N,S,R,z,I,q,A,B,C,D,F,G,J,K,P,Q,V,X,Y,Z,$,_,ee,te,ne,ie,se,oe,le,re,ae,ce,ue,de,pe,he,me,fe,ge=e[5].orgName+"",be=e[5].joinUs+"",ye=e[5].manifesto+"",we=e[5].initiatives+"",ve=e[5].groups+"",je=e[5].parties+"",ke=e[5].tradeUnions+"",He=e[5].cooperatives+"",Te=e[5].communes+"",xe=e[5].partners+"",Le=e[5].profile+"",We=Object.entries(H),Me=[];for(let t=0;t',l=d(),a=u("a"),c=u("img"),j=d(),k=u("span"),x=d(),W=u("nav"),M=u("ul"),O=u("li"),U=u("a"),E=p(be),N=d(),S=u("li"),R=u("a"),z=p(ye),I=d(),q=u("li"),A=u("button"),B=p(we),C=d(),D=u("div"),F=u("a"),G=p(ve),J=d(),K=u("a"),P=p(je),Q=d(),V=u("a"),X=p(ke),Y=d(),Z=u("a"),$=p(He),_=d(),ee=u("a"),te=p(Te),ne=d(),ie=u("a"),se=p(xe),oe=d(),le=u("li"),re=u("a"),ae=p(Le),ce=d(),ue=u("li"),de=u("button"),de.innerHTML=' \n \n globe',pe=d(),he=u("div");for(let e=0;e{e.style.display="none"}),100)}function O(e,t,n){let i,s,o,l,r,u,d=j(0),p=j({});a(e,p,(e=>n(5,i=e)));let h=k(p,"navbar-component",d);function m(e){let t=e.style.display;n(3,r.style.display="none",r),n(2,l.style.display="none",l),e.style.display="block"==t?"none":"block"}function f(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(H);t=t.filter((e=>!n.includes(e)));let i=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=i}c((()=>{!function(){if("ru"==h){let e=()=>{null==u?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=u.style.lineHeight?(n(4,u.style.lineHeight="120%",u),n(4,u.style.top="1rem",u),n(4,u.style.width="16rem",u)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=u.style.lineHeight&&(n(4,u.style.lineHeight="400%",u),n(4,u.style.top="0rem",u),n(4,u.style.width="auto",u))};e(),addEventListener("resize",e)}}()}));return[s,o,l,r,u,i,d,p,h,function(){s.checked?n(1,o.style.background="white",o):setTimeout((()=>{n(1,o.style.position="relative",o),n(1,o.style.background="",o),n(1,o.style.boxShadow="",o)}),510)},m,f,function(e){v[e?"unshift":"push"]((()=>{s=e,n(0,s)}))},function(e){v[e?"unshift":"push"]((()=>{u=e,n(4,u)}))},()=>m(r),()=>M(r),function(e){v[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},()=>m(l),()=>M(l),e=>f(e),function(e){v[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){v[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class U extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},O,W,s,{},null),e&&e.target&&i(e.target,this,e.anchor)}}customElements.define("navbar-logged",U);export{U as default}; diff --git a/Server/public/js/components/navbar-not-logged.js b/Server/public/js/components/navbar-not-logged.js index 1fef068..432642b 100644 --- a/Server/public/js/components/navbar-not-logged.js +++ b/Server/public/js/components/navbar-not-logged.js @@ -1 +1 @@ -import{S as e,i as t,a as n,b as i,s,e as o,n as l,d as r,c as a,o as c,h as u,j as d,t as h,k as m,w as p,l as f,m as g,y as b,p as y,r as w,f as v}from"./index-0d9f0c09.js";import{w as j}from"./index-1c123138.js";import{loadLocaleContent as k,locales as H}from"../../../../../../../../../js/libraries/serverTools.js";function T(e,t,n){const i=e.slice();return i[23]=t[n][0],i[24]=t[n][1],i}function x(e){let t,n,s,o,l,a,c,v,j,k,x,W,M,O,E,N,S,R,U,z,I,q,A,B,C,D,F,G,J,K,P,Q,V,X,Y,Z,$,_,ee,te,ne,ie,se,oe,le,re,ae,ce,ue,de,he,me=e[5].orgName+"",pe=e[5].joinUs+"",fe=e[5].manifesto+"",ge=e[5].initiatives+"",be=e[5].groups+"",ye=e[5].communes+"",we=e[5].cooperatives+"",ve=e[5].parties+"",je=e[5].partners+"",ke=e[5].login+"",He=Object.entries(H),Te=[];for(let t=0;t',l=d(),a=u("a"),c=u("img"),j=d(),k=u("span"),x=d(),W=u("nav"),M=u("ul"),O=u("li"),E=u("a"),N=h(pe),S=d(),R=u("li"),U=u("a"),z=h(fe),I=d(),q=u("li"),A=u("button"),B=h(ge),C=d(),D=u("div"),F=u("a"),G=h(be),J=d(),K=u("a"),P=h(ye),Q=d(),V=u("a"),X=h(we),Y=d(),Z=u("a"),$=h(ve),_=d(),ee=u("a"),te=h(je),ne=d(),ie=u("li"),se=u("a"),oe=h(ke),le=d(),re=u("li"),ae=u("button"),ae.innerHTML=' \n \n globe',ce=d(),ue=u("div");for(let e=0;e{e.style.display="none"}),100)}function O(e,t,n){let i,s,o,l,r,u,d=j(0),h=j({});a(e,h,(e=>n(5,i=e)));let m=k(h,"navbar-component",d);function p(e){let t=e.style.display;n(3,r.style.display="none",r),n(2,l.style.display="none",l),e.style.display="block"==t?"none":"block"}function f(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(H);t=t.filter((e=>!n.includes(e)));let i=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=i}c((()=>{!function(){if("ru"==m){let e=()=>{null==u?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=u.style.lineHeight?(n(4,u.style.lineHeight="120%",u),n(4,u.style.top="1rem",u),n(4,u.style.width="16rem",u)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=u.style.lineHeight&&(n(4,u.style.lineHeight="400%",u),n(4,u.style.top="0rem",u),n(4,u.style.width="auto",u))};e(),addEventListener("resize",e)}}()}));return[s,o,l,r,u,i,d,h,m,function(){s.checked?n(1,o.style.background="white",o):setTimeout((()=>{n(1,o.style.position="relative",o),n(1,o.style.background="",o),n(1,o.style.boxShadow="",o)}),510)},p,f,function(e){v[e?"unshift":"push"]((()=>{s=e,n(0,s)}))},function(e){v[e?"unshift":"push"]((()=>{u=e,n(4,u)}))},()=>p(r),()=>M(r),function(e){v[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},()=>p(l),()=>M(l),e=>f(e),function(e){v[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){v[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class E extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},O,W,s,{},null),e&&e.target&&i(e.target,this,e.anchor)}}customElements.define("navbar-not-logged",E);export{E as default}; +import{S as e,i as t,a as n,b as i,s,e as o,n as l,d as r,c as a,o as c,h as u,j as d,t as h,k as m,w as p,l as f,m as g,y as b,p as y,r as w,f as v}from"./index-0d9f0c09.js";import{w as j}from"./index-1c123138.js";import{loadLocaleContent as k,locales as H}from"../../../../../../../../../js/libraries/serverTools.js";function T(e,t,n){const i=e.slice();return i[23]=t[n][0],i[24]=t[n][1],i}function x(e){let t,n,s,o,l,a,c,v,j,k,x,W,M,O,U,E,N,S,R,z,I,q,A,B,C,D,F,G,J,K,P,Q,V,X,Y,Z,$,_,ee,te,ne,ie,se,oe,le,re,ae,ce,ue,de,he,me,pe,fe,ge=e[5].orgName+"",be=e[5].joinUs+"",ye=e[5].manifesto+"",we=e[5].initiatives+"",ve=e[5].groups+"",je=e[5].parties+"",ke=e[5].tradeUnions+"",He=e[5].cooperatives+"",Te=e[5].communes+"",xe=e[5].partners+"",Le=e[5].login+"",We=Object.entries(H),Me=[];for(let t=0;t',l=d(),a=u("a"),c=u("img"),j=d(),k=u("span"),x=d(),W=u("nav"),M=u("ul"),O=u("li"),U=u("a"),E=h(be),N=d(),S=u("li"),R=u("a"),z=h(ye),I=d(),q=u("li"),A=u("button"),B=h(we),C=d(),D=u("div"),F=u("a"),G=h(ve),J=d(),K=u("a"),P=h(je),Q=d(),V=u("a"),X=h(ke),Y=d(),Z=u("a"),$=h(He),_=d(),ee=u("a"),te=h(Te),ne=d(),ie=u("a"),se=h(xe),oe=d(),le=u("li"),re=u("a"),ae=h(Le),ce=d(),ue=u("li"),de=u("button"),de.innerHTML=' \n \n globe',he=d(),me=u("div");for(let e=0;e{e.style.display="none"}),100)}function O(e,t,n){let i,s,o,l,r,u,d=j(0),h=j({});a(e,h,(e=>n(5,i=e)));let m=k(h,"navbar-component",d);function p(e){let t=e.style.display;n(3,r.style.display="none",r),n(2,l.style.display="none",l),e.style.display="block"==t?"none":"block"}function f(e){localStorage.setItem("locale",e);let t=location.href.split("/"),n=Object.keys(H);t=t.filter((e=>!n.includes(e)));let i=t.slice(0,t.length-1).join("/")+"/"+e+"/"+t[t.length-1];location.href=i}c((()=>{!function(){if("ru"==m){let e=()=>{null==u?setTimeout(e,100):(window.innerWidth<1700&&window.innerWidth>1400||window.innerWidth<400)&&"100%"!=u.style.lineHeight?(n(4,u.style.lineHeight="120%",u),n(4,u.style.top="1rem",u),n(4,u.style.width="16rem",u)):(window.innerWidth>1700||window.innerWidth>400&&window.innerWidth<1400)&&"400%"!=u.style.lineHeight&&(n(4,u.style.lineHeight="400%",u),n(4,u.style.top="0rem",u),n(4,u.style.width="auto",u))};e(),addEventListener("resize",e)}}()}));return[s,o,l,r,u,i,d,h,m,function(){s.checked?n(1,o.style.background="white",o):setTimeout((()=>{n(1,o.style.position="relative",o),n(1,o.style.background="",o),n(1,o.style.boxShadow="",o)}),510)},p,f,function(e){v[e?"unshift":"push"]((()=>{s=e,n(0,s)}))},function(e){v[e?"unshift":"push"]((()=>{u=e,n(4,u)}))},()=>p(r),()=>M(r),function(e){v[e?"unshift":"push"]((()=>{r=e,n(3,r)}))},()=>p(l),()=>M(l),e=>f(e),function(e){v[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){v[e?"unshift":"push"]((()=>{o=e,n(1,o)}))}]}class U extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},O,W,s,{},null),e&&e.target&&i(e.target,this,e.anchor)}}customElements.define("navbar-not-logged",U);export{U as default}; diff --git a/Server/public/js/components/profile-component.js b/Server/public/js/components/profile-component.js index 484580f..591d987 100644 --- a/Server/public/js/components/profile-component.js +++ b/Server/public/js/components/profile-component.js @@ -1 +1 @@ -import{S as e,i as t,a as o,b as n,s as i,h as s,j as l,n as r,k as m,l as a,m as p,d as u,r as c,c as d,q as g,o as f,e as h,f as b,z as j}from"./index-0d9f0c09.js";import{w as y}from"./index-1c123138.js";import*as v from"../../../../../../../../../js/libraries/authTools.js";import{svgFromObject as x}from"../../../../../../../../../js/libraries/miscTools.js";import"../../../../../../../../../js/components/pane-aligner.js";import"../../../../../../../../../js/components/profile-general.js";import"../../../../../../../../../js/components/profile-groups.js";import"../../../../../../../../../js/components/profile-communes.js";import"../../../../../../../../../js/components/profile-coops.js";import"../../../../../../../../../js/components/profile-parties.js";import"../../../../../../../../../js/components/groups-add-component.js";function w(e){let t,o,i,m,a,p,c,d,g;return{c(){t=s("profile-general"),o=l(),i=s("profile-groups"),m=l(),a=s("profile-communes"),p=l(),c=s("profile-coops"),d=l(),g=s("profile-parties"),j(t,"display","none"),j(i,"display","none"),j(a,"display","none"),j(c,"display","none"),j(g,"display","none")},m(s,l){n(s,t,l),e[25](t),n(s,o,l),n(s,i,l),e[26](i),n(s,m,l),n(s,a,l),e[27](a),n(s,p,l),n(s,c,l),e[28](c),n(s,d,l),n(s,g,l),e[29](g)},p:r,d(n){n&&u(t),e[25](null),n&&u(o),n&&u(i),e[26](null),n&&u(m),n&&u(a),e[27](null),n&&u(p),n&&u(c),e[28](null),n&&u(d),n&&u(g),e[29](null)}}}function T(e){let t,o=1==e[11]&&w(e);return{c(){o&&o.c(),t=h()},m(e,i){o&&o.m(e,i),n(e,t,i)},p(e,n){1==e[11]?o?o.p(e,n):(o=w(e),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(e){o&&o.d(e),e&&u(t)}}}function k(e){let t,o,d,g,f,h,b,j,y,x,w,k,L,H,M,q,E,N=e[11],R=T(e);return{c(){t=s("pane-aligner"),o=s("div"),d=s("button"),d.innerHTML=' \n general',g=l(),f=s("button"),f.innerHTML=' \n groups',h=l(),b=s("button"),b.innerHTML=' \n communes',j=l(),y=s("button"),y.innerHTML=' \n cooperatives',x=l(),w=s("button"),w.innerHTML=' \n parties',k=l(),L=s("button"),L.innerHTML=' \n logout',H=l(),M=s("div"),R.c(),this.c=r,m(L,"id","logout-button"),m(o,"id","left-column"),m(o,"class","pane"),m(o,"slot","sidebar-left"),m(M,"id","main-column"),m(M,"slot","main")},m(i,s){n(i,t,s),a(t,o),a(o,d),e[14](d),a(o,g),a(o,f),e[16](f),a(o,h),a(o,b),e[18](b),a(o,j),a(o,y),e[20](y),a(o,x),a(o,w),e[22](w),a(o,k),a(o,L),e[24](o),a(t,H),a(t,M),R.m(M,null),q||(E=[p(d,"click",e[15]),p(f,"click",e[17]),p(b,"click",e[19]),p(y,"click",e[21]),p(w,"click",e[23]),p(L,"click",v.logout)],q=!0)},p(e,t){2048&t[0]&&i(N,N=e[11])?(R.d(1),R=T(e),R.c(),R.m(M,null)):R.p(e,t)},i:r,o:r,d(o){o&&u(t),e[14](null),e[16](null),e[18](null),e[20](null),e[22](null),e[24](null),R.d(o),q=!1,c(E)}}}function L(e){return null!=e&&null!=e}function H(e,t,o){let n,i,s,l,r,m,a,p,u,c,h,j,w,T;v.redirectNotLogged();let k={},H=y(0);d(e,H,(e=>o(11,n=e)));let M=y(0);function q(e,t){for(let e of p)e.style.display="none";for(let e of T)E(e,400,"#636363");e.style.display="initial",E(t,500,"#c52a28")}function E(e,t,o){let n=e.querySelector("object");if(null==n){setTimeout((()=>E(e,t,o)),100)}else{let i=x(n);if(null==i){setTimeout((()=>E(e,t,o)),100)}else e.style.fontWeight=t,i.setAttribute("fill",o)}}function N(){if(0!=Object.keys(k).length&&null!=i){for(let e of T)E(e,400,"#636363");E(T[0],500,"#c52a28")}else setTimeout(N,100)}function R(){if(p=[s,l,r,m,a],T=[u,c,h,j,w],1==n&&p.every((e=>L(e)))&&T.every((e=>L(e))))p=[s,l,r,m,a],T=[u,c,h,j,w],N(),o(1,s.style.display="initial",s);else{setTimeout((()=>R()),100)}}v.getUser(k,H),g("profile-component",{user:k,maps:{},reloadTrigger:function(){M.update((e=>e+1))}}),f((()=>{R()}));return[i,s,l,r,m,a,u,c,h,j,w,n,H,q,function(e){b[e?"unshift":"push"]((()=>{u=e,o(6,u)}))},()=>q(s,u),function(e){b[e?"unshift":"push"]((()=>{c=e,o(7,c)}))},()=>q(l,c),function(e){b[e?"unshift":"push"]((()=>{h=e,o(8,h)}))},()=>q(r,h),function(e){b[e?"unshift":"push"]((()=>{j=e,o(9,j)}))},()=>q(m,j),function(e){b[e?"unshift":"push"]((()=>{w=e,o(10,w)}))},()=>q(a,w),function(e){b[e?"unshift":"push"]((()=>{i=e,o(0,i)}))},function(e){b[e?"unshift":"push"]((()=>{s=e,o(1,s)}))},function(e){b[e?"unshift":"push"]((()=>{l=e,o(2,l)}))},function(e){b[e?"unshift":"push"]((()=>{r=e,o(3,r)}))},function(e){b[e?"unshift":"push"]((()=>{m=e,o(4,m)}))},function(e){b[e?"unshift":"push"]((()=>{a=e,o(5,a)}))}]}class M extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},H,k,i,{},null,[-1,-1]),e&&e.target&&n(e.target,this,e.anchor)}}customElements.define("profile-component",M);export{M as default}; +import{S as e,i as t,a as n,b as o,s as i,h as s,j as l,n as r,k as m,l as a,m as u,d as p,r as c,c as d,q as f,o as g,e as h,f as b,z as j}from"./index-0d9f0c09.js";import{w as y}from"./index-1c123138.js";import*as v from"../../../../../../../../../js/libraries/authTools.js";import{svgFromObject as x}from"../../../../../../../../../js/libraries/miscTools.js";import"../../../../../../../../../js/components/pane-aligner.js";import"../../../../../../../../../js/components/profile-general.js";import"../../../../../../../../../js/components/profile-groups.js";import"../../../../../../../../../js/components/profile-communes.js";import"../../../../../../../../../js/components/profile-coops.js";import"../../../../../../../../../js/components/profile-parties.js";import"../../../../../../../../../js/components/profile-trade-unions.js";import"../../../../../../../../../js/components/groups-add-component.js";function w(e){let t,n,i,m,a,u,c,d,f,g,h;return{c(){t=s("profile-general"),n=l(),i=s("profile-groups"),m=l(),a=s("profile-parties"),u=l(),c=s("profile-trade-unions"),d=l(),f=s("profile-coops"),g=l(),h=s("profile-communes"),j(t,"display","none"),j(i,"display","none"),j(a,"display","none"),j(c,"display","none"),j(f,"display","none"),j(h,"display","none")},m(s,l){o(s,t,l),e[29](t),o(s,n,l),o(s,i,l),e[30](i),o(s,m,l),o(s,a,l),e[31](a),o(s,u,l),o(s,c,l),e[32](c),o(s,d,l),o(s,f,l),e[33](f),o(s,g,l),o(s,h,l),e[34](h)},p:r,d(o){o&&p(t),e[29](null),o&&p(n),o&&p(i),e[30](null),o&&p(m),o&&p(a),e[31](null),o&&p(u),o&&p(c),e[32](null),o&&p(d),o&&p(f),e[33](null),o&&p(g),o&&p(h),e[34](null)}}}function T(e){let t,n=1==e[13]&&w(e);return{c(){n&&n.c(),t=h()},m(e,i){n&&n.m(e,i),o(e,t,i)},p(e,o){1==e[13]?n?n.p(e,o):(n=w(e),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null)},d(e){n&&n.d(e),e&&p(t)}}}function k(e){let t,n,d,f,g,h,b,j,y,x,w,k,L,H,M,q,A,E,N,R=e[13],S=T(e);return{c(){t=s("pane-aligner"),n=s("div"),d=s("button"),d.innerHTML=' \n general',f=l(),g=s("button"),g.innerHTML=' \n groups',h=l(),b=s("button"),b.innerHTML=' \n communes',j=l(),y=s("button"),y.innerHTML=' \n cooperatives',x=l(),w=s("button"),w.innerHTML=' \n parties',k=l(),L=s("button"),L.innerHTML=' \n trade unions',H=l(),M=s("button"),M.innerHTML=' \n logout',q=l(),A=s("div"),S.c(),this.c=r,m(M,"id","logout-button"),m(n,"id","left-column"),m(n,"class","pane"),m(n,"slot","sidebar-left"),m(A,"id","main-column"),m(A,"slot","main")},m(i,s){o(i,t,s),a(t,n),a(n,d),e[16](d),a(n,f),a(n,g),e[18](g),a(n,h),a(n,b),e[20](b),a(n,j),a(n,y),e[22](y),a(n,x),a(n,w),e[24](w),a(n,k),a(n,L),e[26](L),a(n,H),a(n,M),e[28](n),a(t,q),a(t,A),S.m(A,null),E||(N=[u(d,"click",e[17]),u(g,"click",e[19]),u(b,"click",e[21]),u(y,"click",e[23]),u(w,"click",e[25]),u(L,"click",e[27]),u(M,"click",v.logout)],E=!0)},p(e,t){8192&t[0]&&i(R,R=e[13])?(S.d(1),S=T(e),S.c(),S.m(A,null)):S.p(e,t)},i:r,o:r,d(n){n&&p(t),e[16](null),e[18](null),e[20](null),e[22](null),e[24](null),e[26](null),e[28](null),S.d(n),E=!1,c(N)}}}function L(e){return null!=e&&null!=e}function H(e,t,n){let o,i,s,l,r,m,a,u,p,c,h,j,w,T,k,H;v.redirectNotLogged();let M={},q=y(0);d(e,q,(e=>n(13,o=e)));let A=y(0);function E(e,t){for(let e of p)e.style.display="none";for(let e of H)N(e,400,"#636363");e.style.display="initial",N(t,500,"#c52a28")}function N(e,t,n){let o=e.querySelector("object");if(null==o){setTimeout((()=>N(e,t,n)),100)}else{let i=x(o);if(0==i.length){setTimeout((()=>N(e,t,n)),100)}else{e.style.fontWeight=t;for(let e of i){let t=e.getAttribute("fill");"#fff"!=t&&null!=t&&e.setAttribute("fill",n)}}}}function R(){if(0!=Object.keys(M).length&&null!=i){for(let e of H)N(e,400,"#636363");N(H[0],500,"#c52a28")}else setTimeout(R,100)}function S(){if(p=[s,l,r,m,a],H=[c,h,j,w,T,k],1==o&&p.every((e=>L(e)))&&H.every((e=>L(e))))p=[s,l,r,m,a,u],H=[c,h,j,w,T,k],R(),n(1,s.style.display="initial",s);else{setTimeout((()=>S()),100)}}v.getUser(M,q),f("profile-component",{user:M,maps:{},reloadTrigger:function(){A.update((e=>e+1))}}),g((()=>{S()}));return[i,s,l,r,m,a,u,c,h,j,w,T,k,o,q,E,function(e){b[e?"unshift":"push"]((()=>{c=e,n(7,c)}))},()=>E(s,c),function(e){b[e?"unshift":"push"]((()=>{h=e,n(8,h)}))},()=>E(l,h),function(e){b[e?"unshift":"push"]((()=>{j=e,n(9,j)}))},()=>E(r,j),function(e){b[e?"unshift":"push"]((()=>{w=e,n(10,w)}))},()=>E(m,w),function(e){b[e?"unshift":"push"]((()=>{T=e,n(11,T)}))},()=>E(a,T),function(e){b[e?"unshift":"push"]((()=>{k=e,n(12,k)}))},()=>E(u,k),function(e){b[e?"unshift":"push"]((()=>{i=e,n(0,i)}))},function(e){b[e?"unshift":"push"]((()=>{s=e,n(1,s)}))},function(e){b[e?"unshift":"push"]((()=>{l=e,n(2,l)}))},function(e){b[e?"unshift":"push"]((()=>{a=e,n(5,a)}))},function(e){b[e?"unshift":"push"]((()=>{u=e,n(6,u)}))},function(e){b[e?"unshift":"push"]((()=>{m=e,n(4,m)}))},function(e){b[e?"unshift":"push"]((()=>{r=e,n(3,r)}))}]}class M extends e{constructor(e){super(),this.shadowRoot.innerHTML="",t(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},H,k,i,{},null,[-1,-1]),e&&e.target&&o(e.target,this,e.anchor)}}customElements.define("profile-component",M);export{M as default}; diff --git a/Server/public/js/components/profile-trade-unions.js b/Server/public/js/components/profile-trade-unions.js new file mode 100644 index 0000000..c496b60 --- /dev/null +++ b/Server/public/js/components/profile-trade-unions.js @@ -0,0 +1 @@ +import{S as t,i as s,a as e,b as o,s as r,h as a,j as n,n as i,z as d,d as c,o as l}from"./index-0d9f0c09.js";import"../../../../../../../../../js/libraries/authTools.js";function h(t){let s,e,r;return{c(){s=a("h3"),s.textContent="Under development",e=n(),r=a("p"),r.innerHTML='Visit https://discord.gg/Qk8KUk787z and ask for your trade union to be added.',this.c=i,d(r,"position","relative"),d(r,"margin-top","2rem")},m(t,a){o(t,s,a),o(t,e,a),o(t,r,a)},p:i,i:i,o:i,d(t){t&&c(s),t&&c(e),t&&c(r)}}}function p(t){return l((()=>{})),[]}class u extends t{constructor(t){super(),this.shadowRoot.innerHTML="",s(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},p,h,r,{},null),t&&t.target&&o(t.target,this,t.anchor)}}customElements.define("profile-trade-unions",u);export{u as default}; diff --git a/Server/public/js/components/trade-unions-add-component.js b/Server/public/js/components/trade-unions-add-component.js new file mode 100644 index 0000000..8ef12b1 --- /dev/null +++ b/Server/public/js/components/trade-unions-add-component.js @@ -0,0 +1 @@ +import{S as t,i as n,a as e,b as i,u as o,s as r,e as l,n as a,d as s,c as u,g as c,o as m,f as p,h as d,j as f,k as b,l as h,m as g,r as w,x as v,t as y}from"./index-0d9f0c09.js";import{w as k}from"./index-1c123138.js";import{getData as x,loadLocaleContent as j,sendData as C}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as T,translate as $}from"../../../../../../../../../js/libraries/mapTools.js";import{validatePosNumber as S}from"../../../../../../../../../js/libraries/miscTools.js";import"../../../../../../../../../js/components/map-component.js";function z(t){let n,e,o,l,a,u,c,m,p,v,y,k,x,j,L,C,T,$,S,z,A=t[7];function H(t,n){return t[14]?t[14]&&!t[8]?M:N:O}let U=H(t),E=U(t),I=G(t),R=!(t[14]&&t[8])&&J(t);return{c(){n=d("div"),e=d("button"),o=f(),l=d("div"),E.c(),a=f(),u=d("div"),c=d("label"),c.textContent="Location:",m=f(),p=d("div"),v=d("input"),y=f(),k=d("div"),x=f(),I.c(),j=f(),L=d("button"),L.textContent="Submit",C=f(),T=d("p"),$=f(),R&&R.c(),b(e,"class","close-button"),b(c,"for","address-input"),b(v,"id","address-input"),b(v,"type","text"),v.readOnly=!0,b(k,"class","ghost-input"),b(p,"class","input-wrapper"),b(u,"id","address-input-wrapper"),b(u,"class","input-label-wrapper"),b(L,"id","submit-button"),b(T,"id","confirmation-msg"),b(l,"id","text-container"),b(n,"id","container")},m(r,s){i(r,n,s),h(n,e),h(n,o),h(n,l),E.m(l,null),h(l,a),h(l,u),h(u,c),h(u,m),h(u,p),h(p,v),t[33](v),h(p,y),h(p,k),h(l,x),I.m(l,null),h(l,j),h(l,L),h(l,C),h(l,T),t[39](T),h(l,$),R&&R.m(l,null),S||(z=[g(e,"click",t[13]),g(v,"input",t[34]),g(L,"click",t[17])],S=!0)},p(t,n){U===(U=H(t))&&E?E.p(t,n):(E.d(1),E=U(t),E&&(E.c(),E.m(l,a))),128&n[0]&&r(A,A=t[7])?(I.d(1),I=G(t),I.c(),I.m(l,j)):I.p(t,n),t[14]&&t[8]?R&&(R.d(1),R=null):R?R.p(t,n):(R=J(t),R.c(),R.m(l,null))},d(e){e&&s(n),E.d(),t[33](null),I.d(e),t[39](null),R&&R.d(),S=!1,w(z)}}}function N(t){let n,e,o,r;return{c(){n=d("div"),e=d("button"),e.textContent="Leave",b(n,"id","button-line")},m(l,a){i(l,n,a),h(n,e),t[30](e),t[32](n),o||(r=g(e,"click",t[31]),o=!0)},p:a,d(e){e&&s(n),t[30](null),t[32](null),o=!1,r()}}}function M(t){let n,e,o,r,l,a,u,c;return{c(){n=d("div"),e=d("button"),o=y("Move"),l=f(),a=d("button"),a.textContent="Leave",b(e,"style",r="display: "+(t[8]?"none":"initial")),b(n,"id","button-line")},m(r,s){i(r,n,s),h(n,e),h(e,o),t[25](e),h(n,l),h(n,a),t[27](a),t[29](n),u||(c=[g(e,"click",t[26]),g(a,"click",t[28])],u=!0)},p(t,n){256&n[0]&&r!==(r="display: "+(t[8]?"none":"initial"))&&b(e,"style",r)},d(e){e&&s(n),t[25](null),t[27](null),t[29](null),u=!1,w(c)}}}function O(t){let n,e,o,r,l,u;return{c(){n=d("div"),e=d("button"),e.textContent="Create",o=f(),r=d("button"),r.textContent="Join",b(n,"id","button-line")},m(a,s){i(a,n,s),h(n,e),t[20](e),h(n,o),h(n,r),t[22](r),t[24](n),l||(u=[g(e,"click",t[21]),g(r,"click",t[23])],l=!0)},p:a,d(e){e&&s(n),t[20](null),t[22](null),t[24](null),l=!1,w(u)}}}function A(t){let n,e,o,r,l,u,c;return{c(){n=d("div"),e=d("label"),e.textContent="Members:",o=f(),r=d("div"),l=d("input"),b(e,"for","members-input"),b(l,"id","members-input"),b(l,"type","number"),l.value=1,b(r,"class","input-wrapper"),b(n,"id","members-input-wrapper"),b(n,"class","input-label-wrapper")},m(a,s){i(a,n,s),h(n,e),h(n,o),h(n,r),h(r,l),t[35](l),u||(c=g(l,"input",t[36]),u=!0)},p:a,d(e){e&&s(n),t[35](null),u=!1,c()}}}function H(t){let n,e,o,r,l,u,c,m,p;return{c(){n=d("div"),e=d("label"),e.textContent="Contact:",o=f(),r=d("div"),l=d("input"),u=f(),c=d("div"),b(e,"for","contact-input"),b(l,"id","contact-input"),b(l,"type","text"),b(c,"class","ghost-input"),b(r,"class","input-wrapper"),b(n,"class","input-label-wrapper")},m(a,s){i(a,n,s),h(n,e),h(n,o),h(n,r),h(r,l),t[37](l),h(r,u),h(r,c),m||(p=g(l,"input",t[38]),m=!0)},p:a,d(e){e&&s(n),t[37](null),m=!1,p()}}}function G(t){let n,e,o=0==t[7]&&A(t),r=(0==t[7]||1==t[7])&&H(t);return{c(){o&&o.c(),n=f(),r&&r.c(),e=l()},m(t,l){o&&o.m(t,l),i(t,n,l),r&&r.m(t,l),i(t,e,l)},p(t,i){0==t[7]?o?o.p(t,i):(o=A(t),o.c(),o.m(n.parentNode,n)):o&&(o.d(1),o=null),0==t[7]||1==t[7]?r?r.p(t,i):(r=H(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){o&&o.d(t),t&&s(n),r&&r.d(t),t&&s(e)}}}function J(t){let n,e;return{c(){n=d("map-component"),v(n,"id","map"),v(n,"callback",e=t[40])},m(t,e){i(t,n,e)},p(t,i){1024&i[0]&&e!==(e=t[40])&&v(n,"callback",e)},d(t){t&&s(n)}}}function U(t){let n,e=3==t[9]&&z(t);return{c(){e&&e.c(),n=l()},m(t,o){e&&e.m(t,o),i(t,n,o)},p(t,i){3==t[9]?e?e.p(t,i):(e=z(t),e.c(),e.m(n.parentNode,n)):e&&(e.d(1),e=null)},d(t){e&&e.d(t),t&&s(n)}}}function E(t){let n,e=t[9],o=U(t);return{c(){o.c(),n=l(),this.c=a},m(t,e){o.m(t,e),i(t,n,e)},p(t,i){512&i[0]&&r(e,e=t[9])?(o.d(1),o=U(t),o.c(),o.m(n.parentNode,n)):o.p(t,i)},i:a,o:a,d(t){t&&s(n),o.d(t)}}}function I(t,n,e){let i=L.latLng(n,e);t.setLatLng(i)}function R(t){t.nextElementSibling.innerHTML=t.value}function _(t,n,e){let i,o,{map:r=null}=n,l=k(0);u(t,l,(t=>e(9,i=t)));let a,s,d,f,b,h=k({});u(t,h,(t=>e(10,o=t)));let g,w,v,y;x("/assets/trade-unions.json",(t=>{a=JSON.parse(t),s={};for(let t of a){let n=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),n in s?s[n].push(t):s[n]=[t]}l.update((t=>t+1))}));let z=["","",""],N={},M=function(t,n){let e=new L.Icon({iconUrl:"/img/common/markers/marker-black.png",shadowUrl:"https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]});return L.marker([t,n],{icon:e})}(0,0);M.setOpacity(0);let O,A=[],H=c("profile-component"),G=H.closeGroupsAdd,J=H.maps,U=H.onLoadedGroups,E=H.userGroups,_=H.user,D=0!=E.length,K=D?2:0;D&&(O=null!=E[0].status,O&&(K=3));let Q=j(h,"trade-unions-component",l);function Y(t,n){x(`https://nominatim.openstreetmap.org/reverse?lat=${t}&lon=${n}&format=jsonv2`,(t=>{let n=(t=JSON.parse(t)).address,i=n.city||n.town||n.village||n.hamlet,o=n.state,r=n.country;null!=o?r+=", "+o:o="",null!=i?r+=", "+i:i="",e(3,w.value=r,w),R(w)}))}function q(t,n){x(`https://nominatim.openstreetmap.org/reverse?lat=${t}&lon=${n}&format=jsonv2&accept-language=en`,(t=>{let n=(t=JSON.parse(t)).address;if(null!=n){let t=n.city||n.town||n.village||n.hamlet,e=n.state,i=n.country;null!=e||(e=""),null!=t||(t=""),z=[i,e,t]}}))}function B(t,n,e){let i,o=""+n.TradeUnion+"
";for(let r of["location","members","contact"]){let l=n[r]+": ";if("contact"==r)o+=l+""+t.contact+"";else if("location"==r){let r,a=[t.country,t.state,t.town].filter((t=>null!=t&&null!=t));r="en"==e?a.map((t=>t)).join(", "):a.map((t=>$(n,t))).join(", "),o+=l+r+"
",i=[t.latitude,t.longitude]}else o+=l+t[r]+"
"}return{text:o,coordinates:i}}function F(t,n,i){e(19,r=t([22,0],2)),J.groupsAdd=r,T(a,s,r,n,i,B,"green",{enableCountryGrouping:!1,pinCallback:V}),M.addTo(r),r.on("click",(function(t){if(0==K){let n=t.latlng.lat,e=t.latlng.lng;N.latitude=n,N.longitude=e,N.id=null,I(M,n,e),M.setOpacity(1),Y(n,e),q(n,e)}}))}function P(t){!1!==t?(0!=K||_.verified?e(2,g.innerHTML="Success!",g):e(2,g.innerHTML="You have been added to our database! Now go to our Discord to verify yourself.",g),e(2,g.style.color="green",g),0!=K&&1!=K||(E[0]={}),E[0].country=""==z[0]?null:z[0],E[0].state=""==z[1]?null:z[1],E[0].town=""==z[2]?null:z[2],E[0].members=N.members,U()):(e(2,g.innerHTML="Something went wrong.",g),e(2,g.style.color="red",g))}function V(t,n){if(1==K){let e=n.latlng.lat,i=n.latlng.lng;N.latitude=e,N.longitude=i,N.id=t.id,N.members=t.members,I(M,e,i),M.setOpacity(1),Y(e,i),q(e,i)}}function W(t){for(let t of A)null!=t&&(t.style.background="rgba(197, 43, 40, 0.319)",t.style.color="black");e(6,A[t].style.background="rgb(197, 43, 40)",A),e(6,A[t].style.color="white",A),e(7,K=t)}function X(){if(3==i)W(K),2!=K&&3!=K||e(3,w.value=function(t){if(null!=t)return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==Q?t:$(o,t))).join(", ");return"Create or join trade-union"}(E[0]),w);else{setTimeout((()=>X()),100)}}j(h,"countries",l),m((()=>{X()}));return t.$$set=t=>{"map"in t&&e(19,r=t.map)},[f,b,g,w,v,y,A,K,O,i,o,l,h,G,D,Q,F,function(){if(""!=z[0]||3==K){let t,n;0==K?(t=y.value,n=v.value):1==K?n=v.value:2==K||3==K?(t="",n=""):3==K&&(t="",n="",z=[null,null,null],N.latitude=null,N.longitude=null),d={country:z[0],state:z[1],town:z[2],latitude:N.latitude,longitude:N.longitude,contact:""==n?null:n,members:""==t?null:parseInt(t),group_id:N.id,mode:K},""==d.state&&(d.state=null),""==d.town&&(d.town=null),C("/"+Q+"/trade-unions-add-post/",d,P)}},W,r,function(t){p[t?"unshift":"push"]((()=>{A[0]=t,e(6,A)}))},()=>W(0),function(t){p[t?"unshift":"push"]((()=>{A[1]=t,e(6,A)}))},()=>W(1),function(t){p[t?"unshift":"push"]((()=>{b=t,e(1,b)}))},function(t){p[t?"unshift":"push"]((()=>{A[2]=t,e(6,A)}))},()=>W(2),function(t){p[t?"unshift":"push"]((()=>{A[3]=t,e(6,A)}))},()=>W(3),function(t){p[t?"unshift":"push"]((()=>{f=t,e(0,f)}))},function(t){p[t?"unshift":"push"]((()=>{A[3]=t,e(6,A)}))},()=>W(3),function(t){p[t?"unshift":"push"]((()=>{f=t,e(0,f)}))},function(t){p[t?"unshift":"push"]((()=>{w=t,e(3,w)}))},()=>R(w),function(t){p[t?"unshift":"push"]((()=>{y=t,e(5,y)}))},t=>S(t,y,1e4),function(t){p[t?"unshift":"push"]((()=>{v=t,e(4,v)}))},()=>R(v),function(t){p[t?"unshift":"push"]((()=>{g=t,e(2,g)}))},t=>F(t,o,Q)]}class D extends t{constructor(t){super(),this.shadowRoot.innerHTML="",n(this,{target:this.shadowRoot,props:e(this.attributes),customElement:!0},_,E,r,{map:19},null,[-1,-1]),t&&(t.target&&i(t.target,this,t.anchor),t.props&&(this.$set(t.props),o()))}static get observedAttributes(){return["map"]}get map(){return this.$$.ctx[19]}set map(t){this.$$set({map:t}),o()}}customElements.define("trade-unions-add-component",D);export{D as default}; diff --git a/Server/public/js/components/trade-unions-component.js b/Server/public/js/components/trade-unions-component.js new file mode 100644 index 0000000..0cdd14e --- /dev/null +++ b/Server/public/js/components/trade-unions-component.js @@ -0,0 +1 @@ +import{S as t,i as n,a as o,b as e,s as r,e as a,n as c,d as i,c as m,o as s,h as l,t as p,j as u,k as d,w as f,x as g,l as h,y as b,p as j}from"./index-0d9f0c09.js";import{w as x}from"./index-1c123138.js";import{loadLocaleContent as y,getData as v}from"../../../../../../../../../js/libraries/serverTools.js";import{addMarkersEntries as w,translate as k}from"../../../../../../../../../js/libraries/mapTools.js";import{addTradeUnionPinContent as z}from"../../../../../../../../../js/mapFuncs.js";import"../../../../../../../../../js/components/map-component.js";function N(t,n,o){const e=t.slice();return e[12]=n[o][0],e[3]=n[o][1],e}function O(t,n,o){const e=t.slice();return e[15]=n[o],e}function T(t){let n,o,r,a,c,m,s,x,y,v,w,k,z,O,T,U,C,D,E,S,_=t[1].tradeUnions+"",A=t[1].p1+"",F=t[1].subheading1+"",G=t[1]["map-prompt"]+"",H=Object.entries(t[0]),J=[];for(let n=0;no(2,r=t)));let c,i,l=x({});m(t,l,(t=>o(1,e=t)));let p=y(l,"trade-unions-component",a);y(l,"countries",a);function u(t,n,o){let e=t([22,0],2);w(c,i,e,n,o,z,"violet",{enableCountryGrouping:!0})}v("/assets/trade-unions.json",(t=>{o(3,c=JSON.parse(t)),o(0,i={});for(let t of c){let n=t.country;null==t.contact&&(t.contact="https://discord.gg/Qk8KUk787z"),n in i?i[n].push(t):o(0,i[n]=[t],i)}a.update((t=>t+1))})),s((()=>{}));return[i,e,r,c,a,l,p,u,function(t){return"en"==p?t:k(e,t)},function(t){return[t.country,t.state,t.town].filter((t=>null!=t)).map((t=>"en"==p?t:k(e,t))).join(", ")},t=>u(t,e,p)]}class F extends t{constructor(t){super(),this.shadowRoot.innerHTML="",n(this,{target:this.shadowRoot,props:o(this.attributes),customElement:!0},A,_,r,{},null),t&&t.target&&e(t.target,this,t.anchor)}}customElements.define("trade-unions-component",F);export{F as default}; diff --git a/Server/public/js/libraries/miscTools.js b/Server/public/js/libraries/miscTools.js index 64af615..0abfbf9 100644 --- a/Server/public/js/libraries/miscTools.js +++ b/Server/public/js/libraries/miscTools.js @@ -13,9 +13,9 @@ export function debounce(func, timeout){ } export function svgFromObject(object) { - var objectDoc = object.contentDocument; - var svgItem = objectDoc.querySelector("path"); - return svgItem + var objectDoc = object.contentDocument + var svgItems = objectDoc.querySelectorAll("path") + return svgItems } export function rem2px(rem) { diff --git a/Server/public/js/mapFuncs.js b/Server/public/js/mapFuncs.js index f37d0d7..b024f03 100644 --- a/Server/public/js/mapFuncs.js +++ b/Server/public/js/mapFuncs.js @@ -6,7 +6,15 @@ export function addGroupPinContent(g,content,locale) { for (let field of ["location","members","contact"]) { let fieldText = content[field] + ": " if (field=="contact") { - text += fieldText + "" + g.contact + "" + if (g.contact.includes("@") && g.contact.trim().split(" ").length==1) { + text += fieldText + "" + g.contact + "" + } + else if (g.contact.includes("http")) { + text += fieldText + "" + g.contact + "" + } + else { + text += fieldText + g.contact + "
" + } } else if (field=="location") { let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined) @@ -175,4 +183,31 @@ export function addPartnersPinContent(g,content,locale) { } } return {text,coordinates} +} + +export function addTradeUnionPinContent(g,content,locale) { + let coordinates + let text = ""+content["TradeUnion"]+"
" + for (let field of ["name","location","members","contact"]) { + let fieldText = content[field] + ": " + if (field=="contact") { + text += fieldText + "" + g.contact + "" + } + else if (field=="location") { + let location = [g.country,g.state,g.town].filter(x => x!=null && x!=undefined) + let locationString + if (locale=="en") { + locationString = location.map(x => x).join(", ") + } + else { + locationString = location.map(x => translate(content, x)).join(", ") + } + text += fieldText + locationString + "
" + coordinates = [g.latitude,g.longitude] + } + else { + text += fieldText + g[field] + "
" + } + } + return {text,coordinates} } \ No newline at end of file diff --git a/Server/public/locales/en/landing-component.json b/Server/public/locales/en/landing-component.json index 0e807c8..9199c05 100644 --- a/Server/public/locales/en/landing-component.json +++ b/Server/public/locales/en/landing-component.json @@ -1,13 +1,15 @@ { "top": "Our organization is a decentralized federation build upon the principle of free association. It consists of many groups of people united around a cause of bringing down exploitative politico-economic systems. We aim to replace them with libertarian socialist systems based on decentralization, direct democracy and worker-ownership of the means of production with the goal of creating an equitable, democratic and sustainable world by stopping exploitation of humans and nature.", "groupsTitle": "GROUPS", - "groupsText": "We organize groups for the purposes of education, advocacy, anti-fascist action and mutual aid. Our objective is to demonstrate how the current politico-economic systems detrimentally impact our well-being, present alternative approaches, and engage in mutual aid to alleviate the challenges of living under capitalism.", + "groupsText": "We organize groups for the purposes of education, advocacy, anti-fascist action and mutual aid. Our objective is to demonstrate how the current politico-economic systems detrimentally impact our well-being, present alternative approaches, and engage in mutual aid.", "communesTitle": "COMMUNES", "communesText": "We establish communes based on libertarian socialist principles, where commune members have ownership over land, houses, and the means of production as well as make decisions using direct democracy. We are gradually expanding our socialist world, one commune at a time.", "cooperativesTitle": "COOPERATIVES", - "cooperativesText": "We form worker cooperatives to finance the operations of our groups and communes. Recognizing that economic power influences political power, we consider the establishment of cooperatives to be one of the initial steps towards achieving socialism.", + "cooperativesText": "We form worker cooperatives to finance the operations of our groups and communes. Recognizing that economic power influences political power, we consider the establishment of cooperatives to be a vital activity.", "partiesTitle": "PARTIES", "partiesText": "We create political parties in order to push for reforms allowing us to easier further our goals, to move the Overton window as well as to gain popularity. However, we recognize that we cannot achieve libertarian socialism through institutions which act contrary to our goals.", + "tradeUnionsTitle": "TRADE UNIONS", + "tradeUnionsText": "We promote trade unions, which empower laborers to collectively advocate for fair treatment, just wages, and improved working conditions. Struggle at a place of work is an integral part of our strategy to achieve libertarian socialism.", "findUs": "Find Us", "whatNow": "What Now?", "joinUs": "Join Us", diff --git a/Server/public/locales/en/navbar-component.json b/Server/public/locales/en/navbar-component.json index 68b400b..c64073f 100644 --- a/Server/public/locales/en/navbar-component.json +++ b/Server/public/locales/en/navbar-component.json @@ -7,6 +7,7 @@ "communes": "Communes", "cooperatives": "Cooperatives", "parties": "Parties", + "tradeUnions": "Trade Unions", "partners": "Partners", "login": "Login", "profile": "Profile" diff --git a/Server/public/locales/en/trade-unions-component.json b/Server/public/locales/en/trade-unions-component.json new file mode 100644 index 0000000..cad5d69 --- /dev/null +++ b/Server/public/locales/en/trade-unions-component.json @@ -0,0 +1,11 @@ +{ + "tradeUnions": "Trade Unions", + "p1": "Trade unions play a pivotal role in safeguarding the rights and welfare of workers. Trade unions constitute an integral part of our organization, allowing workers to unite and collectively negotiate for fair wages, better working conditions, and improved labour rights. By fostering solidarity and mobilizing for collective action, trade unions contribute to our overarching mission of dismantling exploitative systems and ushering in a world centered on decentralized decision-making, direct democracy, and worker self-management.", + "subheading1": "Our Trade Unions", + "location": "Location", + "members": "Members", + "contact": "Contact", + "TradeUnion": "Trade union", + "tradeUnion": "trade union", + "map-prompt": "Want to appear on our map? Contact us!" +} \ No newline at end of file diff --git a/Server/public/locales/ru/landing-component.json b/Server/public/locales/ru/landing-component.json index 5eb789b..46c7729 100644 --- a/Server/public/locales/ru/landing-component.json +++ b/Server/public/locales/ru/landing-component.json @@ -8,6 +8,8 @@ "cooperativesText": "Мы формируем рабочие кооперативы для финансирования операций наших групп и коммун, а также формирования основы новой социалистической экономики. Признавая, что экономическая власть влияет на политическую власть, мы считаем создание кооперативов одним из первых шагов на пути к социализму.", "partiesTitle": "ПАРТИИ", "partiesText": "Мы создаем политические партии, чтобы продвигать реформы, которые позволят легче достичь наших целей, сдвигать окно Овертона и увеличивать нашу популярность. Однако мы признаем, что мы не можем достичь либертарианского социализма с помощью институтов, действующих против наших целей.", + "tradeUnionsTitle": "ПРОФСОЮЗЫ", + "tradeUnionsText": "Мы поддерживаем профсоюзы, которые дают возможность работникам коллективно выступать за справедливое обращение, справедливую заработную плату и улучшение условий труда. Борьба на месте работы — неотъемлемая часть нашей стратегии по достижению либертарного социализма.", "findUs": "Найди нас", "whatNow": "Что теперь?", "joinUs": "Присоединяйся", diff --git a/Server/public/locales/ru/navbar-component.json b/Server/public/locales/ru/navbar-component.json index b1df46c..eef8043 100644 --- a/Server/public/locales/ru/navbar-component.json +++ b/Server/public/locales/ru/navbar-component.json @@ -8,6 +8,7 @@ "cooperatives": "Кооперативы", "parties": "Партии", "partners": "Партнеры", + "tradeUnions": "Профсоюзы", "login": "Войти", "profile": "Профиль" } \ No newline at end of file diff --git a/Server/public/locales/ru/trade-unions-component.json b/Server/public/locales/ru/trade-unions-component.json new file mode 100644 index 0000000..cd53368 --- /dev/null +++ b/Server/public/locales/ru/trade-unions-component.json @@ -0,0 +1,11 @@ +{ + "tradeUnions": "Профсоюзы", + "p1": "Профсоюзы играют ключевую роль в защите прав и благосостояния трудящихся. Профсоюзы составляют неотъемлемую часть нашей организации, позволяя работникам объединяться и вести коллективные переговоры о справедливой заработной плате, лучших условиях труда и улучшенных трудовых правах. Укрепляя солидарность и мобилизуя для коллективных действий, профсоюзы вносят свой вклад в нашу всеобъемлющую миссию по устранению эксплуататорских систем и установлению мира, основанного на децентрализованном принятии решений, прямой демократии и самоуправлении рабочих.", + "subheading1": "Наши профсоюзы", + "location": "Локация", + "members": "Участники", + "contact": "Контакт", + "TradeUnion": "Профсоюз", + "tradeUnion": "профсоюз", + "map-prompt": "Хочешь оказаться на нашей карте? Напиши нам!" +} \ No newline at end of file diff --git a/Server/routes.jl b/Server/routes.jl index ded2ad2..55fab81 100644 --- a/Server/routes.jl +++ b/Server/routes.jl @@ -88,6 +88,14 @@ route("/:locale/parties-add/*", PartiesController.parties_add, named = :parties_ route("/:locale/parties-add-post/*", PartiesController.parties_add_post, method = POST, named = :parties_add_post) +#---Trade unions--------------------------------------------------------- + +route("/:locale/trade-unions/*", TradeUnionsController.trade_unions, named = :trade_unions) + +route("/:locale/trade-unions-add/*", TradeUnionsController.trade_unions_add, named = :trade_unions_add) + +route("/:locale/trade-unions-add-post/*", TradeUnionsController.trade_unions_add_post, method = POST, named = :trade_unions_add_post) + #---Partners--------------------------------------------------------- route("/:locale/partners/*", PartnersController.partners, named = :partners)