class Pettanr.GroundPicture extends Peta.Element url: '/ground_pictures/' @singular: () -> 'GroundPicture' @plural: () -> 'GroundPictures' defaults: { id: null, x: 0, y: 0, repeat: 0 } @repeat_texts: () -> ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] panel: () -> new Pettanr.Panel({id: @get('panel_id')}) picture: () -> new Pettanr.Picture({id: @get('picture_id')}) has_picture: () -> true tmb_opt_img_tag: (picture) -> new Pettanr.Image.SymbolPicture({ attr: { src: picture.r_url(), alt: @get('caption') }, picture: picture }) symbol_option: (cb) -> i = @picture() _this = this i.fetch().done -> cb(_this.tmb_opt_img_tag(i)) repeat_text: () -> Pettanr.GroundPicture.repeat_texts()[@get('repeat')] initialize: () -> if @id @url = @url + @id class Pettanr.GroundPicture.Collection extends Backbone.Collection model: Pettanr.GroundPicture url: '/ground_pictures/'