We begin with some sub-macros used within
macro "showReference" defined below.Displays the title of a referenced object, with a link on
it to reach the consult view for this object. If we are on a back reference, the link
allows to reach the correct page where the forward reference is defined.Displays icons for triggering actions on a given
referenced object (edit, delete, etc).
Edit the element
Delete the element
Arrows for moving objects up or down
Displays the "plus" icon that allows to add new object
through a reference widget. Indeed, If field was declared as "addable", we must provide
an icon for creating a new linked object (at least if multiplicities allow it).
This macro displays the Reference widget on a "consult" page.
The definition of "atMostOneRef" above may sound strange: we shouldn't check the actual number
of referenced objects. But for back references people often forget to specify multiplicities.
So concretely, multiplicities (0,None) are coded as (0,1).Display a simplified widget if maximum number of
referenced objects is 1.
If there is no object...
no_ref
If there is an object...
Display a fieldset in all other cases.A carriage return needed in some cases.
This macro displays the Reference widget on an "edit" page