Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/news/+techevent.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade collective.techevent to 1.0.0a19. @ericof
4 changes: 2 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ dependencies = [
"collective.volto.formsupport",
"pas.plugins.authomatic==2.0.0",
"collective.honeypot",
"collective.techevent==1.0.0a18",
"collective.techevent==1.0.0a19",
"plone.app.upgrade",
"plone.app.discussion",
]
Expand Down Expand Up @@ -105,7 +105,7 @@ constraint-dependencies = [
"collective.recipe.omelette==2.0.0",
"collective.recipe.template==2.2",
"collective.recipe.vscode==0.1.9",
"collective.techevent==1.0.0a18",
"collective.techevent==1.0.0a19",
"collective.xmltestreport==2.0.2",
"collective.z3cform.datagridfield==3.0.4",
"colorama==0.4.6",
Expand Down
9 changes: 9 additions & 0 deletions backend/src/pythonbrasil/site/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@
_ = MessageFactory(PACKAGE_NAME)

logger = logging.getLogger(PACKAGE_NAME)


def run_patches():
from pythonbrasil.site.patch import apply_patches

apply_patches()


run_patches()
48 changes: 48 additions & 0 deletions backend/src/pythonbrasil/site/patch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from copy import deepcopy
from datetime import timedelta
from dateutil.parser import parse
from pythonbrasil.site import logger


def patch_process_trainings():
from collective.techevent.services.schedule import get

def process_trainings(slots: list[dict]) -> list[dict]:
"""Break whole day training sessions as 2 slots."""
slot_limit = 14400 # 4 hours
lunch_break = 60 * 60 * 1 # 1 hour lunch break
response = []
for slot in slots:
raw_start = slot["start"]
raw_end = slot["end"]
if slot.get("@type") != "Training" or not (raw_start and raw_end):
response.append(slot)
continue
start = parse(raw_start)
end = parse(raw_end)
if (total_duration := (end - start).seconds) > slot_limit:
# change the first slot end
slot_end = start + timedelta(seconds=slot_limit)
slot["end"] = slot_end.isoformat()
response.append(slot)
slot = deepcopy(slot)
# change the second slot start
new_start = slot_end + timedelta(seconds=lunch_break)
slot["start"] = new_start.isoformat()
slot_end = new_start + timedelta(seconds=(total_duration - slot_limit))
slot["end"] = slot_end.isoformat()
response.append(slot)
else:
response.append(slot)
return response

# Make a reference the original function
get._original_process_trainings = get.process_trainings
# Replace the original function with the patched one
get.process_trainings = process_trainings
logger.info("Patched collective.techevent.services.schedule.get.process_trainings")


def apply_patches():
patch_process_trainings()
logger.info("All patches applied.")
2,268 changes: 1,134 additions & 1,134 deletions backend/uv.lock

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Modifica a cor de fundo para um tom de cinza mais claro. @ericof
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade @plone-collective/volto-techevent to 1.0.0-alpha.19. @ericof
2 changes: 1 addition & 1 deletion frontend/packages/volto-pythonbrasil-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"@plone/registry": "workspace:*",
"@eeacms/volto-matomo": "*",
"@eeacms/volto-statistic-block": "*",
"@plone-collective/volto-techevent": "1.0.0-alpha.18",
"@plone-collective/volto-techevent": "1.0.0-alpha.19",
"@kitconcept/volto-light-theme": "7.0.0-alpha.22",
"@kitconcept/volto-social-blocks": "1.0.0-alpha.8",
"@mbarde/volto-image-crop-widget": "0.5.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@import 'blocks/listing';
@import 'blocks/search';
@import 'blocks/slider';
@import 'blocks/schedule';
@import 'blocks/chamada';
@import 'blocks/image';
@import 'blocks/block_sponsorlevel';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
--link-color: var(--text-color);
--link-foreground-color: var(--link-color);

--background-color: #c3c8ca;
--background-color: #d3d8da;

// Components
--social-network-icon-color-main: var(--secondary-color);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#main .schedule {
.timeslot {
&.rows-10 .sessionTile {
min-height: 30rem * 0.75;
}
&.rows-12 .sessionTile {
min-height: 30rem * 0.75;
}
&.rows-14 .sessionTile {
min-height: 30rem * 0.75;
}
}
}
10 changes: 5 additions & 5 deletions frontend/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading