OSDN Git Service

add load icon
[pettanr/pettanr.git] / app / assets / javascripts / models / license.js.coffee
1 class Pettanr.License extends Peta.SystemResource\r
2   url: '/licenses/'\r
3   \r
4   @singular: () ->\r
5     'License'\r
6   \r
7   @plural: () ->\r
8     'Licenses'\r
9   \r
10   defaults: {\r
11     id: null\r
12   } \r
13   \r
14   license_group: () ->\r
15     r = new Pettanr.LicenseGroup({id: @get('license_group_id')})\r
16   \r
17   system_picture: () ->\r
18     new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
19   \r
20   symbol_option: () ->\r
21     i = @system_picture()\r
22     i.fetch({cache: true}).done =>\r
23       @symbol_picture = i.tmb_opt_img_tag()\r
24       @trigger('ready:symbol')\r
25   \r
26   caption_with_group: () ->\r
27     i = @license_group()\r
28     i.fetch({cache: true}).done =>\r
29       @caption_text = i.get('caption') + '/' + @get('caption')\r
30       @trigger('ready:caption')\r
31   \r
32   initialize: () ->\r
33     if @id\r
34       @url = @url + @id\r
35   \r