# panel: panel item # spot: no opacity element class Pettanr.Views.Panel.Show extends Pettanr.View.Show initialize: (options) -> @panel = @item @spot = options.spot @header = new Pettanr.View.Show.Header(@item, this, @default_header_options()) @authored_by = @item.authored_by() @body = new Pettanr.Views.Panel.Body({ panel: @panel, spot: @spot }) @footer = new Pettanr.Views.Panel.Show.Footer(@panel, this, {}) @owner = new Pettanr.View.Show.Footer(@item, this, @default_footer_options()) @listenTo(@header, 'click:pick', @click_pick) @listenTo(@authored_by, 'click', @click_authored_by) render: () -> this.$el.html('') this.$el.append(@header.render().el) this.$el.append(@authored_by.render().el) this.$el.append(@body.render().el) this.$el.append(@footer.render().el) @add_credits() 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) class Pettanr.Views.Panel.Show.Footer extends Pettanr.View tagName: 'ul' constructor: (@panel, @context, options) -> super(options) initialize: (options) -> super(options) render: () -> super() this.$el.html('') this.$el.append( Pettanr.AppHelper.distance_of_time_in_words_to_now(@panel.get('updated_at')) ) if Pettanr.cache.operators.is_author() inspire_button = Pettanr.View.mini_face_button( @panel, Pettanr.View.Image.icon_inspire_file(), { context: @context, click: () => inspire = new Pettanr.Inspire(@panel) inspire.go(@context, { success: (item) -> @trigger('http_get', item.show_url()) fail: (response, opt) => @open_error_dialog(response, opt) }) } ) this.$el.append(inspire_button.render().el) this