# page header for signed in user class Pettanr.Views.User.Account extends Backbone.View tagName: 'div' initialize: (options) -> @operators = options.operators @author = @operators.author @artist = @operators.artist render: () -> this.$el.html('') @logo = new Pettanr.Views.Common.Logo({}) @listenTo(@logo, 'click', @logo_click) this.$el.append(@logo.render().el) if @author @author_view = @author.icon_with_caption_view() @listenTo(@author_view, 'click', @author_click) this.$el.append(@author_view.render().el) if @artist @artist_view = @artist.icon_with_caption_view() @listenTo(@artist_view, 'click', @artist_click) this.$el.append(@artist_view.render().el) sign_out = new Tag.A({ attr: {href: '/users/sign_out'}, class_name: 'sign_out', content: 'sign out' }) @listenTo(sign_out, 'click', @sign_out_click) this.$el.append(sign_out.render().el) this logo_click: () -> @trigger('http_get', '') author_click: () -> @trigger('http_get', @author_view.url()) artist_click: () -> @trigger('http_get', @artist_view.url()) sign_out_click: () -> @trigger('http_post', 'users/sign_out') return false