class Pettanr.Views.Sheet.ShowModule class Pettanr.Views.Sheet.ShowModule.Header extends Pettanr.Views.Show.Header initialize: (options) -> super(options) class Pettanr.Views.Sheet.ShowModule.Owner extends Pettanr.Views.Show.Owner initialize: (options) -> super(options) class Pettanr.Views.Sheet.Show extends Backbone.View tagName: 'div' className: 'show' initialize: (options) -> @item = options.item icon_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id')}) caption_url = Pettanr.url(@item.table_name(), 'play', {id: @item.get('id')}) prof_url = Pettanr.url(@item.table_name(), 'show', {id: @item.get('id'), format: 'prof'}) @header = new Pettanr.Views.Sheet.ShowModule.Header({ item: @item, caption: @item.get('caption'), icon_url: icon_url, caption_url: caption_url, prof_url: prof_url }) @author = new Pettanr.Views.Show.HeaderAuthor({item: @item}) @owner = new Pettanr.Views.Sheet.ShowModule.Owner({item: @item}) @listenTo(@header, 'click:pick', @click_pick) render: () -> this.$el.html('') this.$el.append(@header.render().el) this.$el.append(@author.render().el) this.$el.append(@owner.render().el) if @item.is_own() this click_pick: () -> @trigger('pick', @item) is_pickable: () -> true add_pick: (target_model) -> @header.add_pick(target_model)