class Pettanr.Panel extends Peta.Root\r
- url: '/panels/'\r
\r
@singular: () ->\r
'Panel'\r
r[pid] = elm.picture() if not r[pid]\r
r\r
\r
- my_url: () ->\r
- s = if @get('id')\r
- '/' + @get('id')\r
- else\r
- ''\r
- '/' + @path_name() + s\r
- \r
initialize: (attr = {}, options = {}) ->\r
super(attr, options)\r
@set(attr)\r
- if @get('id')\r
- @url = @my_url()\r
\r
class Pettanr.Panel.WithElements extends Pettanr.Panel\r
\r
fetch: (options) ->\r
- @url = @my_url() + '?with_elements=true'\r
+ @url = @default_url() + '?with_elements=true'\r
super(options)\r
\r
save: (attrs) ->\r
- @url = @my_url()\r
+ @url = @default_url()\r
method = if @isNew()\r
'create'\r
else\r