aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/templates/package
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2018-10-02 13:17:04 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2018-10-02 13:17:04 +0300
commitcf2c56c7061b7ed40fdd3b40a352ddb9c9b7371f (patch)
treeb1de9ada0f1b1cb064e3a9e0d4042d1f519085bd /javascript/app/templates/package
Initial commit
Diffstat (limited to 'javascript/app/templates/package')
-rw-r--r--javascript/app/templates/package/index.hbs12
-rw-r--r--javascript/app/templates/package/search.hbs21
-rw-r--r--javascript/app/templates/package/show.hbs1
-rw-r--r--javascript/app/templates/package/show/file.hbs16
4 files changed, 50 insertions, 0 deletions
diff --git a/javascript/app/templates/package/index.hbs b/javascript/app/templates/package/index.hbs
new file mode 100644
index 0000000..e9bc592
--- /dev/null
+++ b/javascript/app/templates/package/index.hbs
@@ -0,0 +1,12 @@
+<div class="package-modules">
+ <div class="module-search-input">
+ {{input class="form-control" type="text" value=query placeholder="Module name"}}
+ </div>
+ <ul class="modules">
+ {{#each modulesFiltered as |module|}}
+ <li>
+ <a href="/package/{{model.id}}/show/{{module}}">{{module}}</a>
+ </li>
+ {{/each}}
+ </ul>
+</div>
diff --git a/javascript/app/templates/package/search.hbs b/javascript/app/templates/package/search.hbs
new file mode 100644
index 0000000..ebc4d52
--- /dev/null
+++ b/javascript/app/templates/package/search.hbs
@@ -0,0 +1,21 @@
+<div class="search-results-header">
+ Query : {{model.query}}
+</div>
+<div class="search-results-content">
+ {{#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>
+ <div><a href="#" onmouseup={{action "goToDefinition" identifier.locationInfo}}>Go to definition</a></div>
+ <div class="identifier-module">
+ {{#if identifier.locationInfo.modulePath}}
+ Defined in <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>
diff --git a/javascript/app/templates/package/show.hbs b/javascript/app/templates/package/show.hbs
new file mode 100644
index 0000000..c24cd68
--- /dev/null
+++ b/javascript/app/templates/package/show.hbs
@@ -0,0 +1 @@
+{{outlet}}
diff --git a/javascript/app/templates/package/show/file.hbs b/javascript/app/templates/package/show/file.hbs
new file mode 100644
index 0000000..b127fd7
--- /dev/null
+++ b/javascript/app/templates/package/show/file.hbs
@@ -0,0 +1,16 @@
+{{#if model.isHaskellModule}}
+ {{haskell-module
+ path=model.id
+ name=model.name
+ packageId=model.packageId
+ componentId=model.componentId
+ html=model.sourceCodeHtml
+ identifiers=model.identifiers
+ occurrences=model.occurrences
+ colorTheme=settings.colorTheme
+ declarations=model.declarations
+ findReferences=(action "findReferences")
+ }}
+{{else}}
+ {{text-file text=model.text path=model.id}}
+{{/if}}