OSDN Git Service

v07
[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_faced_label_button = @author.mini_faced_label_button({\r
18             shorten: true\r
19           }, {\r
20             context: @context,\r
21             click: () =>\r
22               @trigger('http_get', @author.show_url())\r
23         })\r
24         this.$el.html('')\r
25         this.$el.append(@visible.render().el)\r
26         this.$el.append(@author_faced_label_button.render().el)\r
27     })\r
28     this\r
29   \r