1 class Pettanr.Picture extends Peta.Content
\r
13 @trace_routes: () ->
\r
15 resource_picture: ['resource_picture_picture', 'resource_picture']
\r
18 is_visible: (operators = Pettanr.cache.operators) ->
\r
22 @get('id') + '.' + @get('ext')
\r
28 'image/' + @get('ext')
\r
30 r_url: (subdir = null) ->
\r
35 '/pictures/' + @filename() + q
\r
38 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
39 ln = Pettanr.to_s(@license().get('caption'))
\r
40 lgn + '[' + ln + ']'
\r
42 symbol_option: (context, options) ->
\r
44 success: (symbol_item) =>
\r
45 options.success.call(context, symbol_item.symbol_file())
\r
46 fail: (response, opt) =>
\r
47 options.fail.call(context, response, opt)
\r
51 if @head().resource_picture()
\r
57 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
60 Picture.head(@get('original_picture_id'))
\r
66 if @license_extend().reverse < 0
\r
69 ['', 'v', 'h', 'vh']
\r
71 is_showable: (operators = Pettanr.cache.operators) ->
\r
72 return false if not @original_picture()
\r
73 return true if @is_own(operators)
\r
74 #@is_enable() and @is_head()
\r
76 initialize: (attr = {}, options = {}) ->
\r
77 super(attr, options)
\r