Compare commits

..

41 Commits

Author SHA1 Message Date
25662d7bda
change postiton of location and time text to make more space from events 2023-09-28 14:09:12 +02:00
12235ab51e
add text to poster about time and location 2023-09-28 14:07:35 +02:00
62da74bf99
add optional argument for month 2023-09-27 17:40:11 +02:00
a321ebe765
fix wrong array index 2023-09-27 17:00:13 +02:00
a70fd1369e
change NEXT_MONTH to actaul next month instead of CURRENT_TIME 2023-09-27 16:58:28 +02:00
768f1c66e6
and shebangs and make all scripts executable 2023-09-27 16:47:55 +02:00
fb50c076fe
add events 2023-09-27 16:43:15 +02:00
b31a1b5ebf
add events 2023-09-26 13:43:04 +02:00
ab15c97e5e
add dogadjaji 2023-09-22 01:13:32 +02:00
702ab07e03
add tilda and pionir to webring 2023-09-18 22:25:32 +02:00
3232cdcf09 October events 2023-09-17 19:28:00 +00:00
aec8f74ed2 Izmena 2023-09-17 19:25:48 +00:00
62778e2679 Merge pull request 'PNG poster maker' (#20) from hugo/website2:poster into master
Reviewed-on: Decentrala/website#20
2023-09-01 11:45:10 +00:00
4eae5c08b8 Png poster maker 2023-09-01 13:44:12 +02:00
4b700f6652 Merge pull request 'September events' (#19) from hugo/website2:events into master
Reviewed-on: Decentrala/website#19
2023-08-30 17:47:59 +00:00
de3d5142f6 Fix navigation link 2023-08-30 19:47:10 +02:00
1bfa147cb4 Add september events. Fix events layout 2023-08-30 19:47:00 +02:00
8d942cf2f3 Merge pull request 'Archive page' (#17) from hugo/website2:archive_page into master
Reviewed-on: Decentrala/website#17
2023-08-30 11:20:27 +00:00
39b65d0547 Fix account link 2023-08-30 13:18:43 +02:00
efe1ea873b Fix h1 tags 2023-08-30 13:17:27 +02:00
44910c183b Implement Archive builder. Change events layout 2023-08-30 13:09:10 +02:00
be37b42273 Update TODO 2023-08-30 13:00:09 +02:00
29c1b7ad55 Update events list 2023-08-30 12:59:10 +02:00
4233fe7f44 Implement events pages skeletons 2023-08-30 11:56:05 +02:00
4bcd13a713 Merge pull request 'Implement the English version' (#16) from hugo/website2:english_version into master
Reviewed-on: Decentrala/website#16
2023-08-30 08:08:51 +00:00
05c11219d2 Wording 2023-08-30 10:08:34 +02:00
6671fb1547 Implement page builder for English 2023-08-29 15:25:20 +02:00
221dff13dd Spelling 2023-08-29 15:01:45 +02:00
1f5e541922 Fix events script 2023-08-29 14:02:39 +02:00
d31e4e10c8 Translate pages 2023-08-29 13:46:59 +02:00
005fba6010 Merge pull request 'fix wording, fix links, remove obsolete page' (#15) from hugo/website2:fixes3 into master
Reviewed-on: Decentrala/website#15
2023-08-29 09:59:03 +00:00
b71eb393ce fix wording, fix links, remove obsolete page 2023-08-29 11:54:05 +02:00
bdd7a3e7ef Merge pull request 'change from LibreX to SearXNG for bot protection' (#14) from youshitsune/website:master into master
Reviewed-on: Decentrala/website#14
2023-08-28 08:20:27 +00:00
703c11a5ce
change from LibreX to SearXNG for bot protection 2023-08-28 08:39:06 +02:00
1db838a44c
add links to events 2023-08-28 01:19:28 +02:00
0fde75bc41
add new events 2023-08-28 01:16:36 +02:00
9fa68a27b6
fix issue with using same name for two different variables 2023-08-26 01:03:33 +02:00
d878e884d4 Merge pull request 'Dodate donacije, prepisao sa hackerspaces wikija' (#12) from svitvojimilioni/website:donacije-3 into master
Reviewed-on: Decentrala/website#12
2023-08-25 22:39:06 +00:00
f9ff147495 Merge pull request 'pravopis, gramatika, rodna ravnopravnost...' (#13) from stalker/website:pravopis-fixes into master
Reviewed-on: Decentrala/website#13
2023-08-25 22:38:53 +00:00
Branko Kokanovic
5e90343728 pravopis, gramatika, rodna ravnopravnost... 2023-08-25 21:28:33 +02:00
1a1ee35992
Dodate donacije, prepisao sa hackerspaces wikija 2023-08-25 11:42:45 -04:00
32 changed files with 505 additions and 278 deletions

3
.gitignore vendored
View File

@ -1,8 +1,11 @@
venv/
site/*.html
site/en/*.html
site/atom_blog.xml
site/atom_events.xml
poster.html
poster.pdf
poster_light.png
poster_dark.png
http.access.log
http.error.log

View File

@ -31,9 +31,12 @@ nginx -p . -s stop
## TODO:
- [x] create page builder
- rename `prep.py` to more informative name (`build_events.py`)
- [ ] create blogging system
- [ ] create xmpp bot that connects to events section.
- [ ] webring system
- [x] make page
- [ ] populate page
- [ ] make english version (localisation)
- [x] make english version
- double check spelling and wording
- add account and donations page and style them with the site style

View File

@ -1,4 +1,4 @@
#! /usr/bin/python3
#! /usr/bin/env python3
# needs lowdown and feegden installed
# feedgen can be installed with pip

1
blog.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#! /usr/bin/env python3
# just testing markdown library for now
from markdown import markdown as to_markdown

15
build_pages.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#! /usr/bin/env python3
import os
PAGES = [
@ -5,14 +6,16 @@ PAGES = [
{'name': 'account', 'titleSR': 'Nalog', 'titleEN': 'Account', 'style': 'account'},
{'name': 'contact', 'titleSR': 'Kontakt', 'titleEN': 'Contact', 'style': 'contact'},
{'name': 'events', 'titleSR': 'Događaji', 'titleEN': 'Events', 'style': 'events'},
{'name': 'events_archive', 'titleSR': 'Arhiva događaja', 'titleEN': 'Events archive', 'style': 'events'},
{'name': 'services', 'titleSR': 'Servisi', 'titleEN': 'Services', 'style': 'services'},
{'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('<!--TITLE-->', pageTitle)
style = '' if not pageStyle else f'<link rel=\"stylesheet\" href=\"/styles/{pageStyle}.css\">'
template = template.replace('<!--ADDITIONAL_STYLE-->', style)
template = template.replace('PAGE_NAME', filename)
template = template.replace('<!--MAIN-->', pageHtml)
return template
@ -24,10 +27,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()
main()

View File

@ -1,20 +1,80 @@
datum, vreme, lokacija, tema
03-05-2023, 12:00, Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543, Otvaranje izlozbe (Q&A)
20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreze, firewall
03-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
16-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica privatnosti na internetu
04-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
13-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u Bitcoin radonica
14-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Privacy & Security predavanje
20-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cyber reconnisance radionica
21-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u konfiguraciju servera radionica (pomerena)
27-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šta je Decentrala + hakaton
03-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u python
10-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u python
13-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, TLS (SSL) kriptografija
14-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Matrix chat protokol
20-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, LDAP protokol radionica
21-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Android reverse engineering
25-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Open hackerspace day - film
27-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, SQL baze podataka
28-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Esolang
03-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pentest radionica
04-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Runtime modification of Android apps
10-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton
11-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u OpenBSD
17-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lan party
18-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pentest radionica nastavak
23-04-2023, 19:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u mreže
03-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, Otvaranje izlozbe (Q&A)
03-05-2023, 18:00, KC Grad https://www.openstreetmap.org/node/4118716889, Linux install fest
04-05-2023, 17:00, Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
04-05-2023, 17:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
04-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u racunarske mreze
04-05-2023, 21:00, n/a, Online sastanak sa Zajednicom za slobodnu tehnologiju iz Kikinde
05-05-2023, 15:30, Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
06-05-2023, 12:00, Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
07-05-2023, 16:00, Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543, ULUS izlozba (diskusija)
05-05-2023, 15:30, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
06-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A)
07-05-2023, 16:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (diskusija)
08-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux install day
09-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cryptoparty - Uvod u privatnost
11-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u racunarske mreze
01-08-2023, 19:00, DC Krov, Tehno veče
07-08-2023, 19:00, DC Krov, Linux ricing
08-08-2023, 19:00, DC Krov, Lambda račun
14-08-2023, 19:00, DC Krov, Linux distro diskusija
15-08-2023, 19:00, DC Krov, Pirati 777 mora
21-08-2023, 19:00, DC Krov, Python vežbe
22-08-2023, 19:00, DC Krov, Autentifikacija na internetu
28-08-2023, 19:00, DC Krov, Kviz
11-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u računarske mreže
05-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šifre
06-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Random i kriptografija
12-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u Blender
13-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
19-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pisanje BASH skripti
20-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
26-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python vežbe
27-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
03-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, DNS
04-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
10-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Blender, 3D modelovanje
11-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
17-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, OpenGL
18-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
24-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Web scraping
25-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
31-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python - Web development
01-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tehno veče
07-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux ricing
08-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda račun
14-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux distro diskusija
15-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pirati 777 mora
21-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python vežbe
22-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Autentifikacija na internetu
28-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Podešavanje Mail servera
29-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Prevođenje wiki-a
04-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton
05-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - phishing
11-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica kreativnog pisanja
12-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tehno veče
18-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - kako početi?
19-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Stop reklamama - diskusija
25-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Email server E02
26-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda račun E02
02-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šamirov algoritam za deljenje tajni
03-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hackathon
09-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lighting talks
16-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Audio radionica
17-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Libreboot
23-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tor
24-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity card game
30-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Resavanje Rubikove kocke
31-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, vim

1 datum datum, vreme, lokacija, tema vreme lokacija tema
2 03-05-2023 20-12-2022, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u računarske mreze, firewall 12:00 Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543 Otvaranje izlozbe (Q&A)
3 03-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
4 16-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica privatnosti na internetu
5 04-01-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton žurka
6 13-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u Bitcoin radonica
7 14-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Privacy & Security predavanje
8 20-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cyber reconnisance radionica
9 21-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u konfiguraciju servera radionica (pomerena)
10 27-02-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šta je Decentrala + hakaton
11 03-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u python
12 10-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u python
13 13-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, TLS (SSL) kriptografija
14 14-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Matrix chat protokol
15 20-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, LDAP protokol radionica
16 21-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Android reverse engineering
17 25-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Open hackerspace day - film
18 27-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, SQL baze podataka
19 28-03-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Esolang
20 03-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pentest radionica
21 04-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Runtime modification of Android apps
22 10-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton
23 11-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u OpenBSD
24 17-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lan party
25 18-04-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pentest radionica nastavak
26 23-04-2023, 19:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u mreže
27 03-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, Otvaranje izlozbe (Q&A)
28 03-05-2023 03-05-2023, 18:00, KC Grad https://www.openstreetmap.org/node/4118716889, Linux install fest 18:00 KC Grad https://www.openstreetmap.org/node/4118716889 Linux install fest
29 04-05-2023 04-05-2023, 17:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A) 17:00 Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543 ULUS izlozba (Q&A)
30 04-05-2023 04-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u racunarske mreze 18:00 Polyhedra https://www.openstreetmap.org/node/4856556781 Uvod u racunarske mreze
31 04-05-2023 04-05-2023, 21:00, n/a, Online sastanak sa Zajednicom za slobodnu tehnologiju iz Kikinde 21:00 n/a Online sastanak sa Zajednicom za slobodnu tehnologiju iz Kikinde
32 05-05-2023 05-05-2023, 15:30, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A) 15:30 Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543 ULUS izlozba (Q&A)
33 06-05-2023 06-05-2023, 12:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (Q&A) 12:00 Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543 ULUS izlozba (Q&A)
34 07-05-2023 07-05-2023, 16:00, Cvijeta Zuzorić https://www.openstreetmap.org/node/256367543, ULUS izlozba (diskusija) 16:00 Cvijeta Zuzoric https://www.openstreetmap.org/node/256367543 ULUS izlozba (diskusija)
35 08-05-2023 08-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux install day 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Linux install day
36 09-05-2023 09-05-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cryptoparty - Uvod u privatnost 19:00 DC Krov https://www.openstreetmap.org/node/10594728522 Cryptoparty - Uvod u privatnost
37 11-05-2023 11-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u računarske mreže 18:00 Polyhedra https://www.openstreetmap.org/node/4856556781 Uvod u racunarske mreze
38 01-08-2023 05-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šifre 19:00 DC Krov Tehno veče
39 07-08-2023 06-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Random i kriptografija 19:00 DC Krov Linux ricing
40 08-08-2023 12-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u Blender 19:00 DC Krov Lambda račun
41 14-08-2023 13-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana 19:00 DC Krov Linux distro diskusija
42 15-08-2023 19-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pisanje BASH skripti 19:00 DC Krov Pirati 777 mora
43 21-08-2023 20-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana 19:00 DC Krov Python vežbe
44 22-08-2023 26-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python vežbe 19:00 DC Krov Autentifikacija na internetu
45 28-08-2023 27-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana 19:00 DC Krov Kviz
46 03-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, DNS
47 04-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
48 10-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Blender, 3D modelovanje
49 11-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
50 17-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, OpenGL
51 18-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
52 24-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Web scraping
53 25-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
54 31-07-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python - Web development
55 01-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tehno veče
56 07-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux ricing
57 08-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda račun
58 14-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Linux distro diskusija
59 15-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pirati 777 mora
60 21-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python vežbe
61 22-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Autentifikacija na internetu
62 28-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Podešavanje Mail servera
63 29-08-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Prevođenje wiki-a
64 04-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton
65 05-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - phishing
66 11-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Radionica kreativnog pisanja
67 12-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tehno veče
68 18-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity - kako početi?
69 19-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Stop reklamama - diskusija
70 25-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Email server E02
71 26-09-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lambda račun E02
72 02-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šamirov algoritam za deljenje tajni
73 03-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hackathon
74 09-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lighting talks
75 16-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Audio radionica
76 17-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Libreboot
77 23-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Tor
78 24-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity card game
79 30-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Resavanje Rubikove kocke
80 31-10-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, vim

114
image_poster.py Executable file
View File

@ -0,0 +1,114 @@
#! /usr/bin/env python3
import argparse
import freetype
import io
from PIL import Image, ImageDraw, ImageFont
import csv
import datetime as dt
from dateutil import relativedelta
CURRENT_TIME = dt.date.today()
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
DAYS_OF_WEEK_SR = ("PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED")
MONTHS_SR = ("Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust",\
"Septembar", "Oktobar", "Novembar", "Decembar")
def parseArgs(parser):
"""
Parse all arguments and return the list of argument values
"""
parser.add_argument("month", metavar = "MM", help = "two digit number representing the month for which to generate poster", default = "empty", nargs = "?")
return parser.parse_args()
def load_events(csv_path:str, month:int) -> list[dict]:
events = []
with open(csv_path) as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader, None)
for event in csv_reader:
event_date = event[0]
event_date_parsed = dt.datetime.strptime(event_date, "%d-%m-%Y").date()
event_time = event[1]
event_title = event[3]
current_event = {"date":event_date_parsed,
"time":event_time,
"title":event_title.strip()}
if event_date_parsed >= month:
events.append(current_event)
return events
def drawPoster(events, bg, fg, month:int):
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=110)
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=60)
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=45)
W = 1200
H = 1500
img = Image.new('RGB', (W, H), bg)
draw = ImageDraw.Draw(img)
header = "DECENTRALA"
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
draw.text(((W-w)/2, 120), header, font=fontFacade, fill=fg)
subheader = f"Plan za {MONTHS_SR[month.month - 1]}"
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
draw.text(((W-w)/2, 240), subheader, font=fontIosevka, fill=fg)
height = 410
draw.text((120, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
height += 100
for event in events:
date = DAYS_OF_WEEK_SR[event["date"].weekday()]
day = event["date"].day
title = event["title"]
pad = " " if event["date"].day < 10 else ""
eventText = f"{date} {day}. {pad} {title}"
draw.text((120, height), eventText, font=fontIosevkaSmall, fill=fg)
height += 70
def drawCircle(x, y):
r = 10
draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0)
LCX = 950 # logo center x
LCY = 1200 # logo center y
d = 50 # delta
drawCircle(LCX - d, LCY)
drawCircle(LCX, LCY)
drawCircle(LCX, LCY - d)
drawCircle(LCX, LCY + d)
drawCircle(LCX + d, LCY)
draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=5, joint=None)
draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=5, joint=None)
draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg)
return img
def main():
# Parse arguments
parser = argparse.ArgumentParser(description="Generate images of the poster")
args = parseArgs(parser)
# Set month based on user input
month = NEXT_MONTH
if args.month.isdigit():
month = dt.date(CURRENT_TIME.year, int(args.month), 1)
elif args.month != "empty":
print("Month has to be specified as a number. I will use next month as the default")
# Load events and draw a poseter
events = load_events("dogadjaji.csv", month)
img = drawPoster(events, (0, 0, 0), (20, 250, 50), month)
img.save('poster_dark.png')
img = drawPoster(events, (255, 255, 255), (0, 0, 0), month)
img.save('poster_light.png')
if __name__ == "__main__":
main()

8
pages/en/account.html Normal file
View File

@ -0,0 +1,8 @@
<h1>Account</h1>
<p>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.<p>
<p>For more on XMPP see <a href="https://wiki.dmz.rs/en/tutorial/conversations">this tutorial</a>. <p>
<p>You can see settings for the <a href="https://thunderbird.org">Thundebird</a> mail client on this <a href="/img/mailsettings.png">image</a>.<p>
<p><a href="/account/register/">Register</a><p>
<p><a href="/account/unregister/">Delete account</a><p>
<p><a href="/account/changepassword/">Change password</a><p>

5
pages/en/contact.html Normal file
View File

@ -0,0 +1,5 @@
<h1>Contact</h1>
<p>You can send mail to <a href="mailto:dmz@dmz.rs">dmz@dmz.rs</a> or you can register on <a href="https://forum.dmz.rs">our Forum</a>.</p>
<p>Also, we are available on the <a href="https://balkan.fedive.rs/@decentrala">Fediverse!</a></p>
<br>
<p>If you find a bug on the site, please do tell us. We would be very grateful.</p>

2
pages/en/events.html Normal file
View File

@ -0,0 +1,2 @@
<h1>Events</h1>
<p>Following list contains all forthcoming events. Held events are listed in <a href="/en/events_archive">archive</a></p><br>

View File

@ -0,0 +1,2 @@
<h1>Events archive</h1>
<p>All events that we organized so far.</p><br>

31
pages/en/index.html Normal file
View File

@ -0,0 +1,31 @@
<h1>Welcome!</h1>
<p>
We are <em>Decentrala</em> - a group of enthusiasts gathered around the idea of decentralization and knowledge sharing.
Here are some more facts about us:
</p>
<dl>
<dt>Knowledge:</dt>
<dd>
All our workshops are free and open to everyone.
Also, if you have something to share, feel free to announce the event on the <a href="https://forum.dmz.rs"></a>Forum</a>.
</dd>
<dt>Actions:</dt>
<dd>From time to time we organize actions, hackathons, crypto parties, exhibitions, etc.</dd>
<dt>Services:</dt>
<dd>Our servers run various services (like e-mail, git, wiki, etc...) that are open to everyone.</dd>
<dt>Donations:</dt>
<dd>
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:
<p>Bitcoin: bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74</p>
<p>Monero: 8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS</p>
</dd>
</dl>
<p>
If you are still interested, you can create an <a href="/en/account">account</a>
on our server which will enable the use of all our <a href="/en/services">services</a>.
If you want to see first how it all looks, you can come to one of our
<a href="/en/events">event</a>, and meet us there!
</p>

54
pages/en/services.html Normal file
View File

@ -0,0 +1,54 @@
<h1>Services</h1>
<table>
<tr>
<th>Service</th>
<th>Description</th>
</tr>
<tr>
<td><a href="/account">E-mail</a></td>
<td>E-mail account that you can use with any e-mail client (for example, with the <a href="https://www.thunderbird.net/">Thunderbird</a>).</td>
</tr>
<tr>
<td><a href="https://forum.dmz.rs/">Forum</a></td>
<td>Forum for general discussion and <a href="/events">event</a> organization.</td>
</tr>
<tr>
<td>Chat</td>
<td>
We have our XMPP server, on which you can make an account.
If you already have an account, you can find us at group <a href="decentrala@conference.dmz.rs">decentrala@conference.dmz.rs</a>.
</td>
</tr>
<tr>
<td><a href="https://gitea.dmz.rs/">Git</a></td>
<td><a href="https://gitea.io/en-us/">Gitea</a> instance on which we host our code and resources (including the code for this site).
</td>
</tr>
<tr>
<td><a href="https://wiki.dmz.rs/">Wiki</a></td>
<td><a href="https://js.wiki/">Wiki.js</a> instance on which we publish documentation for our projects,
<a href="/events">events</a> resources, and tutorials.
</td>
</tr>
<tr>
<td><a href="https://search.dmz.rs/">Search</a></td>
<td><a href="https://github.com/searxng/searxng/">SearXNG</a> instance used for Web searching.</td>
</tr>
<tr>
<td><a href="https://pastebin.dmz.rs/">Pastebin</a></td>
<td><a href="https://privatebin.info/">PrivateBin</a> instance we use for sharing text files</td>
</tr>
<tr>
<td><a href="ssh://soft.dmz.rs:2222/">Soft Serve</a></td>
<td>
<a href="https://github.com/charmbracelet/soft-serve">Soft Serve</a> instance that we use as a replacement for the Gitea service.
Soft Serve works entirely from the terminal.
</td>
</tr>
</table>
<p>
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 <a href="/en/account">account</a>
on our server and use all services with the same account.
</p>

5
pages/en/webring.html Normal file
View File

@ -0,0 +1,5 @@
<h1>Webring</h1>
<ul>
<li><a href="https://pionir.org">Pionir school</a></li>
<li><a href="https://tilda.center">Tilda Center</a></li>
</ul>

View File

@ -1,7 +1,8 @@
<p> Ako ste napravili nalog na dmz.rs mozete koristi nas xmpp i email server i ostale servise koji podrzavaju LDAP login. <p>
<p> Za vise o XMPP pogledajte <a href="https://wiki.dmz.rs/en/tutorial/conversations">tutorial</a>. <p>
<p> Za primer podesavanja na <a href="https://thunderbird.org">Thundebird</a> mail klijentu mozete pogledati <a href="/img/mailsettings.png">sliku</a>. <p>
<h1>Nalog</h1>
<p>Ako si napravio nalog na dmz.rs možeš koristiti naš XMPP i e-mail server, kao i ostale servise koji podržavaju LDAP login.<p>
<p>Za više o XMPP-u pogledaj <a href="https://wiki.dmz.rs/en/tutorial/conversations">tutorial</a>. <p>
<p>Podešavanja za <a href="https://thunderbird.org">Thundebird</a> mail klijent možeš pogledati na <a href="/img/mailsettings.png">slici</a>.<p>
<p><a href="/account/register/">Registruj se</a><p>
<p><a href="/account/unregister/">Izbrisi nalog</a><p>
<p><a href="/account/unregister/">Izbriši nalog</a><p>
<p><a href="/account/changepassword/">Promeni lozinku</a><p>

View File

@ -2,4 +2,4 @@
<p>Možeš nam poslati mejl na adresu <a href="mailto:dmz@dmz.rs">dmz@dmz.rs</a> ili se možeš pridružiti našem <a href="https://forum.dmz.rs">Forumu</a>.</p>
<p>Takođe smo dostupni i na <a href="https://balkan.fedive.rs/@decentrala">Fediversu!</a></p>
<br>
<p>U slučaju da si pronašao <em>bug</em> na sajtu, bili bismo ti jako zahvalni ako bi nam ga prijavio/prijalvila.</p>
<p>U slučaju da pronađeš <em>bug</em> na sajtu, bili bismo ti jako zahvalni ako nam ga prijaviš.</p>

View File

@ -1,59 +1,2 @@
<h1>Događaji</h1>
<table>
<tbody>
<tr>
<th>Datum</th>
<th>Vreme</th>
<th>Mesto</th>
<th>Tema</th>
</tr>
<tr>
<td> Ponedeljak, 7. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Linux ricing </td>
</tr>
<tr>
<td> Utorak, 8. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Lambda račun </td>
</tr>
<tr>
<td> Ponedeljak, 14. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Linux distro diskusija </td>
</tr>
<tr>
<td> Utorak, 15. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Pirati 777 mora </td>
</tr>
<tr>
<td> Ponedeljak, 21. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Python vežbe </td>
</tr>
<tr>
<td> Utorak, 22. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Autentifikacija na internetu </td>
</tr>
<tr>
<td> Ponedeljak, 28. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Podesavanje Mail servera </td>
</tr>
<tr>
<td> Utorak, 29. Avgust 2023. </td>
<td> 19:00h </td>
<td> DC Krov </td>
<td> Prevodjenje wiki-a </td>
</tr>
</tbody>
</table>
<p>Naredna lista sadrži sve predstojeće događaje. Za listu održanih događaja pogledajte <a href="/events_archive">arhivu</a></p><br>

View File

@ -0,0 +1,2 @@
<h1>Arhiva događaja</h1>
<p>Svi događaji koje smo do sada organzivali.</p><br>

View File

@ -14,10 +14,19 @@
<dt>Servisi:</dt>
<dd>Na našim serverima pokrećemo razne servise (email, git, wiki i druge) koji su otvoreni za sve i koji se mogu
koristiti sa ili bez našeg naloga.</dd>
<dt>Donacije:</dt>
<dd>
Decentrala prihvata donacije isključivo od fizičkih lica i bez obaveza.
Nezavisni smo i trudimo se da to održimo.
Možeš nam donirati stari hardver (laptopove, telefone, PC komponente), a mi ćemo mu naći upotrebu u Decentrali ili dati ljudima kojima je potreban.
Takođe možeš donirati bitcoin i monero, slanjem na naredne adrese:
<p>Bitcoin: bc1qjhsfgq79wuzzv32yml9zglwzf9qcwfj3atuy74</p>
<p>Monero: 8BESz45LnxrgCwZP32KieiN1D4LinCfsS1YjdFHfGXrVCmPs35167QsW1gd7qbff4UAtBbT6oWrkbfZnJm71HornVRiRZFS</p>
</dd>
</dl>
<p>
Ako si i dalje zainteresovan, možeš napraviti <a href="/pages/account.html">nalog</a> na našem serveru koji će ti
omogućiti korišćenje svih naših <a href="/pages/services.html">servisa</a>.
Ako si i dalje zainteresovan, možeš napraviti <a href="/account">nalog</a> na našem serveru koji će ti
omogućiti korišćenje svih naših <a href="/services">servisa</a>.
Ako želiš prvo da vidiš kako to sve izgleda u realnosti, možeš doći na neki od naših <a
href="/pages/events.html">događaja</a>, i tu nas upoznati!
</p>
href="/events">događaja</a>, i tu nas upoznati!
</p>

View File

@ -5,26 +5,26 @@
<th>Opis</th>
</tr>
<tr>
<td><a href="/account.html">Email</a></td>
<td>Email nalog koji možeš koristiti sa bilo kojim email
klijentom generalne namene (na primer <a href="https://www.thunderbird.net/">Thunderbird-u</a>).</td>
<td><a href="/account">E-mail</a></td>
<td>E-mail nalog koji možeš da koristiš sa bilo kojim email
klijentom generalne namene (na primer <a href="https://www.thunderbird.net/">Thunderbird</a>-om).</td>
</tr>
<tr>
<td><a href="https://forum.dmz.rs/">Forum</a></td>
<td>Forum na kom obično organizujemo naše <a href="/pages/events.html">događaje</a>.
<td>Forum na kom obično organizujemo naše <a href="/events">događaje</a>.
</td>
</tr>
<tr>
<td>Chat</td>
<td>Održavamo sopstveni XMPP server, na kojem možeš napraviti nalog.
Ako već poseduješ nalog možeš nas naći u grupi <a
<td>Održavamo sopstveni XMPP server, na kojem možeš da napraviš nalog.
Ako već poseduješ nalog možeš da nas nađeš u grupi <a
href="decentrala@conference.dmz.rs">decentrala@conference.dmz.rs</a>.
</td>
</tr>
<tr>
<td><a href="https://gitea.dmz.rs/">Git</a></td>
<td><a href="https://gitea.io/en-us/">Gitea</a> instanca na kojoj držimo kod kao i ostale resurse za naše
<a href="/pages/projects.html">projekte</a>, <a href="/pages/events.html">dogadjaje</a>, kao i projekte naših
<td><a href="https://gitea.io/en-us/">Gitea</a> instanca na kojoj držimo kôd kao i ostale resurse za naše
<a href="/projects">projekte</a>, <a href="/events">događaje</a>, kao i projekte naših
prijatelja.
Ovo može biti dom tvog sledećeg projekta. Bolji od Github-a.
</td>
@ -32,13 +32,12 @@
<tr>
<td><a href="https://wiki.dmz.rs/">Wiki</a></td>
<td><a href="https://js.wiki/">Wiki.js</a> instanca koju koristimo da dokumentujemo naše
<a href="/pages/projects.html">projekte</a> kao i
ostale <a href="/pages/events.html">događaje</a>.
<a href="/projects">projekte</a> kao i ostale <a href="/events">događaje</a>.
</td>
</tr>
<tr>
<td><a href="https://search.dmz.rs/">Search</a></td>
<td><a href="https://github.com/hnhx/librex/">LibreX</a> instanca koju koristimo za pretraživanje Interneta.
<td><a href="https://github.com/searxng/searxng/">SearXNG</a> instanca koju koristimo za pretraživanje Interneta.
Bolji od Google-a.
</td>
</tr>
@ -49,12 +48,11 @@
</tr>
<tr>
<td><a href="ssh://soft.dmz.rs:2222/">Soft Serve</a></td>
<td><a href="https://github.com/charmbracelet/soft-serve">Soft Serve</a> instanca koju koristimo kao zamenu za Gitea
servis.
<td><a href="https://github.com/charmbracelet/soft-serve">Soft Serve</a> instanca koju koristimo kao zamenu za Gitea servis.
Soft Serve radi potpuno iz terminala
</td>
</tr>
</table>
<p>Ovo su neki od servisa koje trenutno održavamo na našim serverima. Da bi koristio ove servise, <em>možes</em> se
registovati na svaki servis posebno, a možeš i napraviti jedinstveni <a href="/pages/account.html">nalog</a> na nasem
serveru i koristiti sve servise sa istim nalogom.</p>
<p>Ovo su neki od servisa koje trenutno održavamo na našim serverima. Da bi koristio ove servise, <em>možeš</em> da se
registuješ na svaki servis posebno, a možeš i da napraviš jedinstveni <a href="/account">nalog</a> na našem
serveru i da koristiš sve servise sa istim nalogom.</p>

View File

@ -1,3 +1,5 @@
<h1>Webring</h1>
<ul>
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
</ul>
<li><a href="https://pionir.org">Slobodna škola Pionir</a></li>
<li><a href="https://tilda.center">Tilda Centar</a></li>
</ul>

1
poster.py Normal file → Executable file
View File

@ -1,3 +1,4 @@
#! /usr/bin/env python3
import csv
import datetime as dt
from dateutil import relativedelta

163
prep.py Normal file → Executable file
View File

@ -1,101 +1,88 @@
#! /usr/bin/env python
#! /usr/bin/env python3
import csv
from datetime import datetime
from functools import cmp_to_key
days = [
"Ponedeljak",
"Utorak",
"Sreda",
"Četvrtak",
"Petak",
"Subota",
"Nedelja",
]
DAYS_SR = ["PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED"]
DAYS_EN = ["MON ", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
months = [
"Januar",
"Februar",
"Mart",
"April",
"Maj",
"Jun",
"Jul",
"Avgust",
"Septembar",
"Oktobar",
"Novembar",
"Decembar",
]
def load_events(csv_path:str) -> list[dict]:
events = []
with open(csv_path) as csv_file:
csv_reader = csv.reader(csv_file)
next(csv_reader, None)
for event in csv_reader:
event_date = event[0]
event_date_parsed = datetime.strptime(event_date, "%d-%m-%Y").date()
event_time = event[1]
event_location = event[2]
event_title = event[3]
current_event = {"date":event_date_parsed,
"time":event_time,
"location": event_location,
"title":event_title.strip()}
events.append(current_event)
return events
def build_html(events: list[dict], dayNames: list[str]) -> str:
events_html = []
for event in events:
title = event["title"]
location = event["location"]
date = event["date"]
date = dayNames[date.weekday()]+", "+str(date.day)+". "+str(date.month)+". "+str(date.year)+", "
time = event["time"]+"h"
event_html = []
event_html.append(f"<div class='date'>{date} {time}</div>")
event_html.append(f"<div class='title'>{title}</div>")
if "https://" in location:
place,link = location.split("https://")
event_html.append(f"<div class='place'><a href=\"https://{link}\">@{place.strip()}</a></div>")
else:
event_html.append(f"<div class='place'>@{location.strip()}</div>")
event_html = "".join(event_html)
events_html.append(f"\n<div class='event'>{event_html}</div>")
return events_html
events = sorted(load_events("dogadjaji.csv"), key=lambda e: e["date"])
today = datetime.today().date()
def parse_date(date):
return datetime.strptime(date,"%d-%m-%Y").date()
def compare_events(one, two):
one = parse_date(one.split(", ")[0])
two = parse_date(two.split(", ")[0])
if one>two:
return 1
elif one==two:
return 0
else:
return -1
def is_past_event(event):
return event < today
def load_events():
events = []
with open("dogadjaji.csv", "rt") as file:
file.readline()
for event in file.readlines():
event = event.strip()
if event != "":
events.append(event)
return events
def write_events(events):
with open("dogadjaji.csv", "wt") as file:
file.write("datum, vreme, lokacija, tema\n")
for event in events:
file.write(event+"\n")
def sort_events(events):
return sorted(events, key = cmp_to_key(compare_events))
past_events = list(filter(lambda e: e["date"] <= today, events))
new_events = list(filter(lambda e: e["date"] >= today, events))
events = load_events()
events = sort_events(events)
write_events(events)
page_template = ""
events = []
# Build Serbian Events page
new_events_html = build_html(new_events, DAYS_SR)
with open("pages/sr/events.html", "r") as file:
page_template = ([line for line in file])[:2]
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("<td> "+date+" </td>")
future_event.append("<td> "+time+" </td>")
if "https://" in location:
place,link = location.split("https://")
future_event.append("<td> <a href=\"https://"+link+"\""+"> "+place.strip()+" </a> </td>")
else:
future_event.append("<td> "+location.strip()+" </td>")
future_event.append("<td> "+title+" </td>")
events.append("<tr>\n"+"\n".join(future_event)+"\n</tr>")
with open("pages/sr/events.html", "w") as file:
file.writelines(page_template + new_events_html)
with open("pages/sr/events.html","wt") as file:
file.writelines(["<h1>Događaji</h1>\n", "<table>\n", "<tr><th>Datum</th><th>Vreme</th><th>Mesto</th><th>Tema</th></tr>\n"])
file.writelines(events)
file.writelines(["</table>"])
# Build English Events page
new_events_html = build_html(new_events, DAYS_EN)
with open("pages/en/events.html", "r") as file:
page_template = ([line for line in file])[:2]
#with open("pages/en/events.html","wt") as file:
# file.writelines(["<h1>Events</h1>", "<table>", "<tr>\n<th>Date</th>\n<th>Time</th>\n<th>Place</th>\n<th>Theme</th>\n</tr>"])
# file.writelines(events)
# file.writelines(["</table>"])
with open("pages/en/events.html", "w") as file:
file.writelines(page_template + new_events_html)
# Build Serbian Archive page
past_events_html = build_html(past_events, DAYS_SR)
with open("pages/sr/events_archive.html", "r") as file:
page_template = ([line for line in file])[:2]
with open("pages/sr/events_archive.html", "w") as file:
file.writelines(page_template + past_events_html)
# Build English Archive page
past_events_html = build_html(past_events, DAYS_EN)
with open("pages/en/events_archive.html", "r") as file:
page_template = ([line for line in file])[:2]
with open("pages/en/events_archive.html", "w") as file:
file.writelines(page_template + past_events_html)

View File

@ -1,36 +0,0 @@
<!doctype html>
<meta charset="UTF-8">
<html>
<head>
<link rel="icon" type="image/x-icon" href="/static/d.png">
<link rel="stylesheet" href="./static/reset.css">
<link rel="stylesheet" href="./static/main.css">
<title>Decentrala</title>
</head>
<body>
<div class="container">
<div class="header">
<h1 class="logo">DECENTRALA</h1>
</div>
<main>
<h2>Servisi</h2>
<p><a href="https://forum.dmz.rs">FORUM</a><p>
<p><a href="../chat.html">XMPP</a><p>
<p><a href="https://gitea.dmz.rs">GITEA</a><p>
<p><a href="https://wiki.dmz.rs">WIKI</a><p>
<p><a href="../nalog.html">EMAIL</a><p>
<p><a href="ssh://soft.dmz.rs:2222">SOFT SERVE</a><p>
<p><a href="https://search.dmz.rs">LibreX</a><p>
<p><a href="https://git.dmz.rs">CGIT</a><p>
<p><a href="https://pastebin.dmz.rs">PrivateBin</a><p>
<p><a href="https://cryptpad.dmz.rs">CryptPad</a><p>
<div class="back">
<ul class="nav">
<a href="../"><li>Nazad</li></a>
</ul>
</div>
</main>
</div>
</body>
</html>

View File

@ -1,4 +0,0 @@
h1 {
margin-bottom: 2rem;
font-weight: normal;
}

View File

@ -1,4 +0,0 @@
h1 {
margin-bottom: 2rem;
font-weight: normal;
}

View File

@ -1,30 +1,65 @@
table {
table-layout: fixed;
border-spacing: 0;
.event {
display: flex;
flex-direction: row;
}
th,
td {
padding: 0 1rem 0 1rem;
text-align: left;
border-left: 2px solid var(--border);
.event:hover {
border-bottom: 5px var(--hightlight) solid;
}
th {
padding: 1rem 1rem 0 1rem;
border-bottom: 2px solid var(--border);
.event:hover>div {
padding-bottom: calc(0.5rem - 5px);
}
td:nth-child(odd) {
.event>div {
padding-top: 0.5rem;
padding-bottom: 0.5rem;
white-space: nowrap;
}
td {
padding: 0 1rem 1rem 1rem;
vertical-align: top;
.date {
width: 250px;
font-size: 0.9em;
overflow-x: hidden;
white-space: nowrap;
}
h1 {
margin-bottom: 2rem;
font-weight: normal;
}
.title {
border-left: 2px solid var(--border);
font-weight: bold;
padding-left: 1rem;
padding-right: 0.5em;
}
.place {
font-size: 0.9em;
}
@media screen and (max-width: 1160px) {
.event {
flex-direction: column;
margin-bottom: 1rem;
border-left: 3px solid var(--border);
}
.event > div {
padding: 0 0.5rem;
white-space: normal;
}
.event:hover {
border-bottom: none;
}
.event:hover> div {
padding-bottom: 0;
}
.date {
width: 100%;
}
.title {
border-left: none;
}
}

View File

@ -1,8 +1,3 @@
h1 {
margin-bottom: 2rem;
font-weight: normal;
}
dl {
padding: 1rem 0;
}

View File

@ -20,8 +20,3 @@ td {
padding: 0 1rem 1rem 1rem;
vertical-align: top;
}
h1 {
margin-bottom: 2rem;
font-weight: normal;
}

View File

@ -68,6 +68,13 @@ main {
overflow: auto;
}
main h1 {
margin-bottom: 2rem;
font-weight: normal;
font-size: 1.5em;
font-variant-caps: small-caps;
}
a,
a:visited {
text-decoration: none;
@ -75,8 +82,7 @@ a:visited {
}
main a {
position: relative;
top: 0.2rem;
text-decoration: underline;
}
a:hover,
@ -112,7 +118,7 @@ a:focus {
background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%);
}
.account {
.lang {
font-size: 2rem;
}
@ -211,8 +217,4 @@ screen and (max-width: 1500px) {
#theme-switcher {
margin-right: 1rem;
}
.account {
font-size: 1rem;
}
}

View File

@ -9,12 +9,13 @@
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<script src="/scripts/main.js" defer></script>
<title><!--TITLE--> Decentrala</title>
<link rel="alternate" hreflang="sr" href="/PAGE_NAME" />
</head>
<body>
<header>
<a id="logo" href="/"><img src="/img/logo-light.svg" alt="Logo"> Decentrala</a>
<a id="logo" href="/en/index"><img src="/img/logo-light.svg" alt="Logo"> Decentrala</a>
<button id="theme-switcher"></button>
<a class="account" href="/en/account">Account</a>
<a class="lang" hreflang="sr" href="/PAGE_NAME">SR</a>
</header>
<main>
<!--MAIN-->
@ -22,9 +23,10 @@
<footer>
<button id="sections-button" opened="false"><img src="/img/strelica-closed-light.svg" alt="OpenMenu"></button>
<nav>
<a href="/en/events">Događaji</a>
<a href="/en/services">Servisi</a>
<a href="/en/contact">Kontakt</a>
<a href="/en/events">Events</a>
<a href="/en/services">Services</a>
<a href="/en/contact">Contact</a>
<a href="/en/account">Account</a>
</nav>
<span class="links">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>

View File

@ -9,12 +9,13 @@
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
<script src="/scripts/main.js" defer></script>
<title><!--TITLE--> Decentrala</title>
<link rel="alternate" hreflang="en" href="/en/PAGE_NAME" />
</head>
<body>
<header>
<a id="logo" href="/"><img src="/img/logo-light.svg" alt="Logo"> Decentrala</a>
<button id="theme-switcher"></button>
<a class="account" href="/account">Nalog</a>
<a class="lang" hreflang="en" href="/en/PAGE_NAME">EN</a>
</header>
<main>
<!--MAIN-->
@ -25,6 +26,7 @@
<a href="/events">Događaji</a>
<a href="/services">Servisi</a>
<a href="/contact">Kontakt</a>
<a class="account" href="/account">Nalog</a>
</nav>
<span class="links">
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>