# panel: panel item # operators: operators # spot: no opacity element class Pettanr.Views.Panel.Body extends Backbone.View tagName: 'div' className: 'pettanr-comic-panel' initialize: (options) -> @panel = options.panel @operators = options.operators @spot = options.spot render: () -> attr = {style: Pettanr.to_style(@style())} this.$el.attr(attr) if @panel.is_visible(@operators) this.$el.html('') _this = this l = @panel.scenario_elements() _.each l, (element) -> c = Pettanr.Views[element.singular()].Element tag = new c({element: element, root: _this.panel, spot: _this.spot}) _this.$el.append(tag.render().el) else tag = new Tag.Div({ content: I18n.t('panels.hidden'), class_name: 'hidden' }) this.$el.html(tag.render().el) this style: () -> { 'width': Pettanr.to_s(@panel.get('width')) + 'px', 'height': Pettanr.to_s(@panel.get('height')) + 'px', 'border-style': 'solid', 'border-width': Pettanr.to_s(@panel.get('border')) + 'px', 'border-color': 'black', 'background-color': 'white' } class Pettanr.Views.Panel.Footer extends Backbone.View tagName: 'table' className: 'no-border' initialize: (options) -> @panel = options.panel @operators = options.operators render: () -> this.$el.html('') this.$el.append( (new Pettanr.Views.Panel.Icon({item: @panel, half: true})).render().el ) this.$el.append( (new Pettanr.Views.Author.Icon({item: @panel.author(), half: true})).render().el ) this.$el.append(Pettanr.AppHelper.distance_of_time_in_words_to_now(@panel.get('updated_at'))) if @panel.is_own(@operators) this.$el.append( (new Pettanr.Views.Show.LinkedEditButton({item: @panel})).render().el ) this