Conversation
This should be a no-op
apps/schedule/frab_exporter.py
Outdated
| VERSION = "1.0-public" | ||
|
|
||
| TRACK_COLOURS = { | ||
| slug: f"#{md5(human_readable.encode('utf-8')).hexdigest()[:6]}" |
There was a problem hiding this comment.
We could improve this by explicitely setting colours here for each proposal type, but i feel this is good enough(tm) for now.
There was a problem hiding this comment.
I wonder if it would be better to just have a constant list of a nice palette of suitably distinct colors and pick from that in alphabetical order of the slug, hashing as a backup if we have more than in the list? Given the number of CFP types is (fairly) fixed and small, and distinctiveness of the colors from each other is the main point of having them?
There was a problem hiding this comment.
Yeah, after testing this (see mattermost ~video-infobeamer) i've noticed that "youth workshop" and "talk" are awfully similar. Should i just grab 2024s colours off info-beamer?
There was a problem hiding this comment.
Perhaps - I can't remember if they were manually set or not! I don't think the exact colors really matter at all, we don't (afaik) have color schemes for types of content. so i'd be inclined to just grab a suitably contrasting palette from anywhere and use that
There was a problem hiding this comment.
They were! I imported them for now.
e8b3908 to
96c567f
Compare
78d33de to
83aaa88
Compare
|
A lot of this code was rewritten as part of the content refactor. In particular, we now have recurring schedule items so a workshop might have multiple start times and venues. I'm going to convert this to draft and make it match after the content refactor lands, which should be in the next few days. |
|
@marksteward oh, i thought the CfP refactor was already done, otherwise i would not have created the PR (and instead waited for the refactor to finish). Sorry about that. |
|
filtering based on village_id doesn't seem to work, other than that i don't see any remaining bugs or features i'd like to have. |
|
@Kunsi not a problem, I'm happy to do the required changes for this too, but probably not before the refactor has landed. |
|
Random thought that floats around in my head: if events happen multiple times AND they shall be recorded, we need different slugs and different GUIDs for them. |
|
Yep, the way I'm doing it to work with Frab is I flatten the hierarchy so instead of a single ScheduleItem with multiple Occurrences, we get multiple ScheduleItems each with one. The slug and GUID are then generated using the (I've also changed the GUID logic to not look at our slugs, because those depend on the title of the schedule item so can change.) |
| { | ||
| "name": room.name, | ||
| "capacity": room.capacity, | ||
| # TODO do we have an URL for listing the schedule in a specific room? |
There was a problem hiding this comment.
I didn't find anything in the source code, please let me know if i missed anything.
wlcx
left a comment
There was a problem hiding this comment.
I'm not at all spooled up on the recent website changes so not the best placed to do an in-depth review, but I think this is a reasonable thing for us to have :)
apps/schedule/frab_exporter.py
Outdated
| VERSION = "1.0-public" | ||
|
|
||
| TRACK_COLOURS = { | ||
| slug: f"#{md5(human_readable.encode('utf-8')).hexdigest()[:6]}" |
There was a problem hiding this comment.
I wonder if it would be better to just have a constant list of a nice palette of suitably distinct colors and pick from that in alphabetical order of the slug, hashing as a backup if we have more than in the list? Given the number of CFP types is (fairly) fixed and small, and distinctiveness of the colors from each other is the main point of having them?
|
Lol, github just straight up.. didn't show me your discussion before I hit submit on the review? |
|
On the topic of slugs, what are they actually used for downstream of us? Does something generate URLs with them, and are they expected to unique for each occurrence of an event? |
Yes, atleast media.ccc.de uses them for generating URLs for the released videos. I'm not aware of anything else off the top of my head
Yes, the spec even enforces that: https://github.com/voc/schedule/blob/master/validator/xsd/schedule.xml.xsd#L86-L89 (also ID and GUID need to be unique) Theoretically we could drop the ID from the slug (it's not required, just often included to ensure it is unique). |
|
I was actually wondering if we need to drop the title from the slug. If the title of a schedule item changes, is it OK for the slug to change too? Will that mess up any existing pages or files on c3voc's side? I'm going to distinguish our ScheduleItem Occurrence (Our slug isn't required to start with a letter) Event There's a note about id on the schema: Our Occurrences are pretalx's Slots. |
Yes, that's the plan. The slug should always match the title to avoid confusion.
Yeah, and it always messes up everything when that happens, so it's advised to have them unique. What i'd probably do is do something like What you proposed re |
|
I can't easily omit I'll use |
yeah, i can see this would be confusing
In case this wasn't clear, we only have to do this for the |
The XML says they can be duplicated: https://github.com/voc/schedule/blob/b45ae10/validator/xsd/schedule.xml.xsd#L144 But apparently that's not true: #1909 (comment)
The XML says they can be duplicated: https://github.com/voc/schedule/blob/b45ae10/validator/xsd/schedule.xml.xsd#L144 But apparently that's not true: #1909 (comment)
|
I've rebased this onto the CfP refactor at #1909, and added a FrabExporterFilter to keep that bit more type-friendly. Given this code already uses the DB classes, I wonder if we should pull data directly from the models instead of relying on the schedule/data.py stuff? |
|
The Frab schema says slug must match |
The XML says they can be duplicated: https://github.com/voc/schedule/blob/b45ae10/validator/xsd/schedule.xml.xsd#L144 But apparently that's not true: #1909 (comment)
Hyphen is in the second character class? |
|
Thank you, fixed! |
The XML says they can be duplicated: https://github.com/voc/schedule/blob/b45ae10/validator/xsd/schedule.xml.xsd#L144 But apparently that's not true: #1909 (comment)
|
Rebased and merged as 9395d38 |
frab_exporters.pyFrabExporterDid i miss anything?