Compare commits

...

15 Commits

Author SHA1 Message Date
037ddb0af6 Jul 2024 2024-06-20 19:13:25 +02:00
b7cdc83cff
fix link to statute on serbian version 2024-06-03 00:03:16 +02:00
54013ac9a9
fix pad and dark poster mesh color in imageposter 2024-06-01 17:25:16 +02:00
7c134225ed
add imageposter mesh for dark 2024-06-01 17:18:36 +02:00
56149858bf
add mesh 2024-06-01 17:02:14 +02:00
f3eebcdfa3
fix time in events 2024-06-01 15:17:37 +02:00
e8b4495c58
add A3 poster format 2024-06-01 15:16:21 +02:00
d4a8d92615
make bigger margins in poster 2024-06-01 12:56:02 +02:00
a8736b7805
fix time of events 2024-06-01 12:54:42 +02:00
468cb2c59e
add events 2024-05-28 19:48:04 +02:00
31d8bf8236
add event 2024-05-28 19:36:19 +02:00
0722444a3c
fix image_poster.py to only show specified month 2024-05-24 01:19:32 +02:00
f6d5004ae4
fix typo 2024-05-24 00:57:39 +02:00
182dcec506
add conference type of event 2024-05-21 01:56:19 +02:00
08d5f5d75b
add dekonferencija to dogadjaji.csv 2024-05-21 01:26:02 +02:00
4 changed files with 55 additions and 26 deletions

View File

@ -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,
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,
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,
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,
18-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Softvar hakaton, hack,
24-06-2024, 19:00, DC Krov https://www.openstreetmap.org/node/10594728522, Mesečna revizija, 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, Home-made SoC #4, lecture,
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.

View File

@ -7,6 +7,7 @@ from PIL import Image, ImageDraw, ImageFont
import csv
import datetime as dt
from dateutil import relativedelta
from cairosvg import svg2png
CURRENT_TIME = dt.date.today()
NEXT_MONTH = CURRENT_TIME + relativedelta.relativedelta(months=1, day=1)
@ -22,6 +23,7 @@ def parseArgs(parser):
return parser.parse_args()
def load_events(csv_path:str, month:int) -> list[dict]:
monthafter = month + relativedelta.relativedelta(months=1, day=1)
events = []
with open(csv_path) as 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,
"time":event_time,
"title":event_title.strip()}
if event_date_parsed >= month:
if event_date_parsed >= month and event_date_parsed < monthafter:
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)
fontFacade = ImageFont.truetype('./site/font/Facade-Sud.woff', size=365)
fontIosevka = ImageFont.truetype('./site/font/iosevka-regular.woff', size=200)
fontIosevkaSmall = ImageFont.truetype('./site/font/iosevka-regular.woff', size=150)
W = 1200
H = 1500
W = 3508
H = 4960
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)
draw.text(((W-w)/2, 165), 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)
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)
height += 60
draw.text((165, height), "Radionice pocinju u 19h u DC Krovu", font=fontIosevkaSmall, fill=fg)
height += 200
draw.text((120, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
height += 90
draw.text((165, height), "Svi dogadjaji su uvek besplatni", font=fontIosevkaSmall, fill=fg)
height += 300
# Write list of events to sperate text file as well
textfile=open("poster.txt","w")
@ -79,9 +81,9 @@ def drawPoster(events, bg, fg, month:int):
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
eventText = f"{date} {day}. {pad}{title}"
draw.text((165, height), eventText, font=fontIosevkaSmall, fill=fg)
height += 200
# Add event to textfile
textfile.write(eventText + "\n")
@ -89,22 +91,39 @@ def drawPoster(events, bg, fg, month:int):
textfile.close()
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)
LCX = 950 # logo center x
LCY = 1200 # logo center y
d = 50 # delta
LCX = 415 # logo center x
LCY = 4350 # logo center y
d = 190 # 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.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=20, joint=None)
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
def main():

View File

@ -1,7 +1,7 @@
<h1>O nama</h1>
<dl>
<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>
<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>

View File

@ -13,6 +13,7 @@ TYPES_DICT = {
"lighting": ("kratka predavanja", "short talks"),
"movie": ("film", "movie"),
"meeting": ("sastanak", "meeting"),
"conference": ("konferencija", "conference"),
}
def load_events(csv_path:str) -> list[dict]: