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 new Pettanr.Image.SymbolPicture({
\r
40 tail_opt_img_tag: (img) ->
\r
41 {src: img, width: @get('width'), height: @get('height')}
\r
43 tail_tmb_opt_img_tag: (img) ->
\r
44 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
45 {src: img, width: wh[0], height: wh[1]}
\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: (cb) ->
\r
54 this.fetch({cache: true}).done ->
\r
55 cb(_this.tmb_opt_img_tag())
\r
58 if @head().resource_picture()
\r
64 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
67 Picture.head(@get('original_picture_id'))
\r
73 if @license_extend().reverse < 0
\r
76 ['', 'v', 'h', 'vh']
\r
78 is_showable: (operators = null) ->
\r
79 return false if not @original_picture()
\r
80 return true if @is_own(operators)
\r
81 #@is_enable() and @is_head()
\r
83 credit_icon_view: () ->
\r
84 new Pettanr.Views.Picture.CreditIcon({item: this})
\r
87 new Pettanr.Views.Picture.Credit({item: this})
\r