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.to_symbol())
\r
49 if @head().resource_picture()
\r
55 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
58 Picture.head(@get('original_picture_id'))
\r
64 if @license_extend().reverse < 0
\r
67 ['', 'v', 'h', 'vh']
\r
69 is_showable: (operators = Pettanr.cache.operators) ->
\r
70 return false if not @original_picture()
\r
71 return true if @is_own(operators)
\r
72 #@is_enable() and @is_head()
\r
74 initialize: (attr = {}, options = {}) ->
\r
75 super(attr, options)
\r