OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / views / speech_balloons / summary.js.coffee
index 2367602..f39000a 100644 (file)
@@ -1,10 +1,30 @@
-class Pettanr.Views.SpeechBalloon.Summary extends Backbone.View\r
+class Pettanr.Views.SpeechBalloon.Summary extends Pettanr.Views.Common.Summary\r
   \r
   initialize: (options) ->\r
     super(options)\r
+    @item = options.item\r
+    @load()\r
+  \r
+  load: () ->\r
+    panel = @item.panel()\r
+    panel.fetch({cache: true}).done =>\r
+      @panel_icon = new Pettanr.Views.Common.Icon({item: panel, half: true})\r
+      @listenTo(@panel_icon, 'click', @panel_click)\r
+      author = panel.author()\r
+      author.fetch({cache: true}).done =>\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
   \r
   render: () ->\r
     this.$el.html('')\r
-    this.$el.append('-')\r
+    this.$el.append(@panel_icon.render().el)\r
+    this.$el.append(@author_icon_with_caption.render().el)\r
     this\r
   \r
+  panel_click: () ->\r
+    @trigger('http_get', @panel_icon.url())\r
+  \r
+  author_click: () ->\r
+    @trigger('http_get', @author_icon_with_caption.url())\r
+  \r