# panel: panel item # operators: operators # spot: no opacity element class Pettanr.Views.Panel.Show extends Backbone.View tagName: 'div' initialize: (options) -> @panel = options.panel @operators = options.operators @spot = options.spot icon_url = Pettanr.url(@panel.table_name(), 'show', {id: @panel.get('id')}) caption_url = Pettanr.url(@panel.table_name(), 'show', {id: @panel.get('id')}) prof_url = Pettanr.url(@panel.table_name(), 'show', {id: @panel.get('id'), format: 'prof'}) @header = new Pettanr.Views.Scroll.ShowModule.Header({ item: @panel, operators: @operators, caption: @panel.get('caption'), icon_url: icon_url, caption_url: caption_url, prof_url: prof_url }) @body = new Pettanr.Views.Panel.Body({ panel: @panel, operators: @operators, spot: @spot }) @footer = new Pettanr.Views.Panel.Footer({ panel: @panel, operators: @operators }) @credits = new Pettanr.Views.Panel.Show.Credits({pictures: @panel.licensed_pictures()}) render: () -> this.$el.html('') this.$el.append(@header.render().el) this.$el.append(@body.render().el) this.$el.append(@footer.render().el) this.$el.append(@credits.render().el) rb = new Tag.RowBreak() this.$el.append(rb.render().el) this class Pettanr.Views.Panel.Show.Credits extends Backbone.View tagName: 'div' className: 'credits' initialize: (options) -> @pictures = options.pictures render: () -> _this = this this.$el.html('') _.each @pictures, (picture) -> picture.fetch({cache: true}).done -> credit = picture.credit_view() _this.$el.append(credit.render().el) this