aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/templates/package.hbs
blob: d26ce34eba2fb3bc6bd36269f4cd56ab9e1442fb (plain) (blame)
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
81
82
83
84
85
86
87
<div class="flex-container">
    <div class="package-header">
        <span class="package-header-package-name">{{#link-to 'package' model}}{{model.id}}{{/link-to}}</span>
        <span class="package-header-input">
            {{#input-with-autocomplete
               onSubmit=(action 'searchIdentifier')
               createSearchUrlFunction=createSearchUrlFunction
               maxItems=10
               selectItem=(action 'showIdentifier')
               searchButtonText="Search"
               placeholder="Identifier" as |identifier|}}
                <span class="source-code-font">{{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}}</span>
                <div class="module-name">
                    <b>{{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}}</b>
                    {{#if identifier.locationInfo.modulePath}}
                        {{identifier.locationInfo.modulePath}}
                    {{else}}
                        {{identifier.locationInfo.moduleName}}
                    {{/if}}
                </div>
            {{/input-with-autocomplete}}
        </span>
        {{#radio-button
           value="currentPackage"
           groupValue=searchMode}}
            <span>in {{model.id}}</span>
        {{/radio-button}}
        {{#radio-button
           value="allPackages"
           groupValue=searchMode}}
            <span>in all packages</span>
        {{/radio-button}}
        {{#if currentFile}}
            <span class="package-header-filename">
                {{currentFile}}
            </span>
        {{/if}}
    </div>
    <div class="package-content">
        {{#resizable-panel class="left-panel" alsoResizeElementId="#right-panel" as |hide|}}
            <div class="file-tree-container">
                {{file-tree directoryTree=model.directoryTree openFile="openFile" currentFile=currentFile packageId=model.id hide=hide}}
            </div>
        {{/resizable-panel}}
        <div id="right-panel" class="right-panel">
            <div id="file-container" class="file-container">
                {{outlet}}
            </div>
            {{#bottom-panel visible=bottomPanelVisible topPanelElementId="#file-container" containerElementId="#right-panel" as |section|}}
                {{#if (eq section "header")}}
                    References to <b><span class="source-code">{{occName}}</span></b>
                    {{#if locationInfo.packageId}}
                        (defined in <b>{{locationInfo.packageId.name}}-{{locationInfo.packageId.version}}</b> / <b>{{locationInfo.moduleName}}</b>)
                    {{/if}}
                {{else}}
                    <div id="references-packages" class="references-packages">
                        {{#if globalReferences}}
                            <span>
                                {{#each globalReferences as |ref|}}
                                    <div>
                                        <a id="references-package-{{ref.packageId}}" class="{{if (eq ref.packageId packageId) 'selected'}}" href="#" {{action "updateReferences" ref.packageId externalId occName locationInfo true}}>
                                            {{ref.packageId}}
                                        </a> ({{ref.count}})
                                    </div>
                                {{/each}}
                            </span>
                        {{/if}}
                    </div>
                    <div class="references">
                        {{#paginated-list url=referencesUrl foundWhere=(concat "in <b>" packageId "</b>") as |files|}}
                            <ul>
                                {{#each files as |file|}}
                                    <li>
                                        <div class="file-name"><a href="/package/{{packageId}}/show/{{file.name}}">{{file.name}}</a></div>
                                        {{#each file.references as |reference|}}
                                            <a class="source-code source-code-snippet" href="/package/{{packageId}}/show/{{file.name}}#L{{reference.idSrcSpan.line}}">{{{reference.sourceCodeHtml}}}</a>
                                        {{/each}}
                                    </li>
                                {{/each}}
                            </ul>
                        {{/paginated-list}}
                    </div>
                {{/if}}
            {{/bottom-panel}}
        </div>
    </div>
</div>