Merge pull request #1609 from xtuple/4_5_x
[xtuple] / scripts / templates / xtuple / tmpl / container.tmpl
1 <?js
2     var self = this;
3     docs.forEach(function(doc, i) {
4 ?>
5
6 <?js if (doc.kind === 'mainpage' || (doc.kind === 'package')) { ?>
7     <?js= self.partial('mainpage.tmpl', doc) ?>
8 <?js } else if (doc.kind === 'source') { ?>
9     <?js= self.partial('source.tmpl', doc) ?>
10 <?js } else { ?>
11
12 <section>
13     
14 <header>
15     <h2><?js if (doc.ancestors && doc.ancestors.length) { ?>
16         <span class="ancestors"><?js= doc.ancestors.join('') ?></span>
17     <?js } ?>
18     <?js= doc.name ?>
19     <?js if (doc.variation) { ?>
20         <sup class="variation"><?js= doc.variation ?></sup>
21     <?js } ?></h2>
22     <?js if (doc.classdesc) { ?>
23         <div class="class-description"><?js= doc.classdesc ?></div>
24     <?js } ?>
25 </header>  
26
27 <article>
28     <div class="container-overview">
29     <?js if (doc.kind === 'module' && doc.module) { ?>
30         <?js= self.partial('method.tmpl', doc.module) ?>
31     <?js } ?>
32     
33     <?js if (doc.kind === 'class') { ?>
34         <?js= self.partial('method.tmpl', doc) ?>
35     <?js } else { ?>
36         <?js if (doc.description) { ?>
37             <div class="description"><?js= doc.description ?></div>
38         <?js } ?>
39         
40         <?js= self.partial('details.tmpl', doc) ?>
41         
42         <?js if (doc.examples && doc.examples.length) { ?>
43             <h3>Example<?js= doc.examples.length > 1? 's':'' ?></h3>
44             <?js= self.partial('examples.tmpl', doc.examples) ?>
45         <?js } ?>
46     <?js } ?>
47     </div>
48     
49     <?js if (doc.augments && doc.augments.length) { ?>
50         <h3 class="subsection-title">Extends</h3>
51         
52         <ul><?js doc.augments.forEach(function(a) { ?>
53             <li><?js= self.linkto(a, a) ?></li>
54         <?js }); ?></ul>
55     <?js } ?>
56     
57     <?js if (doc.mixes && doc.mixes.length) { ?>
58         <h3 class="subsection-title">Mixes In</h3>
59         
60         <ul><?js doc.mixes.forEach(function(a) { ?>
61             <li><?js= self.linkto(a, a) ?></li>
62         <?js }); ?></ul>
63     <?js } ?>
64     
65     <?js if (doc.requires && doc.requires.length) { ?>
66         <h3 class="subsection-title">Requires</h3>
67         
68         <ul><?js doc.requires.forEach(function(r) { ?>
69             <li><?js= self.linkto(r, r) ?></li>
70         <?js }); ?></ul>
71     <?js } ?>
72     
73     <?js
74         var namespaces = self.find({kind: 'namespace', memberof: doc.longname}); 
75         if (doc.kind !== 'globalobj' && namespaces && namespaces.length) { 
76     ?>
77         <h3 class="subsection-title">Namesplaces</h3>
78         
79         <dl><?js namespaces.forEach(function(n) { ?>
80             <dt><a href="namespaces.html#<?js= n.longname ?>"><?js= self.linkto(n.longname, n.name) ?></a></dt>
81             <dd><?js if (n.summary) { ?><?js= n.summary ?><?js } ?></dd>
82         <?js }); ?></dl>
83     <?js } ?>
84     
85     <?js
86         var classes = self.find({kind: 'class', memberof: doc.longname}); 
87         if (doc.kind !== 'globalobj' && classes && classes.length) { 
88     ?>
89         <h3 class="subsection-title">Classes</h3>
90         
91         <dl><?js classes.forEach(function(c) { ?>
92             <dt><?js= self.linkto(c.longname, c.longname) ?></dt>
93             <dd><?js if (c.summary) { ?><?js= c.summary ?><?js } ?></dd>
94         <?js }); ?></dl>
95     <?js } ?>
96     
97     <?js
98         var members = self.find({kind: 'member', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
99         if (members && members.length && members.forEach) { 
100     ?>
101         <h3 class="subsection-title">Members</h3>
102         
103         <dl><?js members.forEach(function(p) { ?>
104             <?js= self.partial('members.tmpl', p) ?>
105         <?js }); ?></dl>
106     <?js } ?>
107     
108     <?js
109         var methods = self.find({kind: 'function', memberof: title === 'Global' ? {isUndefined: true} : doc.longname});
110         if (methods && methods.length && methods.forEach) { 
111     ?>
112         <h3 class="subsection-title">Methods</h3>
113         
114         <dl><?js methods.forEach(function(m) { ?>
115             <?js= self.partial('method.tmpl', m) ?>
116         <?js }); ?></dl>
117     <?js } ?>
118     
119     <?js
120         var typedefs = self.find({kind: 'typedef', memberof: title === 'Global' ? {isUndefined: true} : doc.longname}); 
121         if (typedefs && typedefs.length && typedefs.forEach) { 
122     ?>
123         <h3 class="subsection-title">Type Definitions</h3>
124         
125         <dl><?js typedefs.forEach(function(e) {
126                 if (e.signature) {
127             ?>
128                 <?js= self.partial('method.tmpl', e) ?>
129             <?js
130                 }
131                 else {
132             ?>
133                 <?js= self.partial('members.tmpl', e) ?>
134             <?js
135                 }
136             }); ?></dl>
137     <?js } ?>
138     
139     <?js
140         var events = self.find({kind: 'event', memberof: title === 'Global' ? {isUndefined: true} : doc.longname}); 
141         if (events && events.length && events.forEach) { 
142     ?>
143         <h3 class="subsection-title">Events</h3>
144         
145         <dl><?js events.forEach(function(e) { ?>
146             <?js= self.partial('method.tmpl', e) ?>
147         <?js }); ?></dl>
148     <?js } ?>
149 </article>
150
151 </section>  
152 <?js } ?>
153
154 <?js }); ?>