class Pettanr.View.Summary.Leaf extends Pettanr.View.Summary initialize: (options) -> super(options) @binder = new Pettanr.View.Summary.Leaf.Binder(@item, @context) @destination = new Pettanr.View.Summary.Leaf.Destination(@item, @context) render: () -> super() this.$el.html('') this.$el.append(@binder.render().el) this.$el.append(@destination.render().el) this http_get: (url) -> @trigger('http_get', url) class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View tagName: 'span' constructor: (@item, @context, options) -> @binder_model = @item.my_class().binder_model() super(options) initialize: (options) -> super(options) render: () -> super() this.$el.html('') @item.get_parent(@binder_model.item_name(), this, { success: (@binder) => @face_button = @binder.mini_face_button({ context: @context, click: () => @trigger('http_get', @binder.show_url()) }) this.$el.append(@face_button.render().el) @binder.get_parent('author', this, { success: (@author) => @author_faced_label_button = @author.mini_faced_label_button({ shorten: true }, { context: @context, click: () => @trigger('http_get', @author.show_url()) }) this.$el.append(@author_faced_label_button.render().el) fail: (response, opt) => author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({ }) this.$el.append(author_faced_label_error.render().el) }) fail: (response, opt) => this.$el.append(I18n.t('yasapp.unresolved')) }) this class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View tagName: 'span' constructor: (@item, @context, options) -> @destination_model = @item.my_class().destination_model() super(options) initialize: (options) -> super(options) render: () -> super() this.$el.html('') @item.get_parent(@destination_model.item_name(), this, { success: (@destination) => @face_button = @destination.mini_face_button({ context: @context, click: () => @trigger('http_get', @binder.show_url()) }) this.$el.append(@face_button.render().el) @destination.get_parent('author', this, { success: (@author) => @author_faced_label_button = @author.mini_faced_label_button({ shorten: true }, { context: @context, click: () => @trigger('http_get', @author.show_url()) }) this.$el.append(@author_faced_label_button.render().el) fail: (response, opt) => author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({ }) this.$el.append(author_faced_label_error.render().el) }) fail: (response, opt) => this.$el.append(I18n.t('yasapp.unresolved')) }) this