diff --git a/.gitignore b/.gitignore index 86197ef..09d3036 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ venv/ site/*.html +site/en/*.html site/atom_blog.xml site/atom_events.xml poster.html diff --git a/build_pages.py b/build_pages.py index d82a109..edda7fd 100644 --- a/build_pages.py +++ b/build_pages.py @@ -9,10 +9,11 @@ PAGES = [ {'name': 'webring', 'titleSR': 'Webring', 'titleEN': 'Webring', 'style': ''}, ] -def buildPage(pageTitle: str, pageHtml: str, pageStyle: str, template: str) -> str: +def buildPage(filename: str, pageTitle: str, pageHtml: str, pageStyle: str, template: str) -> str: template = template.replace('', pageTitle) style = '' if not pageStyle else f'' template = template.replace('', style) + template = template.replace('PAGE_NAME', filename) template = template.replace('', pageHtml) return template @@ -24,10 +25,16 @@ def main(): for page in PAGES: with open(f'pages/sr/{page["name"]}.html') as f: pageHtml = f.read() - html = buildPage(page['titleSR'], pageHtml, page['style'], templateSR) + html = buildPage(page['name'], page['titleSR'], pageHtml, page['style'], templateSR) f = open(f'site/{page["name"]}.html', 'w') f.write(html) f.close() + with open(f'pages/en/{page["name"]}.html') as f: + pageHtml = f.read() + html = buildPage(page['name'], page['titleEN'], pageHtml, page['style'], templateEN) + f = open(f'site/en/{page["name"]}.html', 'w') + f.write(html) + f.close() if __name__ == '__main__': main() \ No newline at end of file diff --git a/pages/en/account.html b/pages/en/account.html new file mode 100644 index 0000000..3599186 --- /dev/null +++ b/pages/en/account.html @@ -0,0 +1,7 @@ +

If you have created an account on dmz.rs, you can use our XMPP and e-mail server, as well as other services that support LDAP login.

+

For more on XMPP see this tutorial.

+

You can see settings for the Thundebird mail client on this image.

+ +

Register

+

Delete account

+

Change password

diff --git a/pages/en/contact.html b/pages/en/contact.html new file mode 100644 index 0000000..866a0cf --- /dev/null +++ b/pages/en/contact.html @@ -0,0 +1,5 @@ +

Contact

+

You can send mail to dmz@dmz.rs or you can register on our Forum.

+

Also, we are available on the Fediverse!

+
+

If you find a bug on the site, please do tell us. We would be very grateful.

diff --git a/pages/en/events.html b/pages/en/events.html new file mode 100644 index 0000000..f90dc54 --- /dev/null +++ b/pages/en/events.html @@ -0,0 +1 @@ +

Events

diff --git a/pages/en/index.html b/pages/en/index.html new file mode 100644 index 0000000..fc16149 --- /dev/null +++ b/pages/en/index.html @@ -0,0 +1,31 @@ +

Welcome!

+

+ We are Decentrala - a group of enthusiasts gathered around the idea of decentralization and knowledge sharing. + Here are some more facts about us: +

+
+
Knowledge:
+
+ All our workshops are free and open to everyone. + Also, if you have something to share, feel free to announce the event on the Forum. +
+
Actions:
+
From time to time we organize actions, hackathons, crypto parties, exhibitions, etc.
+
Services:
+
Our servers run various services (like e-mail, git, wiki, etc...) that are open to everyone.
+
Donations:
+
+ Decentrala accepts donations exclusively from persons and without any obligations. + We are independent and we try to keep it that way. + You can donate old hardware (laptops, phones, PC components) to us, and we will find a use for it in Decentrala or give it to people who need it. + Also, you can donate bitcoin and monero by sending to the following addresses: +

Bitcoin: bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74

+

Monero: 8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS

+
+
+

+ If you are still interested, you can create an account + on our server which will enable the use of all our services. + If you want to see first how it all looks, you can come to one of our + event, and meet us there! +

diff --git a/pages/en/services.html b/pages/en/services.html new file mode 100644 index 0000000..0ba634a --- /dev/null +++ b/pages/en/services.html @@ -0,0 +1,54 @@ +

Services

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ServiceDescription
E-mailE-mail account that you can use with any e-mail client (for example, with the Thunderbird).
ForumForum for general discussion and event organization.
Chat + We have our XMPP server, on which you can make an account. + If you already have an account, you can find us at group decentrala@conference.dmz.rs. +
GitGitea instance on which we host our code and resources (including the code for this site). +
WikiWiki.js instance on which we publish documentation for our projects, + events resources, and tutorials. +
SearchSearXNG instance used for Web searching.
PastebinPrivateBin instance we use for sharing text files
Soft Serve + Soft Serve instance that we use as a replacement for the Gitea service. + Soft Serve works entirely from the terminal. +
+

+ These are some of the services we currently maintain on our servers. + To use these services, you can register for each service separately, + or you can create a unique account + on our server and use all services with the same account. +

diff --git a/pages/en/webring.html b/pages/en/webring.html new file mode 100644 index 0000000..03913f9 --- /dev/null +++ b/pages/en/webring.html @@ -0,0 +1,3 @@ + \ No newline at end of file diff --git a/pages/sr/events.html b/pages/sr/events.html index 21df750..c6c2c27 100644 --- a/pages/sr/events.html +++ b/pages/sr/events.html @@ -1,59 +1 @@ -

Događaji

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DatumVremeMestoTema
Ponedeljak, 7. Avgust 2023. 19:00h DC Krov Linux ricing
Utorak, 8. Avgust 2023. 19:00h DC Krov Lambda račun
Ponedeljak, 14. Avgust 2023. 19:00h DC Krov Linux distro diskusija
Utorak, 15. Avgust 2023. 19:00h DC Krov Pirati 777 mora
Ponedeljak, 21. Avgust 2023. 19:00h DC Krov Python vežbe
Utorak, 22. Avgust 2023. 19:00h DC Krov Autentifikacija na internetu
Ponedeljak, 28. Avgust 2023. 19:00h DC Krov Podešvanje Mail servera
Utorak, 29. Avgust 2023. 19:00h DC Krov Prevođenje wiki-ja
\ No newline at end of file +

Događaji

\ No newline at end of file diff --git a/prep.py b/prep.py index 8cfd463..0d12672 100644 --- a/prep.py +++ b/prep.py @@ -3,30 +3,16 @@ from datetime import datetime from functools import cmp_to_key -days = [ - "Ponedeljak", - "Utorak", - "Sreda", - "Četvrtak", - "Petak", - "Subota", - "Nedelja", -] - -months = [ - "Januar", - "Februar", - "Mart", - "April", - "Maj", - "Jun", - "Jul", - "Avgust", - "Septembar", - "Oktobar", - "Novembar", - "Decembar", -] +DAYS_SR = ["Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota", "Nedelja"] +DAYS_EN = ["Monday ", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] +MONTHS_SR = [ + "Januar", "Februar", "Mart", "April", "Maj", "Jun", + "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar", + ] +MONTHS_EN = [ + "January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December", + ] today = datetime.today().date() @@ -66,36 +52,41 @@ def sort_events(events): return sorted(events, key = cmp_to_key(compare_events)) +def build_html(events, dayNames, monthNames): + newevents = [] + for event in events: + date, time, location, title = event.split(", ") + date = parse_date(date) + if is_past_event(date): + continue + date = dayNames[date.weekday()]+", "+str(date.day)+". "+monthNames[date.month-1]+" "+str(date.year)+"." + time = time+"h" + future_event = [] + future_event.append(" "+date+" ") + future_event.append(" "+time+" ") + if "https://" in location: + place,link = location.split("https://") + future_event.append(" "+place.strip()+" ") + else: + future_event.append(" "+location.strip()+" ") + future_event.append(" "+title+" ") + newevents.append("\n"+"\n".join(future_event)+"\n") + return newevents + events = load_events() events = sort_events(events) write_events(events) -newevents = [] - -for event in events: - date, time, location, title = event.split(", ") - date = parse_date(date) - if is_past_event(date): - continue - date = days[date.weekday()]+", "+str(date.day)+". "+months[date.month-1]+" "+str(date.year)+"." - time = time+"h" - future_event = [] - future_event.append(" "+date+" ") - future_event.append(" "+time+" ") - if "https://" in location: - place,link = location.split("https://") - future_event.append(" "+place.strip()+" ") - else: - future_event.append(" "+location.strip()+" ") - future_event.append(" "+title+" ") - newevents.append("\n"+"\n".join(future_event)+"\n") +newevents = build_html(events, DAYS_SR, MONTHS_SR) with open("pages/sr/events.html","wt") as file: file.writelines(["

Događaji

\n", "\n", "\n"]) file.writelines(newevents) file.writelines(["
DatumVremeMestoTema
"]) -#with open("pages/en/events.html","wt") as file: -# file.writelines(["

Events

", "", "\n\n\n\n\n"]) -# file.writelines(events) -# file.writelines(["
DateTimePlaceTheme
"]) +newevents = build_html(events, DAYS_EN, MONTHS_EN) + +with open("pages/en/events.html","wt") as file: + file.writelines(["

Events

\n", "\n", ""]) + file.writelines(newevents) + file.writelines(["
DateTimePlaceTopic
"]) diff --git a/site/styles/style.css b/site/styles/style.css index 25a9752..cbd8559 100644 --- a/site/styles/style.css +++ b/site/styles/style.css @@ -111,7 +111,7 @@ a:focus { background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%); } -.account { +.lang { font-size: 2rem; } @@ -210,8 +210,4 @@ screen and (max-width: 1500px) { #theme-switcher { margin-right: 1rem; } - - .account { - font-size: 1rem; - } } \ No newline at end of file diff --git a/template/page-en.html b/template/page-en.html index 843fb18..330afa7 100644 --- a/template/page-en.html +++ b/template/page-en.html @@ -9,12 +9,13 @@ <!--TITLE--> Decentrala +
- + - Account + SR
@@ -22,9 +23,10 @@