forked from Decentrala/website
Compare commits
15 Commits
47c4260b5e
...
037ddb0af6
Author | SHA1 | Date | |
---|---|---|---|
037ddb0af6 | |||
b7cdc83cff | |||
54013ac9a9 | |||
7c134225ed | |||
56149858bf | |||
f3eebcdfa3 | |||
e8b4495c58 | |||
d4a8d92615 | |||
a8736b7805 | |||
468cb2c59e | |||
31d8bf8236 | |||
0722444a3c | |||
f6d5004ae4 | |||
182dcec506 | |||
08d5f5d75b |
@ -146,10 +146,19 @@ datum, vreme, lokacija, tema, tip,
|
|||||||
02-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop,
|
02-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ejabberd/xmpp server), workshop,
|
||||||
03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie,
|
03-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Pi (1998), movie,
|
||||||
04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack,
|
04-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hardverski hakaton, hack,
|
||||||
|
09-06-2024, 14:00, DC Krov https://www.openstreetmap.org/node/10594728522, Game Jam, hack,
|
||||||
10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture,
|
10-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Obrada prirodnih jezika kroz Python, lecture,
|
||||||
11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion,
|
11-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Ideološka diskusija, discussion,
|
||||||
17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion,
|
17-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Diskusija o P2P mrežama, discussion,
|
||||||
18-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softvar hakaton, hack,
|
18-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softverski hakaton, hack,
|
||||||
24-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna revizija, hack,
|
24-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Home-made SoC #4, lecture,
|
||||||
25-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna bleja i revizija, meeting,
|
25-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna bleja i revizija, meeting,
|
||||||
30-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ldap server/nalozi korisnika), workshop,
|
30-06-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Sysadmin obuka (ldap server/nalozi korisnika), workshop,
|
||||||
|
01-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, 1984 (1956), movie
|
||||||
|
02-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Open-source SoC, lecture,
|
||||||
|
08-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Lightning talks, lighting,
|
||||||
|
09-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, Hakaton, hack,
|
||||||
|
12-07-2024, 15:00, KC Gnezdo https://osm.org/go/xftd8rbl2, Uticaj tehnologije na kulturu, lecture,
|
||||||
|
29-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, OnionShare, lecture
|
||||||
|
20-07-2024, 17:00, DC Krov https://www.openstreetmap.org/node/10594728522, CryptoPals #1, workshop
|
||||||
|
15-09-2024, 12:00, KC Magacin https://www.openstreetmap.org/node/1226456745#map=19/44.81314/20.45378, Dekonferencija, conference,
|
||||||
|
Can't render this file because it has a wrong number of fields in line 30.
|
@ -7,6 +7,7 @@ from PIL import Image, ImageDraw, ImageFont
|
|||||||
import csv
|
import csv
|
||||||
import datetime as dt
|
import datetime as dt
|
||||||
from dateutil import relativedelta
|
from dateutil import relativedelta
|
||||||
|
from cairosvg import svg2png
|
||||||
|
|
||||||
CURRENT_TIME = dt.date.today()
|
CURRENT_TIME = dt.date.today()
|
||||||
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
|
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
|
||||||
@ -22,6 +23,7 @@ def parseArgs(parser):
|
|||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
def load_events(csv_path:str, month:int) -> list[dict]:
|
def load_events(csv_path:str, month:int) -> list[dict]:
|
||||||
|
monthafter = month + relativedelta.relativedelta(months=1, day=1)
|
||||||
events = []
|
events = []
|
||||||
with open(csv_path) as csv_file:
|
with open(csv_path) as csv_file:
|
||||||
csv_reader = csv.reader(csv_file)
|
csv_reader = csv.reader(csv_file)
|
||||||
@ -34,35 +36,35 @@ def load_events(csv_path:str, month:int) -> list[dict]:
|
|||||||
current_event = {"date":event_date_parsed,
|
current_event = {"date":event_date_parsed,
|
||||||
"time":event_time,
|
"time":event_time,
|
||||||
"title":event_title.strip()}
|
"title":event_title.strip()}
|
||||||
if event_date_parsed >= month:
|
if event_date_parsed >= month and event_date_parsed < monthafter:
|
||||||
events.append(current_event)
|
events.append(current_event)
|
||||||
return events
|
return events
|
||||||
|
|
||||||
def drawPoster(events, bg, fg, month:int):
|
def drawPoster(events, bg, fg, month:int):
|
||||||
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=110)
|
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=365)
|
||||||
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=60)
|
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=200)
|
||||||
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=45)
|
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=150)
|
||||||
|
|
||||||
W = 1200
|
W = 3508
|
||||||
H = 1500
|
H = 4960
|
||||||
img = Image.new('RGB', (W, H), bg)
|
img = Image.new('RGB', (W, H), bg)
|
||||||
draw = ImageDraw.Draw(img)
|
draw = ImageDraw.Draw(img)
|
||||||
|
|
||||||
header = "DECENTRALA"
|
header = "DECENTRALA"
|
||||||
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
|
_, _, w, _ = draw.textbbox((0, 0), header, font=fontFacade)
|
||||||
draw.text(((W-w)/2, 120), header, font=fontFacade, fill=fg)
|
draw.text(((W-w)/2, 165), header, font=fontFacade, fill=fg)
|
||||||
|
|
||||||
subheader = f"Plan za {MONTHS_SR[month.month - 1]}"
|
subheader = f"Plan za {MONTHS_SR[month.month - 1]}"
|
||||||
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
|
_, _, w, _ = draw.textbbox((0, 0), subheader, font=fontIosevka)
|
||||||
draw.text(((W-w)/2, 240), subheader, font=fontIosevka, fill=fg)
|
draw.text(((W-w)/2, 560), subheader, font=fontIosevka, fill=fg)
|
||||||
|
|
||||||
height = 370
|
height = 990
|
||||||
|
|
||||||
draw.text((120, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
|
draw.text((165, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
|
||||||
height += 60
|
height += 200
|
||||||
|
|
||||||
draw.text((120, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
|
draw.text((165, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
|
||||||
height += 90
|
height += 300
|
||||||
|
|
||||||
# Write list of events to sperate text file as well
|
# Write list of events to sperate text file as well
|
||||||
textfile=open("poster.txt","w")
|
textfile=open("poster.txt","w")
|
||||||
@ -79,9 +81,9 @@ def drawPoster(events, bg, fg, month:int):
|
|||||||
day = event["date"].day
|
day = event["date"].day
|
||||||
title = event["title"]
|
title = event["title"]
|
||||||
pad = " " if event["date"].day < 10 else ""
|
pad = " " if event["date"].day < 10 else ""
|
||||||
eventText = f"{date} {day}. {pad} {title}"
|
eventText = f"{date} {day}. {pad}{title}"
|
||||||
draw.text((120, height), eventText, font=fontIosevkaSmall, fill=fg)
|
draw.text((165, height), eventText, font=fontIosevkaSmall, fill=fg)
|
||||||
height += 70
|
height += 200
|
||||||
|
|
||||||
# Add event to textfile
|
# Add event to textfile
|
||||||
textfile.write(eventText + "\n")
|
textfile.write(eventText + "\n")
|
||||||
@ -89,22 +91,39 @@ def drawPoster(events, bg, fg, month:int):
|
|||||||
textfile.close()
|
textfile.close()
|
||||||
|
|
||||||
def drawCircle(x, y):
|
def drawCircle(x, y):
|
||||||
r = 10
|
r = 50
|
||||||
draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0)
|
draw.ellipse((x - r, y - r, x + r, y+r), fill=fg, outline=(0, 0, 0), width=0)
|
||||||
|
|
||||||
LCX = 950 # logo center x
|
LCX = 415 # logo center x
|
||||||
LCY = 1200 # logo center y
|
LCY = 4350 # logo center y
|
||||||
d = 50 # delta
|
d = 190 # delta
|
||||||
drawCircle(LCX - d, LCY)
|
drawCircle(LCX - d, LCY)
|
||||||
drawCircle(LCX, LCY)
|
drawCircle(LCX, LCY)
|
||||||
drawCircle(LCX, LCY - d)
|
drawCircle(LCX, LCY - d)
|
||||||
drawCircle(LCX, LCY + d)
|
drawCircle(LCX, LCY + d)
|
||||||
drawCircle(LCX + d, LCY)
|
drawCircle(LCX + d, LCY)
|
||||||
|
|
||||||
draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=5, joint=None)
|
draw.line([(LCX - d, LCY), (LCX + d, LCY)], fill=fg, width=20, joint=None)
|
||||||
draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=5, joint=None)
|
draw.line([(LCX, LCY), (LCX, LCY + d), (LCX + d, LCY), (LCX, LCY - d)], fill=fg, width=20, joint=None)
|
||||||
draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg)
|
draw.text((LCX - 1.7*d, LCY + 1.5*d), "dmz.rs", font=fontIosevka, fill=fg)
|
||||||
|
|
||||||
|
mesh_svg = svg2png(url='site/img/mesh-light.svg')
|
||||||
|
mesh_svg_bytes = io.BytesIO(mesh_svg)
|
||||||
|
mesh_img = Image.open(mesh_svg_bytes)
|
||||||
|
if bg == (0,0,0):
|
||||||
|
pixdata = mesh_img.load()
|
||||||
|
for y in range(mesh_img.size[1]):
|
||||||
|
for x in range(mesh_img.size[0]):
|
||||||
|
if pixdata[x,y] != (0,0,0,0):
|
||||||
|
pixdata[x, y] = (0, 100, 0, 255)
|
||||||
|
|
||||||
|
mesh_img = mesh_img.resize((W,H))
|
||||||
|
mesh_img.thumbnail((W,H), Image.Resampling.LANCZOS)
|
||||||
|
|
||||||
|
mesh_w, mesh_h = mesh_img.size
|
||||||
|
mesh_position = (W - mesh_w, H - mesh_h)
|
||||||
|
img.paste(mesh_img, mesh_position, mesh_img)
|
||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<h1>O nama</h1>
|
<h1>O nama</h1>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>Statut:</dt>
|
<dt>Statut:</dt>
|
||||||
<dd> Sve odluke se donose po principu direktne demokratije. Nas statut mozete pogledati na <a href="/en/statute">stranici za statut</a>. </dd>
|
<dd> Sve odluke se donose po principu direktne demokratije. Nas statut mozete pogledati na <a href="/statute">stranici za statut</a>. </dd>
|
||||||
|
|
||||||
<dt>Kontakt:</dt>
|
<dt>Kontakt:</dt>
|
||||||
<dd>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>.</dd>
|
<dd>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>.</dd>
|
||||||
|
1
prep.py
1
prep.py
@ -13,6 +13,7 @@ TYPES_DICT = {
|
|||||||
"lighting": ("kratka predavanja", "short talks"),
|
"lighting": ("kratka predavanja", "short talks"),
|
||||||
"movie": ("film", "movie"),
|
"movie": ("film", "movie"),
|
||||||
"meeting": ("sastanak", "meeting"),
|
"meeting": ("sastanak", "meeting"),
|
||||||
|
"conference": ("konferencija", "conference"),
|
||||||
}
|
}
|
||||||
|
|
||||||
def load_events(csv_path:str) -> list[dict]:
|
def load_events(csv_path:str) -> list[dict]:
|
||||||
|
Loading…
Reference in New Issue
Block a user