OSDN Git Service

add: oplg dialog
[pettanr/pettanr.git] / app / assets / javascripts / models / author.js.coffee
index 80d12c9..eab6899 100644 (file)
@@ -1,25 +1,24 @@
-class Author extends Item\r
-  @single: () ->\r
+class Pettanr.Author extends Peta.Owner\r
+  url: '/authors/'\r
+  \r
+  @singular: () ->\r
     'Author'\r
   \r
   @plural: () ->\r
     'Authors'\r
   \r
   defaults: {\r
-    id: 11\r
+    id: null,\r
+    name: 'no name'\r
   } \r
   \r
-  initialize: () ->\r
-    confirm("Welcome to Panel")\r
+  overwrite: (options) ->\r
+  \r
+  icon_with_caption_view: (half = true, column_name = 'name', length = 12) ->\r
+    new Pettanr.Views.Common.IconWithCaption({item: this, half: half, column_name: column_name, length: length})\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
+    if @id\r
+      @url = @url + @id\r
   \r
-  test: () ->\r
-\r
-@Panel = Panel\r