artist_id: null\r
} \r
\r
+ picture: () ->\r
+ new Pettanr.Picture({id: @get('picture_id')})\r
+ \r
is_visible: (operators) ->\r
@is_own(operators)\r
\r
})\r
\r
symbol_option: (cb) ->\r
- _this = this\r
- this.fetch({cache: true}).done ->\r
- cb(_this.tmb_opt_img_tag())\r
+ @fetch({cache: true}).done =>\r
+ @symbol_picture = @tmb_opt_img_tag()\r
+ @trigger('ready:symbol')\r
\r
revision: () ->\r
new Pettanr.OriginalPicture.Head({original_picture: this})\r
is_published: () ->\r
@get('published_at') != null\r
\r
+ state: () ->\r
+ switch true\r
+ when @is_unpublished()\r
+ 'unpublished'\r
+ when @is_unlicensed()\r
+ 'unlicensed'\r
+ when @is_stopped()\r
+ 'stopped'\r
+ when @is_published()\r
+ 'published'\r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
@pictures = new Pettanr.OriginalPicture.History({id: @original_picture.get('id')})\r
\r
render: () ->\r
- _this = this\r
- @pictures.fetch({cache: true}).done ->\r
- head = _this.pictures.models[0]\r
+ @pictures.fetch({cache: true}).done =>\r
+ head = @pictures.models[0]\r
value = if head\r
head.get('revision')\r
else\r
'unpublished'\r
- _this.$el.html(value)\r
+ this.$el.html(value)\r
this\r
\r