-
-
Notifications
You must be signed in to change notification settings - Fork 115
/
Copy pathclass-field-description.hbs
80 lines (80 loc) · 3.06 KB
/
class-field-description.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<section class="{{this.type}}">
{{!-- TODO: Fix this link for a11y --}}
<h3 class="class-field-description--link" data-anchor="{{this.field.name}}" role="link" onclick={{action this.updateAnchor this.field.name}}>
<a class="anchor" {{!-- template-lint-disable link-href-attributes --}}>
{{svg-jar 'fa-link' class="class-field-description--link-hover" width="20px" height="20px"}}
</a>
<span class="{{this.type}}-name">{{this.field.name}}</span>
{{#if this.field.params}}
<span class="args">
({{join ", " (map-by "name" this.field.params)}})
</span>
{{/if}}
{{#if this.field.return}}
<span class="return-type">{{this.field.return.type}}</span>
{{/if}}
{{#if this.field.access}}
<span class="access">{{this.field.access}}</span>
{{/if}}
{{#if this.field.deprecated}}
<span class="access">deprecated</span>
{{/if}}
</h3>
{{#if this.model.module}}
<div class="attributes">
<div class="attribute">
<span class="attribute-label">Module:</span>
<span class="attribute-value"><LinkTo @route="project-version.modules.module" @models={{array this.model.projectVersion.compactVersion this.model.module}}>{{this.model.module}}</LinkTo></span>
</div>
</div>
{{/if}}
<p class="github-link" data-test-file={{this.field.file}}>
{{#if this.field.inherited}}
Inherited from
<a href="{{github-link this.model.project.id this.model.projectVersion.version this.field.file this.field.line}}" target="_blank" rel="noopener noreferrer">
{{this.field.inheritedFrom}} {{this.field.file}}:{{this.field.line}}
</a>
{{else}}
Defined in
<a href="{{github-link this.model.project.id this.model.projectVersion.version this.field.file this.field.line}}" target="_blank" rel="noopener noreferrer">
{{this.field.file}}:{{this.field.line}}
</a>
{{/if}}
</p>
{{#if this.field.since}}
<p class="field-since">
Available since v{{this.field.since}}
</p>
{{/if}}
{{#if (and (eq this.field.static 1) (eq this.field.itemtype "method") this.hasImportExample)}}
<ImportExample @item={{concat "{ " this.field.name " }"}} @package={{this.field.class}} />
{{/if}}
<dl class="parameters">
{{#each this.field.params as |param|}}
<div class="parameter">
<dt>{{param.name}}</dt>
<dd class="parameter-type">{{param.type}}</dd>
<dd>{{param.description}}</dd>
{{#if param.props}}
<dl class="parameters">
{{#each param.props as |prop|}}
<div class="prop">
<dt>{{prop.name}}</dt>
<dd class="parameter-type">{{prop.type}}</dd>
<dd>{{prop.description}}</dd>
</div>
{{/each}}
</dl>
{{/if}}
</div>
{{/each}}
{{#if this.field.return}}
<div class="return">
<dt>returns</dt>
<dd class="return-type">{{this.field.return.type}}</dd>
<dd>{{this.field.return.description}}</dd>
</div>
{{/if}}
</dl>
{{html-safe this.field.description}}
</section>