OSDN Git Service

fix: scenario
[pettanr/pettanr.git] / app / assets / javascripts / views / original_pictures / summary.js.coffee
1 class Pettanr.Views.OriginalPicture.Summary extends Pettanr.View.Summary\r
2   className: 'op-smy'\r
3   \r
4   initialize: (options) ->\r
5     super(options)\r
6   \r
7   render: () ->\r
8     super()\r
9     @visible = new Tag.Span({\r
10       class_name: 'state',\r
11       content: I18n.t('original_pictures.' + @item.state())\r
12     })\r
13     this.$el.html('')\r
14     this.$el.append(@visible.render().el)\r
15     @item.get_child('resource_picture', this, {\r
16       success: (@resource_picture) =>\r
17         if @resource_picture\r
18           @resource_picture.get_parent('picture', this, {\r
19             success: (@picture) =>\r
20               @credit = new Pettanr.View.Credit(@picture, {icon: false})\r
21               this.$el.append(@credit.render().el)\r
22               @append_rb()\r
23           })\r
24     })\r
25     this\r
26   \r