1 class Pettanr.Picture extends Peta.Content
\r
14 is_visible: (operators) ->
\r
18 @get('id') + '.' + @get('ext')
\r
24 'image/' + @get('ext')
\r
27 '/pictures/' + @filename()
\r
30 {src: @r_url(), width: @get('width'), height: @get('height')}
\r
32 tmb_opt_img_tag: () ->
\r
33 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
34 new Pettanr.AppHelperImg({src: @r_url(), size: wh[0]})
\r
36 tail_opt_img_tag: (img) ->
\r
37 {src: img, width: @get('width'), height: @get('height')}
\r
39 tail_tmb_opt_img_tag: (img) ->
\r
40 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
41 {src: img, width: wh[0], height: wh[1]}
\r
44 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
45 ln = Pettanr.to_s(@license().get('caption'))
\r
46 lgn + '[' + ln + ']'
\r
48 symbol_option: (cb) ->
\r
50 this.fetch().done ->
\r
51 cb(_this.tmb_opt_img_tag())
\r
54 if @head().resource_picture()
\r
60 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
63 Picture.head(@get('original_picture_id'))
\r
69 if @license_extend().reverse < 0
\r
72 ['', 'v', 'h', 'vh']
\r
74 is_showable: (operators = null) ->
\r
75 return false if not @original_picture()
\r
76 return true if @is_own(operators)
\r
77 #@is_enable() and @is_head()
\r
83 class Pettanr.Picture.Collection extends Backbone.Collection
\r
84 model: Pettanr.Picture
\r