withassociates/slices — pull request #16 by jgwhite (2014-04-14 16:18:56+00:00)
Title: Add custom entry template mechanism

Adds the ability to register custom templates for rows on the entries listing for set pages.

```rb
# app/slices/foo_set/foo_presenter.rb
class FooPresenter < PagePresenter
def self.columns
{
name: 'Name',
view: 'View'
}
end

def name
@source.name
end

def view
@source.path
end
end
```

```js
// app/assets/javascripts/admin.js
slices.registerEntryTemplate('view', function(key) {
return '	External link';
});
```

This implementation depends on `key` being unique across the various sets an app may use. If necessary we could look at hierarchical namespacing i.e.

```js
slices.registerEntryTemplate('view', function(key) {
return '	External link';
});

slices.registerEntryTemplate('foo:view', function(key) {
return '	External link';
});

slices.registerEntryTemplate('bar:view', function(key) {
return '	External link';
});
```

Where entry templates for the `view` field would use `foo:view` in the `Foo` set, `bar:view` in the `Bar` set and `view` otherwise.