class Pettanr.License extends Peta.SystemResource url: '/licenses/' @singular: () -> 'License' @plural: () -> 'Licenses' defaults: { id: null } license_group: () -> r = new Pettanr.LicenseGroup({id: @get('license_group_id')}) system_picture: () -> new Pettanr.SystemPicture({id: @get('system_picture_id')}) symbol_option: () -> i = @system_picture() i.fetch({cache: true}).done => @trigger('ready:symbol', i.tmb_opt_img_tag()) caption_with_group: () -> i = @license_group() i.fetch({cache: true}).done => caption = i.escape('caption') + '/' + @escape('caption') @trigger('ready:caption', caption) initialize: () -> if @id @url = @url + @id