OSDN Git Service

fix:play pager
[pettanr/pettanr.git] / app / assets / javascripts / views / panels / summary.js.coffee
1 class Pettanr.Views.Panel.Summary extends Pettanr.Views.Common.Summary\r
2   \r
3   initialize: (options) ->\r
4     super(options)\r
5     @item = options.item\r
6     options['visible_t'] = 'panel_publish_items'\r
7     options['visible_column_name'] = 'publish'\r
8     @visible_t = options.visible_t\r
9     @visible_column_name = options.visible_column_name\r
10     retriever = @item.author()\r
11     @listenTo(retriever, 'retrieve', @retrieve_author)\r
12     retriever.retrieve()\r
13   \r
14   retrieve_author: (@author) ->\r
15     @visible = new Tag.Div({\r
16       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
17     })\r
18     @author_icon_with_caption = @author.icon_with_caption_view(true, 'name', 12)\r
19     @listenTo(@author_icon_with_caption, 'click', @author_click)\r
20     @trigger('ready')\r
21   \r
22   render: () ->\r
23     this.$el.html('')\r
24     this.$el.append(@visible.render().el)\r
25     this.$el.append(@author_icon_with_caption.render().el)\r
26     this\r
27   \r
28   author_click: () ->\r
29     @trigger('http_get', @author_icon_with_caption.url())\r
30   \r