OSDN Git Service

separate manifest
[pettanr/pettanr.git] / lib / locmare / filer / body / file_body / file_item / summary / summary.rb
1 module Locmare
2   module FilerModule
3     module BodyModule
4       module FileBodyModule
5         module FileItemModule
6           module  SummaryItemColumnModule
7             class Base
8               attr :file_item, :summary_manifest, :item, :column_name
9               
10               def initialize file_item, summary_manifest, item
11                 @file_item = file_item
12                 @summary_manifest = summary_manifest
13                 @item = item
14                 @column_name = 'summary'
15               end
16               
17               def filer
18                 @file_item.filer
19               end
20               
21               def manifest
22                 self.filer.manifest
23               end
24               
25               def item_name
26                 self.filer.item_name
27               end
28               
29               def column_template_dir
30                 self.filer.template_dir + 'item_column/'
31               end
32               
33               def column_template_file_name
34                 raise "undefined column_template_file_name\n"
35               end
36               
37               def column_template_name
38                 self.column_template_dir + self.column_template_file_name
39               end
40               
41               def item_template_dir
42                 self.filer.template_dir + 'summary/'
43               end
44               
45               def item_template_file_name
46                 raise "undefined item_template_file_name\n"
47               end
48               
49               def item_template_name
50                 self.item_template_dir + self.item_template_file_name
51               end
52               
53             end
54             
55             class None < Base
56               def column_template_file_name
57                 "none"
58               end
59               
60             end
61             
62             class Template < Base
63               def column_template_file_name
64                 'show'
65               end
66               
67               def item_template_file_name
68                 'template'
69               end
70               
71               def template_dir
72                 @item.path_name + '/'
73               end
74               
75               def template_file_name
76                 @summary_manifest.template_name
77               end
78               
79               def template_name
80                 self.template_dir + self.template_file_name
81               end
82               
83             end
84           end
85         end
86       end
87     end
88   end
89 end