smebberson/linz — pull request #26 by sandytrinh (2014-06-06 00:30:34+00:00)
Title: Formtool overview configurations

This PR added support for configuring the display for the overview screen for a model. The DSL is as followed:

```
overview: {
canEdit: false,
canDelete: true,
viewAll: false,
actions: [
{
action: 'url/slug',
label: 'Custom action LA'
}
],
summary: {
label: 'Quick overview',
fields: {
createdBy: {
label: 'Created by',
renderer: linz.formtools.cellRenderers.reference
},
modifiedBy: {
label: 'Modified by',
renderer: linz.formtools.cellRenderers.reference
},
dateCreated: {
label: 'Date created',
renderer: linz.formtools.cellRenderers.date
},
dateModified: {
label: 'Date modified',
renderer: linz.formtools.cellRenderers.date
},
}
},
body: function (record, model, callback) {
return callback(null, '

This is the body...

')
}
}
```

``` overview.summary``` accepts a label, fields or renderer. When fields is provided, Linz automatically renders the specified fields, otherwise it will render the content provided by the customer summary renderer function.

```overview.body``` are not defined by default in Linz, however, you can supply a function that renders the content for the body section of the overview screen.

@smebberson this PR is ready for review.