class Pettanr.Views.Scroll.ShowModule class Pettanr.Views.Scroll.ShowModule.Header extends Pettanr.Views.Show.Header initialize: (options) -> super(options) class Pettanr.Views.Scroll.ShowModule.Owner extends Pettanr.Views.Show.Owner initialize: (options) -> super(options) class Pettanr.Views.Scroll.Show extends Backbone.View tagName: 'div' className: 'show' initialize: (options) -> @item = options.item @operators = options.operators @header = new Pettanr.Views.Scroll.ShowModule.Header({ item: @item, operators: @operators, caption: @item.get('title'), icon_url: @item.show_url(), caption_url: @item.play_url(), prof_url: @item.prof_url() }) @author = new Pettanr.Views.Show.HeaderAuthor({item: @item}) @owner = new Pettanr.Views.Scroll.ShowModule.Owner({item: @item, operators: @operators}) @listenTo(@header, 'click:icon', @click_show) @listenTo(@header, 'click:caption', @click_play) @listenTo(@header, 'click:prof', @click_prof) @listenTo(@author, 'click:author', @click_author) @listenTo(@owner, 'click:edit', @click_edit) @listenTo(@owner, 'click:destroy', @click_destroy) 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(@operators) this click_show: () -> @trigger('http_get', @item.show_url()) click_play: () -> @trigger('http_get', @item.play_url()) click_prof: () -> @trigger('http_get', @item.prof_url()) click_author: () -> @trigger('http_get', @item.author().show_url()) click_edit: () -> @trigger('http_get', @item.edit_url()) click_destroy: () -> @trigger('http_get', @item.destroy_url())