marmelab/ng-admin — pull request #104 by fzaninotto (2014-11-12 10:04:58+00:00)
Title: [RFR] Add views 

Supersedes #76 and #100

- [x] Add view entities
- [x] Allows views entities inheritance
- [x] Update `CrudManager`
- [x] Update `dashboard`
- [x] Update list view
- [x] Update `Reference`, `ReferenceMany`
- [x] Update create / update view
- [x] Update ReferencedList view
- [x] Update deletion view
- [x] Update tests
- [x] Rebase
- [x] Update `sortParams`, `headers`, `validation / validator`, `filterParams`, ``
- [x] Update doc
- [x] Write migration doc
- [x] Find a way to not clone all the `View` for each entries in the `ListView`

Example:
```js
var tag = new Entity('tags')
.label('Tags')
.order(3)
.addView(new DashboardView('tag-dashboard')
.order(1)
.limit(10)
.label('Recent tags')
.addField(new Field('name').label('Name').type('string'))
.addField(new Field('published').label('Published').type('boolean'))
).addView(new ListView('tags-list')
.title('List of all tags')
.pagination(pagination)
.infinitePagination(false)
.addAction(new Action('new-tag').label('Add tag').redirect('tags-create'))
.addField(new Field('name').label('Name').type('string'))
.addField(new Field('published').label('Published').type('boolean'))
.addField(new Field('actions')
.type('callback')
.list(true)
.label('Test')
.isEditLink(false)
.callback(function() {
return '{{ entity.getField("name").value.toUpperCase() }}';
})
)
).addView(new FormView('tags-create')
.addField(new Field('name')
.label('Name')
.type('string')
.validation({
"required": true,
"max-length" : 150
})
)
.addField(new Field('published').label('Published').type('boolean'))
).addView(new FormView('tags_edit')
.addAction(new Action('delete-tag').label('Delete tag').redirect('tags-delete'))
.addField(new Field('name').label('Name').type('string').editable(false))
.addField(new Field('published').label('Published').type('boolean'))
).addView(new DeleteView('tags-delete')
.addField(new Field('name').label('Name').type('string').editable(false))
.addField(new Field('published').label('Published').type('boolean'))
);
```