1 class Pettanr.Panel extends Peta.Root
\r
17 new Pettanr.Author({id: @get('author_id')})
\r
20 new Pettanr.PanelPicture({id: @get('pp_id')})
\r
22 with_elements: () ->
\r
23 new Pettanr.Panel.WithElements({id: @get('id')})
\r
25 overwrite: (options) ->
\r
26 operators = options.operators
\r
27 return false if not operators.author
\r
28 @set('author_id', operators.author.id)
\r
30 is_visible: (operators) ->
\r
31 switch super(operators)
\r
32 when null # super return
\r
37 return true if @isNew()
\r
40 overwrite: (options) ->
\r
41 @set('author_id', options.operators.author.id)
\r
43 is_usable: (operators) ->
\r
44 @is_visible(operators)
\r
49 @licensed_pictures: (panels) ->
\r
51 _.each panels, (panel) ->
\r
52 _.extend r, panel.licensed_pictures()
\r
55 licensed_pictures: () ->
\r
57 _.each @scenario_elements(), (elm) ->
\r
58 return if not elm.my_class().has_picture()
\r
59 pid = elm.get('picture_id')
\r
60 r[pid] = elm.picture() if not r[pid]
\r
64 '/' + @path_name() + '/' + @get('id')
\r
66 initialize: (attr = {}, options = {}) ->
\r
70 @bind('change:width', () ->
\r
74 class Pettanr.Panel.WithElements extends Pettanr.Panel
\r
77 @url = @my_url() + '?with_elements=true'
\r
80 save: (attrs, options = {}) ->
\r
82 options.attrs = {panel: attrs}
\r
83 method = if @isNew()
\r
87 xhr = @sync(method, this, options)
\r
90 destroy: (options) ->
\r