class Pettanr.Sheet extends Peta.Root @singular: () -> 'Sheet' @plural: () -> 'Sheets' defaults: { id: null, visible: 0, author_id: null } overwrite: (options) -> operators = Pettanr.cache.operators return false if not operators.author @set('author_id', operators.author.id) is_visible: (operators = Pettanr.cache.operators) -> switch super(operators) when null return true when false return false else @get('visible') > 0 label: (shorten_length) -> @_label('title', shorten_length) # item is root, but binder like play_url: () -> Pettanr.url(@table_name(), 'play', {id: @get('id')}) initialize: (attr = {}, options = {}) -> super(attr, options)