1 class Pettanr.Views.PanelPicture.ShowModule
\r
2 class Pettanr.Views.PanelPicture.ShowModule.Header extends Pettanr.Views.Show.Header
\r
4 initialize: (options) ->
\r
7 class Pettanr.Views.PanelPicture.Show extends Pettanr.View
\r
11 initialize: (options) ->
\r
12 @item = options.item
\r
13 icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')})
\r
14 caption_url = icon_url
\r
15 prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'})
\r
16 @header = new Pettanr.Views.PanelPicture.ShowModule.Header({
\r
18 caption: @item.get('caption'),
\r
20 caption_url: caption_url,
\r
23 @listenTo(this, 'ready', @ready)
\r
24 @item.get_parent('panel', this, {
\r
26 @panel = item.with_elements()
\r
27 @panel.fetch().done =>
\r
28 @panel.attributes = @panel.replaced_attributes()
\r
29 @author = new Pettanr.Views.Show.HeaderAuthor({item: @panel})
\r
30 @body = new Pettanr.Views.Panel.Body({
\r
34 @credits = new Pettanr.Views.Common.Credits({
\r
37 @listenTo(@header, 'click:pick', @click_pick)
\r
38 @listenTo(@header, 'click:icon', @click_show)
\r
39 @listenTo(@header, 'click:caption', @click_show)
\r
40 @listenTo(@header, 'click:prof', @click_prof)
\r
41 @listenTo(@author, 'click:author', @click_author)
\r
42 @listenTo(@credits, 'click:credit:icon', @click_credit_icon)
\r
52 this.$el.append(@header.render().el)
\r
53 this.$el.append(@author.render().el)
\r
54 this.$el.append(@body.render().el)
\r
55 this.$el.append(@credits.render().el)
\r
57 @credits.push(@panel.licensed_pictures())
\r
61 @trigger('http_get', @item.show_url())
\r
64 @trigger('http_get', @panel.author().show_url())
\r
67 @trigger('http_get', @item.prof_url())
\r
69 click_credit_icon: (item) ->
\r
70 @trigger('http_get', item.show_url())
\r
73 @trigger('pick', @item)
\r
78 add_pick: (target_model) ->
\r
79 @header.add_pick(target_model)
\r