1 class Pettanr.ResourcePicture extends Peta.Content
\r
2 url: '/resource_pictures/'
\r
14 is_visible: (operators) ->
\r
15 @is_user_visible(operators)
\r
18 @get('id') + '.' + @get('ext')
\r
24 'image/' + @get('ext')
\r
26 r_url: (subdir = null) ->
\r
27 opt = if Pettanr.to_s(@subdir).empty
\r
30 '?subdir=' + Pettanr.to_s(subdir)
\r
31 '/resource_pictures/' + @filename() + opt
\r
33 tmb_opt_img_tag: () ->
\r
34 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
35 new Pettanr.AppHelperImg({src: @r_url(), size: wh[0], alt: @get('caption')})
\r
38 {src: @url('full'), width: @get('width'), height: @get('height')}
\r
41 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
42 ln = Pettanr.to_s(@license().get('caption'))
\r
43 lgn + '[' + ln + ']'
\r
45 symbol_option: (cb) ->
\r
47 this.fetch().done ->
\r
48 cb(_this.tmb_opt_img_tag())
\r
54 class Pettanr.ResourcePicture.Collection extends Backbone.Collection
\r
55 model: Pettanr.ResourcePicture
\r
56 url: '/resource_pictures/'
\r