X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fview%2Fshow%2Fheader%2Fauthored_by.js.coffee;h=f769180f35c16c2870f1342ea60522c269f960e2;hp=376c5f250b79131337a40abad2a69618422700c6;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=2ad2de8db58dac6a0e81f1db91a1a8415b2b9de7 diff --git a/app/assets/javascripts/view/show/header/authored_by.js.coffee b/app/assets/javascripts/view/show/header/authored_by.js.coffee index 376c5f25..f769180f 100644 --- a/app/assets/javascripts/view/show/header/authored_by.js.coffee +++ b/app/assets/javascripts/view/show/header/authored_by.js.coffee @@ -1,23 +1,30 @@ +# options: { +# label: { label_options ... } +# button: { button_options ... } +# } class Pettanr.View.Show.AuthoredBy extends Pettanr.View tagName: 'div' constructor: (@content, options) -> super(options) - initialize: (@options = {}) -> + initialize: (options = {}) -> + @label_options = options.label || {shorten: false} render: () -> this.$el.html('') + this.$el.append(Pettanr.AppHelper.t_a(@content.item_name(), @content.my_class().owner_column())) author_item_name = @content.my_class().owner_type() @content.get_parent(author_item_name, this, { success: (author) => # author or artist - label_button = author.label_button({ + label_button = author.label_button(@label_options, { context: this, click: () => @trigger('click', author) }) - this.$el.append(Pettanr.AppHelper.t_a(@content.item_name(), @content.my_class().owner_column())) this.$el.append(label_button.render().el) + fail: (response, opt) => + this.$el.append(I18n.t('yasapp.unresolved')) }) this