OSDN Git Service

fix: views
[pettanr/pettanr.git] / app / assets / javascripts / views / panels / summary.js.coffee
index 8153d4a..df70600 100644 (file)
@@ -2,27 +2,26 @@ class Pettanr.Views.Panel.Summary extends Pettanr.View.Summary
   \r
   initialize: (options) ->\r
     super(options)\r
-    @item = options.item\r
     options['visible_t'] = 'panel_publish_items'\r
     options['visible_column_name'] = 'publish'\r
     @visible_t = options.visible_t\r
     @visible_column_name = options.visible_column_name\r
+  \r
+  render: () ->\r
+    super()\r
     @item.get_parent('author', this, {\r
       success: (@author) =>\r
         @visible = new Tag.Div({\r
           content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
         })\r
-        @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
-        @listenTo(@author_icon_with_caption, 'click', @author_click)\r
-        @trigger('ready')\r
+        @author_mini_faced_label = @author.mini_faced_label({\r
+          context: @context,\r
+          click: () =>\r
+            @trigger('http_get', @author.show_url())\r
+        })\r
+        this.$el.html('')\r
+        this.$el.append(@visible.render().el)\r
+        this.$el.append(@author_mini_faced_label.render().el)\r
     })\r
-  \r
-  render: () ->\r
-    this.$el.html('')\r
-    this.$el.append(@visible.render().el)\r
-    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
-  author_click: () ->\r
-    @trigger('http_get', @author_icon_with_caption.url())\r
-  \r