1 class Pettanr.ResourcePicture extends Peta.Content
\r
2 url: '/resource_pictures/'
\r
15 new Pettanr.Cache.Retriever(Pettanr.Picture, @get('picture_id'))
\r
18 new Pettanr.Cache.Retriever(Pettanr.Artist, @get('artist_id'))
\r
20 is_visible: (operators = Pettanr.cache.operators) ->
\r
21 @is_user_visible(operators)
\r
24 @get('id') + '.' + @get('ext')
\r
30 'image/' + @get('ext')
\r
32 r_url: (subdir = null) ->
\r
33 opt = if _.isEmpty(subdir)
\r
36 '?subdir=' + Pettanr.to_s(subdir)
\r
37 '/resource_pictures/' + @filename() + opt
\r
39 tmb_opt_img_tag: () ->
\r
40 klass = if true # thumbnail
\r
41 Pettanr.Image.SymbolPicture
\r
50 {src: @url('full'), width: @get('width'), height: @get('height')}
\r
53 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
54 ln = Pettanr.to_s(@license().get('caption'))
\r
55 lgn + '[' + ln + ']'
\r
57 symbol_option: () ->
\r
58 retriever = @retriever()
\r
59 @listenTo(retriever, 'retrieve', @retrieve_symbol)
\r
60 retriever.retrieve()
\r
62 retrieve_symbol: (item) ->
\r
63 @trigger('ready:symbol', item.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