1 class Pettanr.ResourcePicture extends Peta.Content
\r
2 url: '/resource_pictures/'
\r
15 new Pettanr.Cache.Retriever(Pettanr.Picture, @get('picture_id'))
\r
17 is_visible: (operators = Pettanr.cache.operators) ->
\r
18 @is_user_visible(operators)
\r
21 @get('id') + '.' + @get('ext')
\r
27 'image/' + @get('ext')
\r
29 r_url: (subdir = null) ->
\r
30 opt = if Pettanr.to_s(@subdir).empty
\r
33 '?subdir=' + Pettanr.to_s(subdir)
\r
34 '/resource_pictures/' + @filename() + opt
\r
36 tmb_opt_img_tag: () ->
\r
37 new Pettanr.Image.SymbolPicture({
\r
45 {src: @url('full'), width: @get('width'), height: @get('height')}
\r
48 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
49 ln = Pettanr.to_s(@license().get('caption'))
\r
50 lgn + '[' + ln + ']'
\r
52 symbol_option: () ->
\r
53 retriever = @retriever()
\r
54 @listenTo(retriever, 'retrieve', @retrieve_symbol)
\r
55 retriever.retrieve()
\r
57 retrieve_symbol: (item) ->
\r
58 @trigger('ready:symbol', item.tmb_opt_img_tag())
\r
60 credit_icon_view: () ->
\r
61 new Pettanr.Views.ResourcePicture.CreditIcon({item: this})
\r
63 credit_view: (with_icon = true) ->
\r
64 new Pettanr.Views.ResourcePicture.Credit({item: this, with_icon: with_icon})
\r
66 initialize: (attr = {}, options = {}) ->
\r
67 super(attr, options)
\r