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: () ->
\r
56 if @head().resource_picture()
\r
62 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
65 Picture.head(@get('original_picture_id'))
\r
71 if @license_extend().reverse < 0
\r
74 ['', 'v', 'h', 'vh']
\r
76 is_showable: (operators = null) ->
\r
77 return false if not @original_picture()
\r
78 return true if @is_own(operators)
\r
79 #@is_enable() and @is_head()
\r
81 credit_icon_view: () ->
\r
82 new Pettanr.Views.Picture.CreditIcon({item: this})
\r
84 credit_view: (with_icon = true) ->
\r
85 new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon})
\r
89 @credit_icon = @credit_icon_view()
\r
91 f = (data, status) =>
\r
94 $.get(@url + '/credit', null, f, 'html')
\r