From 36de2fce085009464e090e26b9352e3a12bf0f81 Mon Sep 17 00:00:00 2001 From: a-ill Date: Wed, 12 Jul 2023 21:25:28 +0300 Subject: [PATCH] Update --- Server/app/resources/basic/BasicController.jl | 20 ++ .../app/resources/basic/views/parties.jl.html | 1 + Server/app/svelte/public/js/parties.js | 52 ++++++ .../public/locales/en/join-us-component.json | 1 + .../public/locales/en/landing-component.json | 4 +- .../public/locales/en/navbar-component.json | 1 + .../public/locales/en/parties-component.json | 12 ++ .../public/locales/ru/join-us-component.json | 3 +- .../public/locales/ru/landing-component.json | 8 +- .../public/locales/ru/navbar-component.json | 1 + .../public/locales/ru/parties-component.json | 12 ++ Server/app/svelte/rollup.config.js | 1 + .../app/svelte/src/join-us-component.svelte | 12 +- .../app/svelte/src/landing-component.svelte | 19 +- .../svelte/src/navbar/navbar-component.svelte | 1 + .../app/svelte/src/parties-component.svelte | 172 ++++++++++++++++++ .../public/img/common/markers/marker-gold.png | Bin 0 -> 4274 bytes .../img/common/markers/marker-gold.webp | Bin 0 -> 2314 bytes Server/public/img/common/parties.svg | 3 + Server/public/img/parties/roots.png | Bin 0 -> 169195 bytes Server/public/img/parties/roots.webp | Bin 0 -> 95540 bytes .../public/js/components/join-us-component.js | 2 +- .../public/js/components/landing-component.js | 2 +- .../public/js/components/navbar-component.js | 2 +- .../public/js/components/parties-component.js | 1 + Server/public/js/parties.js | 52 ++++++ .../public/locales/en/join-us-component.json | 1 + .../public/locales/en/landing-component.json | 4 +- .../public/locales/en/navbar-component.json | 1 + .../public/locales/en/parties-component.json | 12 ++ .../public/locales/ru/join-us-component.json | 3 +- .../public/locales/ru/landing-component.json | 8 +- .../public/locales/ru/navbar-component.json | 1 + .../public/locales/ru/parties-component.json | 12 ++ Server/routes.jl | 3 +- 35 files changed, 407 insertions(+), 20 deletions(-) create mode 100644 Server/app/resources/basic/views/parties.jl.html create mode 100644 Server/app/svelte/public/js/parties.js create mode 100644 Server/app/svelte/public/locales/en/parties-component.json create mode 100644 Server/app/svelte/public/locales/ru/parties-component.json create mode 100644 Server/app/svelte/src/parties-component.svelte create mode 100644 Server/public/img/common/markers/marker-gold.png create mode 100644 Server/public/img/common/markers/marker-gold.webp create mode 100644 Server/public/img/common/parties.svg create mode 100644 Server/public/img/parties/roots.png create mode 100644 Server/public/img/parties/roots.webp create mode 100644 Server/public/js/components/parties-component.js create mode 100644 Server/public/js/parties.js create mode 100644 Server/public/locales/en/parties-component.json create mode 100644 Server/public/locales/ru/parties-component.json diff --git a/Server/app/resources/basic/BasicController.jl b/Server/app/resources/basic/BasicController.jl index cb4b5b7..9670be4 100644 --- a/Server/app/resources/basic/BasicController.jl +++ b/Server/app/resources/basic/BasicController.jl @@ -13,6 +13,7 @@ dict_layouts = Dict( :groups => generate_layout_html("main",controller,"groups",libraries=["Leaflet"]), :cooperatives => generate_layout_html("main",controller,"cooperatives",libraries=["Leaflet"]), :communes => generate_layout_html("main",controller,"communes",libraries=["Leaflet"]), + :parties => generate_layout_html("main",controller,"parties",libraries=["Leaflet"]), :partners => generate_layout_html("main",controller,"partners",libraries=["Leaflet"]), :compass => generate_layout_html("main",controller,"compass"), ) @@ -96,6 +97,17 @@ const partners_info = Dict( ) ) +const parties_info = Dict( + "en" => Dict( + :title => "LibSoc - Parties", + :description => "" + ), + "ru" => Dict( + :title => "LibSoc - Партии", + :description => "" + ) +) + const compass_info = Dict( "en" => Dict( :title => "LibSoc - Political Compass", @@ -174,6 +186,14 @@ function partners() ) end +function parties() + locale = get_locale() + html(:basic,:parties, layout = dict_layouts[:parties], context = @__MODULE__, + title = parties_info[locale][:title], + description = parties_info[locale][:description] + ) +end + function political_compass() locale = get_locale() html(:basic,:compass, layout = dict_layouts[:compass], context = @__MODULE__, diff --git a/Server/app/resources/basic/views/parties.jl.html b/Server/app/resources/basic/views/parties.jl.html new file mode 100644 index 0000000..93bbe3e --- /dev/null +++ b/Server/app/resources/basic/views/parties.jl.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/Server/app/svelte/public/js/parties.js b/Server/app/svelte/public/js/parties.js new file mode 100644 index 0000000..d62260d --- /dev/null +++ b/Server/app/svelte/public/js/parties.js @@ -0,0 +1,52 @@ +export let parties = [ + { + logo: "roots", + name: "Roots", + location: ["ireland",[52.98479517270413, -7.649233227534782]], + members: 6, + link: "https://discord.gg/pSTMacJZsK", + description: "descriptionRoots" + } +] + +export function addMarkersParties(map,content) { + for (let g of parties) { + let coordinates + let text = "" + for (let field in g) { + let fieldText + if (field!="logo") { + fieldText = content[field] + ": " + } + if (field=="logo") { + text += "logo" + "
" + } + else if (field=="link") { + text += fieldText + "" + g.link + "" + "
" + } + else if (field=="website") { + text += fieldText + "" + g.website + "" + "
" + } + else if (field=="location") { + text += fieldText + content[g[field][0]] + "
" + coordinates = g[field][1] + } + else if (field=="description") { + text += fieldText + content[g[field]] + "
" + } + else { + text += fieldText + g[field] + "
" + } + } + var markerIcon = new L.Icon({ + iconUrl: 'https://www.libsoc.org/img/common/markers/marker-gold.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] + }); + let marker = L.marker(coordinates, {icon: markerIcon}) + marker.addTo(map).bindPopup(text) + } +} \ No newline at end of file diff --git a/Server/app/svelte/public/locales/en/join-us-component.json b/Server/app/svelte/public/locales/en/join-us-component.json index 4f90b14..6f84f8b 100644 --- a/Server/app/svelte/public/locales/en/join-us-component.json +++ b/Server/app/svelte/public/locales/en/join-us-component.json @@ -14,6 +14,7 @@ "findOur": "Find our", "group": "group", "commune": "commune", + "party": "party", "or": "or", "cooperative": "cooperative", "nearYou": "near you and join to help make a world we both envision a reality.", diff --git a/Server/app/svelte/public/locales/en/landing-component.json b/Server/app/svelte/public/locales/en/landing-component.json index cf80e81..0453c72 100644 --- a/Server/app/svelte/public/locales/en/landing-component.json +++ b/Server/app/svelte/public/locales/en/landing-component.json @@ -5,5 +5,7 @@ "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 one of the initial steps towards achieving socialism.", + "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." } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/en/navbar-component.json b/Server/app/svelte/public/locales/en/navbar-component.json index 4501b50..8767c96 100644 --- a/Server/app/svelte/public/locales/en/navbar-component.json +++ b/Server/app/svelte/public/locales/en/navbar-component.json @@ -5,5 +5,6 @@ "groups": "Groups", "communes": "Communes", "cooperatives": "Cooperatives", + "parties": "Parties", "partners": "Partners" } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/en/parties-component.json b/Server/app/svelte/public/locales/en/parties-component.json new file mode 100644 index 0000000..5c4cdbe --- /dev/null +++ b/Server/app/svelte/public/locales/en/parties-component.json @@ -0,0 +1,12 @@ +{ + "heading": "Parties", + "p1": "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.", + "subheading1": "Our Parties", + "name": "Name", + "location": "Location", + "members": "Members", + "link": "Link", + "description": "Description", + "ireland": "Ireland", + "descriptionRoots": "We are a left libertarian organization based in Ireland. We have a focus on rebuilding the countries infrastructure, sense of governance, housing, agricultural industries and youth affairs." +} \ No newline at end of file diff --git a/Server/app/svelte/public/locales/ru/join-us-component.json b/Server/app/svelte/public/locales/ru/join-us-component.json index bb51173..8ec1522 100644 --- a/Server/app/svelte/public/locales/ru/join-us-component.json +++ b/Server/app/svelte/public/locales/ru/join-us-component.json @@ -13,7 +13,8 @@ "subheading2": "Найди нас", "findOur": "Найди нашу", "group": "группу", - "community": "коммуну", + "commune": "коммуну", + "party": "партию", "or": "или", "cooperative": "кооператив", "nearYou": "около тебя и присоединяйся для того, чтобы сделать тот мир, о котором мы все мечтаем, реальностью.", diff --git a/Server/app/svelte/public/locales/ru/landing-component.json b/Server/app/svelte/public/locales/ru/landing-component.json index 44c30b3..939a4cd 100644 --- a/Server/app/svelte/public/locales/ru/landing-component.json +++ b/Server/app/svelte/public/locales/ru/landing-component.json @@ -2,8 +2,10 @@ "top": "Эта организация представляет собой децентрализованную федерацию, основанную на принципе свободной ассоциации. Она состоит из многих групп людей, объединенные одной целью: свержение авторитарных эксплуататорских систем, представленных различными формами капитализма, и замена их либертарными социалистическими системами с целью создания более справедливого и демократического мира.", "groupsTitle": "ГРУППЫ", "groupsText": "Мы организуем группы в целях образования, защиты наших интересов и взаимопомощи. Наша цель — продемонстрировать людям, как нынешние политико-экономические системы пагубно влияют на наше благополучие, представить им альтернативные варианты и заниматься взаимопомощью, чтобы сделать жизнь при капитализме легче.", - "communitiesTitle": "КОММУНЫ", - "communitiesText": "Мы создаем коммуны на основе либертарных социалистических принципов, где члены коммун владеют своей землей, домами и средствами производства, а также принимают решения, используя прямую демократию. Мы постепенно, по одной коммуне, расширяем наш социалистический мир.", + "communesTitle": "КОММУНЫ", + "communesText": "Мы создаем коммуны на основе либертарных социалистических принципов, где члены коммун владеют своей землей, домами и средствами производства, а также принимают решения, используя прямую демократию. Мы постепенно, по одной коммуне, расширяем наш социалистический мир.", "cooperativesTitle": "КООПЕРАТИВЫ", - "cooperativesText": "Мы формируем рабочие кооперативы для финансирования операций наших групп и коммун. Признавая, что экономическая власть влияет на политическую власть, мы считаем создание кооперативов одним из первых шагов на пути к социализму." + "cooperativesText": "Мы формируем рабочие кооперативы для финансирования операций наших групп и коммун, а также формирования основы новой социалистической экономики. Признавая, что экономическая власть влияет на политическую власть, мы считаем создание кооперативов одним из первых шагов на пути к социализму.", + "partiesTitle": "ПАРТИИ", + "partiesText": "Мы создаем политические партии, чтобы продвигать реформы, которые позволят легче достичь наших целей, сдвигать окно Овертона и увеличивать нашу популярность. Однако мы признаем, что мы не можем достичь либертарианского социализма с помощью институтов, действующих против наших целей." } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/ru/navbar-component.json b/Server/app/svelte/public/locales/ru/navbar-component.json index 9428093..7cd713b 100644 --- a/Server/app/svelte/public/locales/ru/navbar-component.json +++ b/Server/app/svelte/public/locales/ru/navbar-component.json @@ -5,5 +5,6 @@ "groups": "Группы", "communes": "Коммуны", "cooperatives": "Кооперативы", + "parties": "Партии", "partners": "Партнеры" } \ No newline at end of file diff --git a/Server/app/svelte/public/locales/ru/parties-component.json b/Server/app/svelte/public/locales/ru/parties-component.json new file mode 100644 index 0000000..40305ca --- /dev/null +++ b/Server/app/svelte/public/locales/ru/parties-component.json @@ -0,0 +1,12 @@ +{ + "heading": "Партии", + "p1": "Мы создаем политические партии, чтобы продвигать реформы, которые позволят легче достичь наших целей, сдвигать окно Овертона и увеличивать нашу популярность. Однако мы признаем, что мы не можем достичь либертарианского социализма с помощью институтов, действующих против наших целей.", + "subheading1": "Наши партии", + "name": "Имя", + "location": "Локация", + "members": "Участники", + "link": "Ссылка", + "description": "Описание", + "ireland": "Ирландия", + "descriptionRoots": "Мы — левая либертарная организация, базирующаяся в Ирландии. Мы уделяем особое внимание восстановлению инфраструктуры страны, самоуправлению, жилищному строительству, сельскохозяйственной промышленности и делам молодежи." +} \ No newline at end of file diff --git a/Server/app/svelte/rollup.config.js b/Server/app/svelte/rollup.config.js index 297a905..8e3d30e 100644 --- a/Server/app/svelte/rollup.config.js +++ b/Server/app/svelte/rollup.config.js @@ -10,6 +10,7 @@ import watch from "rollup-plugin-watch"; const production = !process.env.ROLLUP_WATCH; + function serve() { let server; diff --git a/Server/app/svelte/src/join-us-component.svelte b/Server/app/svelte/src/join-us-component.svelte index f894085..cfcb35d 100644 --- a/Server/app/svelte/src/join-us-component.svelte +++ b/Server/app/svelte/src/join-us-component.svelte @@ -7,6 +7,7 @@ import { addMarkersGroups } from '/js/groups.js' import { addMarkersCoops } from '/js/coops.js' import { addMarkersCommunities } from '/js/communities.js' + import { addMarkersParties } from '/js/parties.js' import { loadLocaleContent } from "/js/libraries/serverTools.js" // Import components @@ -19,10 +20,12 @@ let contentGroups = writable({}) let contentCommunities = writable({}) let contentCoops = writable({}) + let contentParties = writable({}) loadLocaleContent(contentGroups,"groups-component") loadLocaleContent(contentCommunities,"communities-component") loadLocaleContent(contentCoops,"cooperatives-component") + loadLocaleContent(contentParties,"parties-component") let locale = loadLocaleContent(content,"join-us-component",loaded) @@ -31,6 +34,7 @@ addMarkersGroups(map,$contentGroups) addMarkersCommunities(map,$contentCommunities) addMarkersCoops(map,$contentCoops) + addMarkersParties(map,$contentParties) } onMount(() => { @@ -63,8 +67,9 @@

{$content.findOur}

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

{$content.nearYou}

@@ -103,6 +108,9 @@ #entities-list li:nth-of-type(3):before { background-image: url(https://www.libsoc.org/img/common/markers/marker-blue.png); } + #entities-list li:nth-of-type(4):before { + background-image: url(https://www.libsoc.org/img/common/markers/marker-gold.png); + } #entities-list li::marker { display: inline-block; diff --git a/Server/app/svelte/src/landing-component.svelte b/Server/app/svelte/src/landing-component.svelte index f0028ea..ee971f7 100644 --- a/Server/app/svelte/src/landing-component.svelte +++ b/Server/app/svelte/src/landing-component.svelte @@ -17,10 +17,10 @@ function changeWidth(locale) { if (locale=="ru") { - gridWidth = "1.2fr 1.05fr 1fr" + gridWidth = "1fr 1fr" } else { - gridWidth = "1.2fr 1.1fr 1fr" + gridWidth = "1fr 1fr" } } @@ -59,6 +59,11 @@ coops

{$content.cooperativesText}

+
+

{$content.partiesTitle}

+ coops +

{$content.partiesText}

+
@@ -72,7 +77,7 @@ text-align: center; } - #groups-img, #communes-img, #coops-img { + #groups-img, #communes-img, #coops-img, #parties-img { position: absolute; left: 50%; transform: translate(-50%); @@ -81,6 +86,11 @@ height: 8rem; } + #coops-img { + margin-top: 0.5rem; + height: 7.5rem; + } + #text-container { max-width: calc(100vw - 4rem); margin: auto; @@ -93,7 +103,7 @@ #container { margin: auto; - max-width: 1000px; + max-width: 800px; margin-top: 2rem; margin-bottom: 5rem; } @@ -109,6 +119,7 @@ #container-grid { display: grid; grid-template-columns: var(--grid-width); + grid-template-rows: var(--grid-width); grid-gap: 4rem; margin-top: 2rem; } diff --git a/Server/app/svelte/src/navbar/navbar-component.svelte b/Server/app/svelte/src/navbar/navbar-component.svelte index 4e67fac..3115670 100644 --- a/Server/app/svelte/src/navbar/navbar-component.svelte +++ b/Server/app/svelte/src/navbar/navbar-component.svelte @@ -76,6 +76,7 @@
  • {$content.groups}
  • {$content.communes}
  • {$content.cooperatives}
  • +
  • {$content.parties}
  • {$content.partners}