ic-labs / django-icekit

GLAMkit is a next-generation Python CMS by the Interaction Consortium, designed especially for the cultural sector.
http://glamkit.com
MIT License
47 stars 11 forks source link

As a GLAMkit user I can attach locations to events #261

Open jmurty opened 7 years ago

jmurty commented 7 years ago

Make it possible to link events to a location.

Base this on the SFMOMA Location model. It should have a boolean for whether the location is a home venue (ie at AGSA/SFMOMA, default False), but generalised for GLAMkit.

I think it needs to have fluent content, and optional fields for public address, phone number, URL, email and email CTA (default = "email")

Locations should also have a landing page (via get_absolute_url) that lists information about the location, plus any upcoming visible events at that location. Do an unstyled version first.

markfinger commented 7 years ago

@jmurty this seems to work well enough for our purposes in Tarnanthi.

The only change I'd consider is pushing the events down to the context of the location detail page, rather than the occurrences.

In most cases a location's detail should have links to the related event detail pages. When we've only got the occurrences, we need to iterate over all of them and pluck out the event fk, then render its data. This became a pain-point as we had a template that assumed an iterable of events was available.

jmurty commented 7 years ago

That's a good point @markfinger. I think we need a general way in GLAMkit to convert a set of occurrences (actual lower-case events that are upcoming) to the corresponding Event objects where we don't want to display full details.

That is, for situations where we just link to the related Events in general with few details, but we do still want to list those events in the order they will happen (for which info we need to start from occurrences)

We probably need both a basic utility function, and a template tag, to convert a set of Occurrences to the corresponding de-duplicated Events as efficiently as possible