1 class Pettanr.ResourcePicture extends Peta.Content
\r
13 original_picture: () ->
\r
14 new Pettanr.Cache.Retriever(Pettanr.OriginalPicture, @get('original_picture_id'))
\r
17 new Pettanr.Cache.Retriever(Pettanr.Picture, @get('picture_id'))
\r
20 new Pettanr.Cache.Retriever(Pettanr.Artist, @get('artist_id'))
\r
22 is_visible: (operators = Pettanr.cache.operators) ->
\r
23 @is_user_visible(operators)
\r
26 @get('id') + '.' + @get('ext')
\r
32 'image/' + @get('ext')
\r
34 r_url: (subdir = null) ->
\r
35 opt = if _.isEmpty(subdir)
\r
38 '?subdir=' + Pettanr.to_s(subdir)
\r
39 '/resource_pictures/' + @filename() + opt
\r
41 tmb_opt_img_tag: () ->
\r
42 klass = if true # thumbnail
\r
43 Pettanr.Image.SymbolPicture
\r
52 {src: @url('full'), width: @get('width'), height: @get('height')}
\r
55 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
56 ln = Pettanr.to_s(@license().get('caption'))
\r
57 lgn + '[' + ln + ']'
\r
59 symbol_option: () ->
\r
61 success: (picture) =>
\r
62 @trigger('ready:symbol', picture.tmb_opt_img_tag())
\r
65 credit_icon_view: () ->
\r
66 new Pettanr.Views.ResourcePicture.CreditIcon({item: this})
\r
68 credit_view: (with_icon = true) ->
\r
69 new Pettanr.Views.ResourcePicture.Credit({item: this, with_icon: with_icon})
\r
71 initialize: (attr = {}, options = {}) ->
\r
72 super(attr, options)
\r