OSDN Git Service

df7060053ec38738d56d27e7e570d482ce740281
[pettanr/pettanr.git] / app / assets / javascripts / views / panels / summary.js.coffee
1 class Pettanr.Views.Panel.Summary extends Pettanr.View.Summary\r
2   \r
3   initialize: (options) ->\r
4     super(options)\r
5     options['visible_t'] = 'panel_publish_items'\r
6     options['visible_column_name'] = 'publish'\r
7     @visible_t = options.visible_t\r
8     @visible_column_name = options.visible_column_name\r
9   \r
10   render: () ->\r
11     super()\r
12     @item.get_parent('author', this, {\r
13       success: (@author) =>\r
14         @visible = new Tag.Div({\r
15           content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
16         })\r
17         @author_mini_faced_label = @author.mini_faced_label({\r
18           context: @context,\r
19           click: () =>\r
20             @trigger('http_get', @author.show_url())\r
21         })\r
22         this.$el.html('')\r
23         this.$el.append(@visible.render().el)\r
24         this.$el.append(@author_mini_faced_label.render().el)\r
25     })\r
26     this\r
27   \r