OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / views / panels / summary.js.coffee
1 class Pettanr.Views.Panel.Summary extends Backbone.View\r
2   \r
3   initialize: (options) ->\r
4     @item = options.item\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     @visible = new Tag.Div({\r
10       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
11     })\r
12     _this = this\r
13     @author = @item.author()\r
14     @author.fetch({cache: true}).done ->\r
15       _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
16       _this.render()\r
17   \r
18   render: () ->\r
19     this.$el.html('')\r
20     this.$el.append(@visible.render().el)\r
21     if @author_icon_with_caption\r
22       this.$el.append(@author_icon_with_caption.render().el)\r
23     this\r
24   \r