-class Story extends Item\r
- @single: () ->\r
+class Pettanr.Story extends Peta.Binder\r
+ \r
+ @singular: () ->\r
'Story'\r
\r
@plural: () ->\r
'Stories'\r
\r
defaults: {\r
- id: 11\r
+ id: null,\r
+ visible: 0,\r
+ author_id: null\r
} \r
\r
- initialize: () ->\r
- confirm("Welcome to Panel")\r
+ overwrite: (options) ->\r
+ operators = Pettanr.cache.operators\r
+ return false if not operators.author\r
+ @set('author_id', operators.author.id)\r
+ \r
+ is_visible: (operators = Pettanr.cache.operators) ->\r
+ switch super(operators)\r
+ when null\r
+ return true\r
+ when false\r
+ return false\r
+ else\r
+ @get('visible') > 0\r
\r
- @test: () ->\r
- confirm( @single())\r
- confirm( @plural() )\r
- confirm( @class_name() )\r
- confirm( @element_name() )\r
- confirm( @table_name() )\r
- \r
+ initialize: (attr = {}, options = {}) ->\r
+ super(attr, options)\r
\r
- test: () ->\r
-\r
-@Panel = Panel\r