OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / view / show / header / authored_by.js.coffee
1 class Pettanr.View.Show.AuthoredBy extends Pettanr.View\r
2   tagName: 'div'\r
3   \r
4   constructor: (@content, options) ->\r
5     super(options)\r
6   \r
7   initialize: (@options = {}) ->\r
8   \r
9   render: () ->\r
10     this.$el.html('')\r
11     author_item_name = @content.my_class().owner_type()\r
12     @content.get_parent(author_item_name, this, {\r
13       success: (author) =>  # author or artist\r
14         label_button = author.label_button({\r
15           context: this,\r
16           click: () =>\r
17             @trigger('click', author)\r
18         })\r
19         this.$el.append(Pettanr.AppHelper.t_a(@content.item_name(), @content.my_class().owner_column()))\r
20         this.$el.append(label_button.render().el)\r
21     })\r
22     this\r
23   \r