OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / comic_story.js.coffee
1 class Pettanr.ComicStory extends Peta.Leaf\r
2   url: '/comic_stories/'\r
3   \r
4   @singular: () ->\r
5     'ComicStory'\r
6   \r
7   @plural: () ->\r
8     'ComicStories'\r
9   \r
10   defaults: {\r
11     id: null,\r
12     comic_id: null,\r
13     story_id: null,\r
14     t: null\r
15   } \r
16   \r
17   comic: () ->\r
18     new Pettanr.Comic({id: @get('comic_id')})\r
19   \r
20   story: () ->\r
21     new Pettanr.Story({id: @get('story_id')})\r
22   \r
23   disp_t: () ->\r
24     @get('t') + 1\r
25   \r
26   disp_t_by_text: () ->\r
27     I18n.t('comic_stories.show.t', {t: @disp_t()})\r
28   \r
29   title: () ->\r
30     @disp_t_by_text() + ':' + @story().escape('title')\r
31   \r
32   initialize: () ->\r
33     if @id\r
34       @url = @url + @id\r
35   \r