diff options
Diffstat (limited to 'javascript/app/templates')
-rw-r--r-- | javascript/app/templates/components/input-with-autocomplete.hbs | 2 | ||||
-rw-r--r-- | javascript/app/templates/package.hbs | 3 | ||||
-rw-r--r-- | javascript/app/templates/package/search.hbs | 6 | ||||
-rw-r--r-- | javascript/app/templates/packages.hbs | 24 | ||||
-rw-r--r-- | javascript/app/templates/search.hbs | 46 |
5 files changed, 74 insertions, 7 deletions
diff --git a/javascript/app/templates/components/input-with-autocomplete.hbs b/javascript/app/templates/components/input-with-autocomplete.hbs index eb0100d..1a73c07 100644 --- a/javascript/app/templates/components/input-with-autocomplete.hbs +++ b/javascript/app/templates/components/input-with-autocomplete.hbs @@ -14,6 +14,6 @@ {{/if}} </div> <div class="input-group-append"> - <button id="search-input" class="btn btn-outline-secondary" {{action "onSubmit" query}}>Search</button> + <button id="search-input" class="btn btn-outline-secondary" {{action "onSubmit" query}}>{{searchButtonText}}</button> </div> </div> diff --git a/javascript/app/templates/package.hbs b/javascript/app/templates/package.hbs index 8c6d1a4..5f9fa68 100644 --- a/javascript/app/templates/package.hbs +++ b/javascript/app/templates/package.hbs @@ -7,6 +7,7 @@ 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"> @@ -31,7 +32,7 @@ </div> {{/resizable-panel}} <div id="right-panel" class="right-panel"> - <div id="file-container" class="file-container"> + <div id="file-container" class="file-container"> {{outlet}} </div> {{#bottom-panel visible=bottomPanelVisible topPanelElementId="#file-container" containerElementId="#right-panel" as |section|}} diff --git a/javascript/app/templates/package/search.hbs b/javascript/app/templates/package/search.hbs index ebc4d52..37b3992 100644 --- a/javascript/app/templates/package/search.hbs +++ b/javascript/app/templates/package/search.hbs @@ -2,11 +2,11 @@ Query : {{model.query}} </div> <div class="search-results-content"> - {{#paginated-list url=model.url as |identifiers|}} + {{#paginated-list url=model.url as |identifiers|}} <ul> {{#each identifiers as |identifier|}} - <li class="search-result"> - <span class="source-code" >{{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}}</span> + <li class="search-result"> + <span class="source-code" ><b>{{identifier.demangledOccName}}</b> :: {{type-signature-text components=identifier.idType.components}}</span> <div><a href="#" onmouseup={{action "goToDefinition" identifier.locationInfo}}>Go to definition</a></div> <div class="identifier-module"> {{#if identifier.locationInfo.modulePath}} diff --git a/javascript/app/templates/packages.hbs b/javascript/app/templates/packages.hbs index 6dc4b7b..80464e6 100644 --- a/javascript/app/templates/packages.hbs +++ b/javascript/app/templates/packages.hbs @@ -1,6 +1,26 @@ <div class="flex-container container"> - <div> - <!-- <p class="lead"><b>Haskell code explorer</b> </p> --> + <div> + <div class="global-identifier-search-form"> + {{#input-with-autocomplete + onSubmit=(action 'searchIdentifier') + createSearchUrlFunction=createSearchUrlFunction + maxItems=10 + selectItem=(action 'showIdentifier') + searchButtonText="Search in all packages" + placeholder="Haskell 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}} + </div> + </div> + <div> <div class="package-search-form"> {{input class="form-control" type="text" value=query placeholder="Package name"}} <span>Number of packages : {{packages.length}}</span> diff --git a/javascript/app/templates/search.hbs b/javascript/app/templates/search.hbs new file mode 100644 index 0000000..343ce68 --- /dev/null +++ b/javascript/app/templates/search.hbs @@ -0,0 +1,46 @@ +<div class="flex-container container"> + <div style="position:relative;height:100%"> + <div class="absolute-container"> + <div class="global-identifier-search-form"> + {{#input-with-autocomplete + onSubmit=(action 'searchIdentifier') + createSearchUrlFunction=createSearchUrlFunction + maxItems=10 + selectItem=(action 'showIdentifier') + searchButtonText="Search in all packages" + placeholder="Haskell 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}} + </div> + <div> + Query : {{model.query}} + </div> + <div class="global-search-results-content"> + {{#paginated-list url=model.url as |identifiers|}} + <ul> + {{#each identifiers as |identifier|}} + <li class="search-result"> + <span class="source-code" ><b>{{identifier.demangledOccName}}</b> :: {{type-signature-text components=identifier.idType.components}}</span> + <div><a href="#" onmouseup={{action "goToDefinition" identifier.locationInfo}}>Go to definition</a></div> + <div class="identifier-module"> + {{#if identifier.locationInfo.modulePath}} + Defined in <b> {{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}} </b> <a href="/package/{{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}}/show/{{identifier.locationInfo.modulePath}}">{{identifier.locationInfo.modulePath}}</a> + {{/if}} + </div> + <div>{{{identifier.doc}}}</div> + </li> + {{/each}} + </ul> + {{/paginated-list}} + </div> + </div> + </div> +</div> |