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('original_picture', this, {
\r
16 success: (@original_picture) =>
\r
17 @owner = new Pettanr.View.Show.Footer(null, this, {
\r
20 item: @original_picture,
\r
21 url: @original_picture.edit_url(),
\r
22 dic_name: 'original_pictures.show.replace',
\r
24 @trigger('http_get', @original_picture.edit_url())
\r
27 item: @original_picture,
\r
28 url: @original_picture.show_url(),
\r
29 dic_name: 'original_pictures.show.title',
\r
31 @trigger('http_get', @original_picture.show_url())
\r
35 url: @item.destroy_url(),
\r
36 dic_name: 'original_pictures.index.stop',
\r
39 @trigger('http_get', url)
\r
40 Pettanr.Proxy.destroy(@item, {redirect: redirect})
\r
44 @item.get_parent('picture', this, {
\r
45 success: (picture) =>
\r
46 @add_credit(picture)
\r
47 this.$el.append(@owner.render().el)
\r
53 @trigger('pick', @item)
\r
58 add_pick: (target_model) ->
\r
59 @header.add_pick(target_model)
\r