Merge pull request #1609 from xtuple/4_5_x
[xtuple] / scripts / templates / xtuple / tmpl / method.tmpl
1 <?js
2 var data = obj;
3 var self = this;
4 ?>
5 <dt>
6     <h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind === 'class' ? 'new ' : '') + name + (kind !== 'event' ? data.signature : '') ?></h4>
7     
8     <?js if (data.summary) { ?>
9     <p class="summary"><?js= summary ?></p>
10     <?js } ?>
11 </dt>
12 <dd>
13     
14     <?js if (data.description) { ?>
15     <div class="description">
16         <?js= data.description ?>
17     </div>
18     <?js } ?>
19
20     <?js if (kind === 'event' && data.type && data.type.names) {?>
21         <h5>Type:</h5>
22         <ul>
23             <li>
24                 <?js= self.partial('type.tmpl', data.type.names) ?>
25             </li>
26         </ul>
27     <?js } ?>
28     
29     <?js if (data['this']) { ?>
30         <h5>This:</h5>
31         <ul><li><?js= this.linkto(data['this'], data['this']) ?></li></ul>
32     <?js } ?>
33     
34     <?js if (data.params && params.length) { ?>
35         <h5>Parameters:</h5>
36         <?js= this.partial('params.tmpl', params) ?>
37     <?js } ?>
38     
39     <?js= this.partial('details.tmpl', data) ?>
40     
41     <?js if (data.fires && fires.length) { ?>
42     <h5>Fires:</h5>
43     <ul><?js fires.forEach(function(f) { ?>
44         <li><?js= self.linkto(f) ?></li>
45     <?js }); ?></ul>
46     <?js } ?>
47
48     <?js if (data.listens && listens.length) { ?>
49     <h5>Listens to Events:</h5>
50     <ul><?js listens.forEach(function(f) { ?>
51         <li><?js= self.linkto(f) ?></li>
52     <?js }); ?></ul>
53     <?js } ?>
54
55     <?js if (data.listeners && listeners.length) { ?>
56     <h5>Listeners of This Event:</h5>
57     <ul><?js listeners.forEach(function(f) { ?>
58         <li><?js= self.linkto(f) ?></li>
59     <?js }); ?></ul>
60     <?js } ?>
61     
62     <?js if (data.exceptions && exceptions.length) { ?>
63     <h5>Throws:</h5>
64     <?js if (exceptions.length > 1) { ?><ul><?js
65         exceptions.forEach(function(r) { ?>
66             <li><?js= self.partial('exceptions.tmpl', r) ?></li>
67         <?js });
68     ?></ul><?js } else {
69         exceptions.forEach(function(r) { ?>
70             <?js= self.partial('exceptions.tmpl', r) ?>
71         <?js });
72     } } ?>
73     
74     <?js if (data.returns && returns.length) { ?>
75     <h5>Returns:</h5>
76     <?js if (returns.length > 1) { ?><ul><?js
77         returns.forEach(function(r) { ?>
78             <li><?js= self.partial('returns.tmpl', r) ?></li>
79         <?js });
80     ?></ul><?js } else {
81         returns.forEach(function(r) { ?>
82             <?js= self.partial('returns.tmpl', r) ?>
83         <?js });
84     } } ?>
85     
86     <?js if (data.examples && examples.length) { ?>
87         <h5>Example<?js= examples.length > 1? 's':'' ?></h5>
88         <?js= this.partial('examples.tmpl', examples) ?>
89     <?js } ?>
90 </dd>