1 class Pettanr.View.Summary.Leaf extends Pettanr.View.Summary
\r
3 initialize: (options) ->
\r
5 @binder = new Pettanr.View.Summary.Leaf.Binder(@item, @context)
\r
6 @destination = new Pettanr.View.Summary.Leaf.Destination(@item, @context)
\r
11 this.$el.append(@binder.render().el)
\r
12 this.$el.append(@destination.render().el)
\r
16 @trigger('http_get', url)
\r
18 class Pettanr.View.Summary.Leaf.Binder extends Pettanr.View
\r
21 constructor: (@item, @context, options) ->
\r
22 @binder_model = @item.my_class().binder_model()
\r
25 initialize: (options) ->
\r
31 @item.get_parent(@binder_model.item_name(), this, {
\r
32 success: (@binder) =>
\r
33 @face_button = @binder.mini_face_button({
\r
36 @trigger('http_get', @binder.show_url())
\r
38 this.$el.append(@face_button.render().el)
\r
39 @binder.get_parent('author', this, {
\r
40 success: (@author) =>
\r
41 @author_faced_label_button = @author.mini_faced_label_button({
\r
46 @trigger('http_get', @author.show_url())
\r
48 this.$el.append(@author_faced_label_button.render().el)
\r
49 fail: (response, opt) =>
\r
50 author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({
\r
52 this.$el.append(author_faced_label_error.render().el)
\r
54 fail: (response, opt) =>
\r
55 this.$el.append(I18n.t('yasapp.unresolved'))
\r
59 class Pettanr.View.Summary.Leaf.Destination extends Pettanr.View
\r
62 constructor: (@item, @context, options) ->
\r
63 @destination_model = @item.my_class().destination_model()
\r
66 initialize: (options) ->
\r
72 @item.get_parent(@destination_model.item_name(), this, {
\r
73 success: (@destination) =>
\r
74 @face_button = @destination.mini_face_button({
\r
77 @trigger('http_get', @binder.show_url())
\r
79 this.$el.append(@face_button.render().el)
\r
80 @destination.get_parent('author', this, {
\r
81 success: (@author) =>
\r
82 @author_faced_label_button = @author.mini_faced_label_button({
\r
87 @trigger('http_get', @author.show_url())
\r
89 this.$el.append(@author_faced_label_button.render().el)
\r
90 fail: (response, opt) =>
\r
91 author_faced_label_error = new Pettanr.View.MiniFacedLabelButton.Error({
\r
93 this.$el.append(author_faced_label_error.render().el)
\r
95 fail: (response, opt) =>
\r
96 this.$el.append(I18n.t('yasapp.unresolved'))
\r