NASA-IMPACT / admg-backend

Apache License 2.0
2 stars 0 forks source link

Display a link back to the parent campaign for related models #590

Closed edkeeble closed 9 months ago

edkeeble commented 9 months ago

When rendering the canonical views for models related to campaigns (IOP, CollectionPeriod, Deployment, SignificantEvent), display a link back to the related campaign, rather than a link to the list view for the model.

I've implemented this by creating a new mixin class for models which are related to campaigns by way of a deployment as well as a ContextMixin view which allows us to quickly check if the model to be displayed belongs to a campaign and attach that campaign to the context. If a campaign exists on the context, we render a link back to it. Pretty simple.