1 class Pettanr.Views.ResourcePicture.Show extends Pettanr.View.Show
\r
3 initialize: (options) ->
\r
4 @header = new Pettanr.View.Show.Header(@item, this, @default_header_options())
\r
5 @authored_by = @item.authored_by()
\r
6 @img = @item.real_picture('full')
\r
7 @listenTo(@header, 'click:pick', @click_pick)
\r
8 @listenTo(@authored_by, 'click', @click_authored_by)
\r
12 this.$el.append(@header.render().el)
\r
13 this.$el.append(@authored_by.render().el)
\r
14 this.$el.append(@img.render().el)
\r
15 @item.get_parent('picture', this, {
\r
16 success: (picture) =>
\r
17 @add_credit(picture)
\r
20 @item.get_parent('original_picture', this, {
\r
21 success: (@original_picture) =>
\r
22 @owner = new Pettanr.View.Show.Footer(null, this, {
\r
25 item: @original_picture,
\r
26 url: @original_picture.edit_url(),
\r
27 dic_name: 'original_pictures.show.replace',
\r
29 @trigger('http_get', @original_picture.edit_url())
\r
32 item: @original_picture,
\r
33 url: @original_picture.show_url(),
\r
34 dic_name: 'original_pictures.show.title',
\r
36 @trigger('http_get', @original_picture.show_url())
\r
40 url: @item.destroy_url(),
\r
41 dic_name: 'original_pictures.index.stop',
\r
44 @trigger('http_get', url)
\r
45 Pettanr.Proxy.destroy(@item, {redirect: redirect})
\r
49 this.$el.append(@owner.render().el)
\r
54 @trigger('pick', @item)
\r
59 add_pick: (target_model) ->
\r
60 @header.add_pick(target_model)
\r