class Pettanr.Story extends Peta.Binder\r
- @single: () ->\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
+ is_visible: (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
initialize: () ->\r
- confirm("Welcome to Panel")\r
+ if @id\r
+ @url = @url + @id\r
\r
-\r
+class Pettanr.Story.Collection extends Backbone.Collection\r
+ model: Pettanr.Story\r
+ url: '/stories'\r