Panel helpers

Opal comes with a selection of templatetags for rendering Opal panels for a given subrecord. These panels also allow the user to see instances of the model against the current value of episode in Angular $scope. The user can also create new instances of the given model, as well as editing any existing ones.

{% record_panel ... %}

Render a panel for a given record that will allow the user to view, create, update and delete instances.

The record panel template expects the relevant Angular $scope to have newNamedItem(name, index), editNamedItem(name, index) and deleteItem(name, index) methods implemented. Default implementations of these are available from the EpisodeDetailMixin.

{% load panels %}
{% record_panel Diagnosis %}


{% record_timeline ... %}

Similar to record_panel, record_timeline renders a penel for a given record as a timeline - particularly useful for subrecord types where the date is a key field.

{% load panels %}
{% record_panel Diagnosis 'when' %}


{% aligned_pair ... %}

Render a key value pair in their own Bootstrap row using columns of width md-4 each. Particularly useful for occasions when we have multiple entries that need to be presented one after another but the data is not naturally tabular.

{% load panels %}
{% aligned_pair model="episode.start_date | shortDate" label="Start Date" %}
{% aligned_pair model="22" label="Next Data Point" %}