OSDN Git Service

fix sign in header
[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 = new Tag.Div({\r
8       content: Pettanr.AppHelper.t_selected_item(@visible_t, @item.get(@visible_column_name))\r
9     })\r
10     _this = this\r
11     @author = @item.author()\r
12     @author.fetch({cache: true}).done ->\r
13       _this.author_icon_with_caption = _this.author.icon_with_caption_view(true, 'name', 12)\r
14       _this.render()\r
15   \r
16   render: () ->\r
17     this.$el.html('')\r
18     this.$el.append(@visible.render().el)\r
19     if @author_icon_with_caption\r
20       this.$el.append(@author_icon_with_caption.render().el)\r
21     this\r
22   \r