aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/templates
diff options
context:
space:
mode:
authorAlexey Kiryushin <alexey.a.kiryushin@gmail.com>2018-11-16 16:19:03 +0300
committerGitHub <noreply@github.com>2018-11-16 16:19:03 +0300
commit866bfff6ff41a2796329c6bb28db688cbfeed2b8 (patch)
tree3da173b79af7727969116df212fba597fbddc3a3 /javascript/app/templates
parentb5a3048a880c8ce1c2bfa795a39576d02f416be2 (diff)
Add cross-package 'find references'
Diffstat (limited to 'javascript/app/templates')
-rw-r--r--javascript/app/templates/components/paginated-list.hbs2
-rw-r--r--javascript/app/templates/package.hbs48
2 files changed, 34 insertions, 16 deletions
diff --git a/javascript/app/templates/components/paginated-list.hbs b/javascript/app/templates/components/paginated-list.hbs
index 2ae9813..82d4eee 100644
--- a/javascript/app/templates/components/paginated-list.hbs
+++ b/javascript/app/templates/components/paginated-list.hbs
@@ -1,5 +1,5 @@
<div class="paginated-list-header">
- <span>Found {{total}}</span>
+ <span>Found {{total}} {{{foundWhere}}}</span>
{{#if (or next prev)}}
&nbsp;
&nbsp;
diff --git a/javascript/app/templates/package.hbs b/javascript/app/templates/package.hbs
index c8ed0dc..8c6d1a4 100644
--- a/javascript/app/templates/package.hbs
+++ b/javascript/app/templates/package.hbs
@@ -32,26 +32,44 @@
{{/resizable-panel}}
<div id="right-panel" class="right-panel">
<div id="file-container" class="file-container">
- {{outlet}}
+ {{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> in <span class="source-code">{{packageId}}</span>
+ 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}}
- {{#paginated-list url=referencesUrl 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 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}}
+ {{/bottom-panel}}
</div>
</div>
</div>