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 {src: @r_url(), width: wh[0], height: wh[1]}
\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: () ->
\r
52 if @head().resource_picture()
\r
58 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
61 Picture.head(@get('original_picture_id'))
\r
67 if @license_extend().reverse < 0
\r
70 ['', 'v', 'h', 'vh']
\r
72 is_showable: (operators = null) ->
\r
73 return false if not @original_picture()
\r
74 return true if @is_own(operators)
\r
75 #@is_enable() and @is_head()
\r
81 class Pettanr.Picture.Collection extends Backbone.Collection
\r
82 model: Pettanr.Picture
\r