forked from Decentrala/website
Compare commits
41 Commits
a74fc6cdc1
...
25662d7bda
Author | SHA1 | Date | |
---|---|---|---|
25662d7bda | |||
12235ab51e | |||
62da74bf99 | |||
a321ebe765 | |||
a70fd1369e | |||
768f1c66e6 | |||
fb50c076fe | |||
b31a1b5ebf | |||
ab15c97e5e | |||
702ab07e03 | |||
3232cdcf09 | |||
aec8f74ed2 | |||
62778e2679 | |||
4eae5c08b8 | |||
4b700f6652 | |||
de3d5142f6 | |||
1bfa147cb4 | |||
8d942cf2f3 | |||
39b65d0547 | |||
efe1ea873b | |||
44910c183b | |||
be37b42273 | |||
29c1b7ad55 | |||
4233fe7f44 | |||
4bcd13a713 | |||
05c11219d2 | |||
6671fb1547 | |||
221dff13dd | |||
1f5e541922 | |||
d31e4e10c8 | |||
005fba6010 | |||
b71eb393ce | |||
bdd7a3e7ef | |||
703c11a5ce | |||
1db838a44c | |||
0fde75bc41 | |||
9fa68a27b6 | |||
d878e884d4 | |||
f9ff147495 | |||
|
5e90343728 | ||
1a1ee35992 |
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,8 +1,11 @@
|
|||||||
venv/
|
venv/
|
||||||
site/*.html
|
site/*.html
|
||||||
|
site/en/*.html
|
||||||
site/atom_blog.xml
|
site/atom_blog.xml
|
||||||
site/atom_events.xml
|
site/atom_events.xml
|
||||||
poster.html
|
poster.html
|
||||||
poster.pdf
|
poster.pdf
|
||||||
|
poster_light.png
|
||||||
|
poster_dark.png
|
||||||
http.access.log
|
http.access.log
|
||||||
http.error.log
|
http.error.log
|
||||||
|
@ -31,9 +31,12 @@ nginx -p . -s stop
|
|||||||
## TODO:
|
## TODO:
|
||||||
|
|
||||||
- [x] create page builder
|
- [x] create page builder
|
||||||
|
- rename `prep.py` to more informative name (`build_events.py`)
|
||||||
- [ ] create blogging system
|
- [ ] create blogging system
|
||||||
- [ ] create xmpp bot that connects to events section.
|
- [ ] create xmpp bot that connects to events section.
|
||||||
- [ ] webring system
|
- [ ] webring system
|
||||||
- [x] make page
|
- [x] make page
|
||||||
- [ ] populate 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
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/python3
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
# needs lowdown and feegden installed
|
# needs lowdown and feegden installed
|
||||||
# feedgen can be installed with pip
|
# feedgen can be installed with pip
|
||||||
|
1
blog.py
Normal file → Executable file
1
blog.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
# just testing markdown library for now
|
# just testing markdown library for now
|
||||||
|
|
||||||
from markdown import markdown as to_markdown
|
from markdown import markdown as to_markdown
|
||||||
|
13
build_pages.py
Normal file → Executable file
13
build_pages.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
import os
|
import os
|
||||||
|
|
||||||
PAGES = [
|
PAGES = [
|
||||||
@ -5,14 +6,16 @@ PAGES = [
|
|||||||
{'name': 'account', 'titleSR': 'Nalog', 'titleEN': 'Account', 'style': 'account'},
|
{'name': 'account', 'titleSR': 'Nalog', 'titleEN': 'Account', 'style': 'account'},
|
||||||
{'name': 'contact', 'titleSR': 'Kontakt', 'titleEN': 'Contact', 'style': 'contact'},
|
{'name': 'contact', 'titleSR': 'Kontakt', 'titleEN': 'Contact', 'style': 'contact'},
|
||||||
{'name': 'events', 'titleSR': 'Događaji', 'titleEN': 'Events', 'style': 'events'},
|
{'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': 'services', 'titleSR': 'Servisi', 'titleEN': 'Services', 'style': 'services'},
|
||||||
{'name': 'webring', 'titleSR': 'Webring', 'titleEN': 'Webring', 'style': ''},
|
{'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)
|
template = template.replace('<!--TITLE-->', pageTitle)
|
||||||
style = '' if not pageStyle else f'<link rel=\"stylesheet\" href=\"/styles/{pageStyle}.css\">'
|
style = '' if not pageStyle else f'<link rel=\"stylesheet\" href=\"/styles/{pageStyle}.css\">'
|
||||||
template = template.replace('<!--ADDITIONAL_STYLE-->', style)
|
template = template.replace('<!--ADDITIONAL_STYLE-->', style)
|
||||||
|
template = template.replace('PAGE_NAME', filename)
|
||||||
template = template.replace('<!--MAIN-->', pageHtml)
|
template = template.replace('<!--MAIN-->', pageHtml)
|
||||||
return template
|
return template
|
||||||
|
|
||||||
@ -24,10 +27,16 @@ def main():
|
|||||||
for page in PAGES:
|
for page in PAGES:
|
||||||
with open(f'pages/sr/{page["name"]}.html') as f:
|
with open(f'pages/sr/{page["name"]}.html') as f:
|
||||||
pageHtml = f.read()
|
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 = open(f'site/{page["name"]}.html', 'w')
|
||||||
f.write(html)
|
f.write(html)
|
||||||
f.close()
|
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__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
@ -1,20 +1,80 @@
|
|||||||
datum, vreme, lokacija, tema
|
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
|
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, 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
|
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)
|
05-05-2023, 15:30, Cvijeta Zuzorić 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)
|
06-05-2023, 12:00, Cvijeta Zuzorić 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)
|
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
|
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
|
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
|
11-05-2023, 18:00, Polyhedra https://www.openstreetmap.org/node/4856556781, Uvod u računarske mreže
|
||||||
01-08-2023, 19:00, DC Krov, Tehno veče
|
05-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Šifre
|
||||||
07-08-2023, 19:00, DC Krov, Linux ricing
|
06-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Random i kriptografija
|
||||||
08-08-2023, 19:00, DC Krov, Lambda račun
|
12-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Uvod u Blender
|
||||||
14-08-2023, 19:00, DC Krov, Linux distro diskusija
|
13-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||||
15-08-2023, 19:00, DC Krov, Pirati 777 mora
|
19-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pisanje BASH skripti
|
||||||
21-08-2023, 19:00, DC Krov, Python vežbe
|
20-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Cybersecurity odbrana
|
||||||
22-08-2023, 19:00, DC Krov, Autentifikacija na internetu
|
26-06-2023, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Python vežbe
|
||||||
28-08-2023, 19:00, DC Krov, Kviz
|
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
|
||||||
|
|
114
image_poster.py
Executable file
114
image_poster.py
Executable 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
8
pages/en/account.html
Normal 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
5
pages/en/contact.html
Normal 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
2
pages/en/events.html
Normal 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>
|
2
pages/en/events_archive.html
Normal file
2
pages/en/events_archive.html
Normal 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
31
pages/en/index.html
Normal 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
54
pages/en/services.html
Normal 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
5
pages/en/webring.html
Normal 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>
|
@ -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>
|
<h1>Nalog</h1>
|
||||||
<p> Za vise o XMPP pogledajte <a href="https://wiki.dmz.rs/en/tutorial/conversations">tutorial</a>. <p>
|
<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 primer podesavanja na <a href="https://thunderbird.org">Thundebird</a> mail klijentu mozete pogledati <a href="/img/mailsettings.png">sliku</a>. <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/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>
|
<p><a href="/account/changepassword/">Promeni lozinku</a><p>
|
||||||
|
@ -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>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>
|
<p>Takođe smo dostupni i na <a href="https://balkan.fedive.rs/@decentrala">Fediversu!</a></p>
|
||||||
<br>
|
<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>
|
||||||
|
@ -1,59 +1,2 @@
|
|||||||
<h1>Događaji</h1>
|
<h1>Događaji</h1>
|
||||||
<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>
|
||||||
<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>
|
|
2
pages/sr/events_archive.html
Normal file
2
pages/sr/events_archive.html
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<h1>Arhiva događaja</h1>
|
||||||
|
<p>Svi događaji koje smo do sada organzivali.</p><br>
|
@ -14,10 +14,19 @@
|
|||||||
<dt>Servisi:</dt>
|
<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
|
<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>
|
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>
|
</dl>
|
||||||
<p>
|
<p>
|
||||||
Ako si i dalje zainteresovan, možeš napraviti <a href="/pages/account.html">nalog</a> na našem serveru koji će ti
|
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="/pages/services.html">servisa</a>.
|
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
|
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!
|
href="/events">događaja</a>, i tu nas upoznati!
|
||||||
</p>
|
</p>
|
@ -5,26 +5,26 @@
|
|||||||
<th>Opis</th>
|
<th>Opis</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="/account.html">Email</a></td>
|
<td><a href="/account">E-mail</a></td>
|
||||||
<td>Email nalog koji možeš koristiti sa bilo kojim email
|
<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-u</a>).</td>
|
klijentom generalne namene (na primer <a href="https://www.thunderbird.net/">Thunderbird</a>-om).</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://forum.dmz.rs/">Forum</a></td>
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Chat</td>
|
<td>Chat</td>
|
||||||
<td>Održavamo sopstveni XMPP server, na kojem možeš napraviti nalog.
|
<td>Održavamo sopstveni XMPP server, na kojem možeš da napraviš nalog.
|
||||||
Ako već poseduješ nalog možeš nas naći u grupi <a
|
Ako već poseduješ nalog možeš da nas nađeš u grupi <a
|
||||||
href="decentrala@conference.dmz.rs">decentrala@conference.dmz.rs</a>.
|
href="decentrala@conference.dmz.rs">decentrala@conference.dmz.rs</a>.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://gitea.dmz.rs/">Git</a></td>
|
<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
|
<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="/pages/projects.html">projekte</a>, <a href="/pages/events.html">dogadjaje</a>, kao i projekte naših
|
<a href="/projects">projekte</a>, <a href="/events">događaje</a>, kao i projekte naših
|
||||||
prijatelja.
|
prijatelja.
|
||||||
Ovo može biti dom tvog sledećeg projekta. Bolji od Github-a.
|
Ovo može biti dom tvog sledećeg projekta. Bolji od Github-a.
|
||||||
</td>
|
</td>
|
||||||
@ -32,13 +32,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://wiki.dmz.rs/">Wiki</a></td>
|
<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
|
<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
|
<a href="/projects">projekte</a> kao i ostale <a href="/events">događaje</a>.
|
||||||
ostale <a href="/pages/events.html">događaje</a>.
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="https://search.dmz.rs/">Search</a></td>
|
<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.
|
Bolji od Google-a.
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -49,12 +48,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><a href="ssh://soft.dmz.rs:2222/">Soft Serve</a></td>
|
<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
|
<td><a href="https://github.com/charmbracelet/soft-serve">Soft Serve</a> instanca koju koristimo kao zamenu za Gitea servis.
|
||||||
servis.
|
|
||||||
Soft Serve radi potpuno iz terminala
|
Soft Serve radi potpuno iz terminala
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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
|
<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
|
||||||
registovati na svaki servis posebno, a možeš i napraviti jedinstveni <a href="/pages/account.html">nalog</a> na nasem
|
registuješ na svaki servis posebno, a možeš i da napraviš jedinstveni <a href="/account">nalog</a> na našem
|
||||||
serveru i koristiti sve servise sa istim nalogom.</p>
|
serveru i da koristiš sve servise sa istim nalogom.</p>
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
<h1>Webring</h1>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://tilde.zone/explore">Tilde Zone</a></li>
|
<li><a href="https://pionir.org">Slobodna škola Pionir</a></li>
|
||||||
|
<li><a href="https://tilda.center">Tilda Centar</a></li>
|
||||||
</ul>
|
</ul>
|
1
poster.py
Normal file → Executable file
1
poster.py
Normal file → Executable file
@ -1,3 +1,4 @@
|
|||||||
|
#! /usr/bin/env python3
|
||||||
import csv
|
import csv
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from dateutil import relativedelta
|
from dateutil import relativedelta
|
||||||
|
163
prep.py
Normal file → Executable file
163
prep.py
Normal file → Executable file
@ -1,101 +1,88 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python3
|
||||||
|
|
||||||
|
import csv
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from functools import cmp_to_key
|
|
||||||
|
|
||||||
days = [
|
DAYS_SR = ["PON", "UTO", "SRE", "ČET", "PET", "SUB", "NED"]
|
||||||
"Ponedeljak",
|
DAYS_EN = ["MON ", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
|
||||||
"Utorak",
|
|
||||||
"Sreda",
|
|
||||||
"Četvrtak",
|
|
||||||
"Petak",
|
|
||||||
"Subota",
|
|
||||||
"Nedelja",
|
|
||||||
]
|
|
||||||
|
|
||||||
months = [
|
def load_events(csv_path:str) -> list[dict]:
|
||||||
"Januar",
|
events = []
|
||||||
"Februar",
|
with open(csv_path) as csv_file:
|
||||||
"Mart",
|
csv_reader = csv.reader(csv_file)
|
||||||
"April",
|
next(csv_reader, None)
|
||||||
"Maj",
|
for event in csv_reader:
|
||||||
"Jun",
|
event_date = event[0]
|
||||||
"Jul",
|
event_date_parsed = datetime.strptime(event_date, "%d-%m-%Y").date()
|
||||||
"Avgust",
|
event_time = event[1]
|
||||||
"Septembar",
|
event_location = event[2]
|
||||||
"Oktobar",
|
event_title = event[3]
|
||||||
"Novembar",
|
current_event = {"date":event_date_parsed,
|
||||||
"Decembar",
|
"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()
|
today = datetime.today().date()
|
||||||
|
|
||||||
def parse_date(date):
|
past_events = list(filter(lambda e: e["date"] <= today, events))
|
||||||
return datetime.strptime(date,"%d-%m-%Y").date()
|
new_events = list(filter(lambda e: e["date"] >= today, events))
|
||||||
|
|
||||||
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))
|
|
||||||
|
|
||||||
|
|
||||||
events = load_events()
|
page_template = ""
|
||||||
events = sort_events(events)
|
|
||||||
write_events(events)
|
|
||||||
|
|
||||||
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:
|
with open("pages/sr/events.html", "w") as file:
|
||||||
date, time, location, title = event.split(", ")
|
file.writelines(page_template + new_events_html)
|
||||||
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","wt") as file:
|
# Build English Events page
|
||||||
file.writelines(["<h1>Događaji</h1>\n", "<table>\n", "<tr><th>Datum</th><th>Vreme</th><th>Mesto</th><th>Tema</th></tr>\n"])
|
new_events_html = build_html(new_events, DAYS_EN)
|
||||||
file.writelines(events)
|
with open("pages/en/events.html", "r") as file:
|
||||||
file.writelines(["</table>"])
|
page_template = ([line for line in file])[:2]
|
||||||
|
|
||||||
#with open("pages/en/events.html","wt") as file:
|
with open("pages/en/events.html", "w") 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(page_template + new_events_html)
|
||||||
# file.writelines(events)
|
|
||||||
# file.writelines(["</table>"])
|
# 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)
|
||||||
|
36
servisi.html
36
servisi.html
@ -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>
|
|
@ -1,4 +0,0 @@
|
|||||||
h1 {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
h1 {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
@ -1,30 +1,65 @@
|
|||||||
table {
|
.event {
|
||||||
table-layout: fixed;
|
display: flex;
|
||||||
border-spacing: 0;
|
flex-direction: row;
|
||||||
}
|
}
|
||||||
|
|
||||||
th,
|
.event:hover {
|
||||||
td {
|
border-bottom: 5px var(--hightlight) solid;
|
||||||
padding: 0 1rem 0 1rem;
|
|
||||||
text-align: left;
|
|
||||||
border-left: 2px solid var(--border);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
.event:hover>div {
|
||||||
padding: 1rem 1rem 0 1rem;
|
padding-bottom: calc(0.5rem - 5px);
|
||||||
border-bottom: 2px solid var(--border);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
td:nth-child(odd) {
|
.event>div {
|
||||||
|
padding-top: 0.5rem;
|
||||||
|
padding-bottom: 0.5rem;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
td {
|
.date {
|
||||||
padding: 0 1rem 1rem 1rem;
|
width: 250px;
|
||||||
vertical-align: top;
|
font-size: 0.9em;
|
||||||
|
overflow-x: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
.title {
|
||||||
margin-bottom: 2rem;
|
border-left: 2px solid var(--border);
|
||||||
font-weight: normal;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
@ -1,8 +1,3 @@
|
|||||||
h1 {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
dl {
|
dl {
|
||||||
padding: 1rem 0;
|
padding: 1rem 0;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,3 @@ td {
|
|||||||
padding: 0 1rem 1rem 1rem;
|
padding: 0 1rem 1rem 1rem;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
|
||||||
margin-bottom: 2rem;
|
|
||||||
font-weight: normal;
|
|
||||||
}
|
|
@ -68,6 +68,13 @@ main {
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
main h1 {
|
||||||
|
margin-bottom: 2rem;
|
||||||
|
font-weight: normal;
|
||||||
|
font-size: 1.5em;
|
||||||
|
font-variant-caps: small-caps;
|
||||||
|
}
|
||||||
|
|
||||||
a,
|
a,
|
||||||
a:visited {
|
a:visited {
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@ -75,8 +82,7 @@ a:visited {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main a {
|
main a {
|
||||||
position: relative;
|
text-decoration: underline;
|
||||||
top: 0.2rem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a:hover,
|
a:hover,
|
||||||
@ -112,7 +118,7 @@ a:focus {
|
|||||||
background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%);
|
background: linear-gradient(90deg, var(--hightlight) 0%, var(--hightlight) 50%, var(--bg) 51%, var(--bg) 100%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.account {
|
.lang {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,8 +217,4 @@ screen and (max-width: 1500px) {
|
|||||||
#theme-switcher {
|
#theme-switcher {
|
||||||
margin-right: 1rem;
|
margin-right: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account {
|
|
||||||
font-size: 1rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -9,12 +9,13 @@
|
|||||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
<script src="/scripts/main.js" defer></script>
|
<script src="/scripts/main.js" defer></script>
|
||||||
<title><!--TITLE--> Decentrala</title>
|
<title><!--TITLE--> Decentrala</title>
|
||||||
|
<link rel="alternate" hreflang="sr" href="/PAGE_NAME" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<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>
|
<button id="theme-switcher"></button>
|
||||||
<a class="account" href="/en/account">Account</a>
|
<a class="lang" hreflang="sr" href="/PAGE_NAME">SR</a>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<!--MAIN-->
|
<!--MAIN-->
|
||||||
@ -22,9 +23,10 @@
|
|||||||
<footer>
|
<footer>
|
||||||
<button id="sections-button" opened="false"><img src="/img/strelica-closed-light.svg" alt="OpenMenu"></button>
|
<button id="sections-button" opened="false"><img src="/img/strelica-closed-light.svg" alt="OpenMenu"></button>
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/en/events">Događaji</a>
|
<a href="/en/events">Events</a>
|
||||||
<a href="/en/services">Servisi</a>
|
<a href="/en/services">Services</a>
|
||||||
<a href="/en/contact">Kontakt</a>
|
<a href="/en/contact">Contact</a>
|
||||||
|
<a href="/en/account">Account</a>
|
||||||
</nav>
|
</nav>
|
||||||
<span class="links">
|
<span class="links">
|
||||||
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>
|
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>
|
||||||
|
@ -9,12 +9,13 @@
|
|||||||
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
<link rel="shortcut icon" href="/img/favicon.ico" type="image/x-icon">
|
||||||
<script src="/scripts/main.js" defer></script>
|
<script src="/scripts/main.js" defer></script>
|
||||||
<title><!--TITLE--> Decentrala</title>
|
<title><!--TITLE--> Decentrala</title>
|
||||||
|
<link rel="alternate" hreflang="en" href="/en/PAGE_NAME" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<header>
|
<header>
|
||||||
<a id="logo" href="/"><img src="/img/logo-light.svg" alt="Logo"> Decentrala</a>
|
<a id="logo" href="/"><img src="/img/logo-light.svg" alt="Logo"> Decentrala</a>
|
||||||
<button id="theme-switcher"></button>
|
<button id="theme-switcher"></button>
|
||||||
<a class="account" href="/account">Nalog</a>
|
<a class="lang" hreflang="en" href="/en/PAGE_NAME">EN</a>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<!--MAIN-->
|
<!--MAIN-->
|
||||||
@ -25,6 +26,7 @@
|
|||||||
<a href="/events">Događaji</a>
|
<a href="/events">Događaji</a>
|
||||||
<a href="/services">Servisi</a>
|
<a href="/services">Servisi</a>
|
||||||
<a href="/contact">Kontakt</a>
|
<a href="/contact">Kontakt</a>
|
||||||
|
<a class="account" href="/account">Nalog</a>
|
||||||
</nav>
|
</nav>
|
||||||
<span class="links">
|
<span class="links">
|
||||||
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>
|
<a href="https://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="/img/cc-light.svg" alt="CreativeCommons"></a>
|
||||||
|
Loading…
Reference in New Issue
Block a user