Consolidate core templates in mkws.templates directory. MKWS-279
authorJason Skomorowski <jason@indexdata.com>
Tue, 14 Oct 2014 18:55:06 +0000 (14:55 -0400)
committerJason Skomorowski <jason@indexdata.com>
Tue, 14 Oct 2014 18:55:06 +0000 (14:55 -0400)
32 files changed:
src/mkws-widget-main.templates/Done.handlebars [deleted file]
src/mkws-widget-main.templates/Image.handlebars [deleted file]
src/mkws-widget-main.templates/Lang.handlebars [deleted file]
src/mkws-widget-main.templates/Navi.handlebars [deleted file]
src/mkws-widget-main.templates/Pager.handlebars [deleted file]
src/mkws-widget-main.templates/Progress.handlebars [deleted file]
src/mkws-widget-main.templates/Ranking.handlebars [deleted file]
src/mkws-widget-main.templates/Record.handlebars [deleted file]
src/mkws-widget-main.templates/Records.handlebars [deleted file]
src/mkws-widget-main.templates/Results.handlebars [deleted file]
src/mkws-widget-main.templates/Search.handlebars [deleted file]
src/mkws-widget-main.templates/Stat.handlebars [deleted file]
src/mkws-widget-main.templates/Switch.handlebars [deleted file]
src/mkws-widget-main.templates/Targets.handlebars [deleted file]
src/mkws-widget-termlists.templates/Facet.handlebars [deleted file]
src/mkws-widget-termlists.templates/Termlists.handlebars [deleted file]
src/mkws.templates/Done.handlebars [new file with mode: 0644]
src/mkws.templates/Facet.handlebars [new file with mode: 0644]
src/mkws.templates/Image.handlebars [new file with mode: 0644]
src/mkws.templates/Lang.handlebars [new file with mode: 0644]
src/mkws.templates/Navi.handlebars [new file with mode: 0644]
src/mkws.templates/Pager.handlebars [new file with mode: 0644]
src/mkws.templates/Progress.handlebars [new file with mode: 0644]
src/mkws.templates/Ranking.handlebars [new file with mode: 0644]
src/mkws.templates/Record.handlebars [new file with mode: 0644]
src/mkws.templates/Records.handlebars [new file with mode: 0644]
src/mkws.templates/Results.handlebars [new file with mode: 0644]
src/mkws.templates/Search.handlebars [new file with mode: 0644]
src/mkws.templates/Stat.handlebars [new file with mode: 0644]
src/mkws.templates/Switch.handlebars [new file with mode: 0644]
src/mkws.templates/Targets.handlebars [new file with mode: 0644]
src/mkws.templates/Termlists.handlebars [new file with mode: 0644]

diff --git a/src/mkws-widget-main.templates/Done.handlebars b/src/mkws-widget-main.templates/Done.handlebars
deleted file mode 100644 (file)
index 59a0b4f..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{{!
-Displayed on search completion
-
-count - number of results found
-}}
-{{{mkws-translate "Search complete: found"}}} {{count}} {{{mkws-translate "records"}}}
-
diff --git a/src/mkws-widget-main.templates/Image.handlebars b/src/mkws-widget-main.templates/Image.handlebars
deleted file mode 100644 (file)
index abee587..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-{{!
-Records presented as images.
-
-hits:
-  containerClass - class  attribute for same
-  detailLinkId - id for the element triggering detail display
-  detailClick - a click event handler for details
-  renderedDetails - active record details rendered from the Record template
-  md-* - metadata fields passed through from backend
-}}
-{{#each hits}}
-  <a href="#" id="{{detailLinkId}}" onclick="{{detailClick}}">
-    {{#mkws-first md-thumburl}}
-      <img src="{{this}}" alt="{{../md-title}}"/>
-    {{/mkws-first}}
-    <br/>
-  </a>
-{{/each}}
diff --git a/src/mkws-widget-main.templates/Lang.handlebars b/src/mkws-widget-main.templates/Lang.handlebars
deleted file mode 100644 (file)
index 26ee6da..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-{{!
-Language selection widget
-
-languages
-  code - two character language identifier
-  selected - exists for the current language
-  url - url to switch to this language
-}}
-{{#each languages}}
-  {{~#if selected~}}
-    <span>{{code}}</span>
-  {{~else~}}
-    <a href="{{{url}}}">{{code}}</a>
-  {{~/if~}}
-  {{#unless last}}
-    |
-  {{/unless}}
-{{/each}}
-
diff --git a/src/mkws-widget-main.templates/Navi.handlebars b/src/mkws-widget-main.templates/Navi.handlebars
deleted file mode 100644 (file)
index 7f3c554..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-{{!
-Facet breadcrumbs -- filters on the current search
-
-filters
-  facet - name of facet being limited
-  value - limit to this value
-  click - handler script to remove limit
-}}
-{{#each filters}}
-  {{{mkws-translate facet}}}: <a class="mkwsRemovable" href="#" onclick="{{{click}}}">{{value}}</a>
-  {{#unless @last}}|{{/unless}}
-{{/each}}
-
diff --git a/src/mkws-widget-main.templates/Pager.handlebars b/src/mkws-widget-main.templates/Pager.handlebars
deleted file mode 100644 (file)
index 3f098e6..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-{{!
-Pager
-
-nextClick - handler script for "next" button, only available if there is a next page
-prevClick - handler script for "previous" button if there is a previous page
-moreNext - indicates there are more pages following those displayed
-morePrev - indicates there are more pages preceding
-first - first record displayed
-last - last record displayed
-count - number of records available
-found - number of records found
-pages:
-  number - page number
-  click - script to go to this page unless it is the current one
-}}
-<div style="float: right">
-  {{mkws-translate "Displaying"}}:
-  {{first}} {{mkws-translate "to"}} {{last}}
-  {{mkws-translate "of"}} {{count}} ({{{mkws-translate "found"}}}: {{found}})
-</div>
-
-<div style="float: clear">
-  {{#if prevClick}}
-    <a href="#" class="mkwsPrev" onclick="{{prevClick}}">&#60;&#60; {{{mkws-translate "Prev"}}}</a> |
-  {{else}}
-    <span class="mkwsPrev">&#60;&#60; {{{mkws-translate "Prev"}}}</span> |
-  {{/if}}
-
-  {{#if morePrev}}...{{/if}}
-
-  {{#each pages}}
-    {{#if click}}
-      <a href="#" onclick="{{click}}">{{number}}</a>
-    {{else}}
-      <span class="mkwsCurrentPage">{{number}}</span>
-    {{/if}}
-  {{/each}}
-
-  {{#if moreNext}}...{{/if}}
-
-  {{#if nextClick}}
-    | <a href="#" class="mkwsNext" onclick="{{nextClick}}">{{{mkws-translate "Next"}}} &#62;&#62;</a>
-  {{else}}
-    | <span class="mkwsNext">{{{mkws-translate "Next"}}} &#62;&#62;</span>
-  {{/if}}
-</div>
diff --git a/src/mkws-widget-main.templates/Progress.handlebars b/src/mkws-widget-main.templates/Progress.handlebars
deleted file mode 100644 (file)
index 1b08a2c..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{{!
-Progress
-
-done - number of targets complete
-waiting - number of targets waiting
-}}
-<span class="mkwsDone">{{#mkws-repeat done}}&#x2588;{{/mkws-repeat}}</span>
-{{~#if waiting~}}
-<span class="mkwsWaiting">{{#mkws-repeat waiting}}&#x2588;{{/mkws-repeat}}</span>
-{{~/if~}}
-
diff --git a/src/mkws-widget-main.templates/Ranking.handlebars b/src/mkws-widget-main.templates/Ranking.handlebars
deleted file mode 100644 (file)
index 1c823bb..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-{{!
-Ranking -- widget to select sort ordering and number of records to display
-
-team - team for this widget
-showSort
-showPerPage
-sort
-  key - machine readable value for this sort option
-  label - text to display for this sort option
-  selected - exists if this sort is selected
-perPage
-  perPage - a number of records per page that can be selected
-  selected - exists if this number is the current selection
-}}
-<form>
-  {{~#if showSort~}}
-    {{{mkws-translate "Sort by"}}}
-    <select class="mkwsSort mkwsTeam_{{team}}">
-      {{#each sort}}
-        {{#if selected}}
-          <option value="{{{key}}}" selected="selected">{{{mkws-translate label}}}</option>
-        {{else}}
-          <option value="{{key}}">{{{mkws-translate label}}}</option>
-        {{/if}}
-      {{/each}}  
-    </select>
-  {{~/if~}}
-  {{~#if showPerPage}}
-    {{{mkws-translate "and show"}}}
-    <select class="mkwsPerpage mkwsTeam_{{team}}">
-      {{#each perPage}}
-        {{#if selected}}
-          <option value="{{perPage}}" selected="selected">{{perPage}}</option>
-        {{else}}
-          <option value="{{perPage}}">{{perPage}}</option>
-        {{/if}}
-      {{/each}}  
-    </select>
-    {{{mkws-translate "per page"}}}
-  {{~/if~}}
-</form>
-
diff --git a/src/mkws-widget-main.templates/Record.handlebars b/src/mkws-widget-main.templates/Record.handlebars
deleted file mode 100644 (file)
index f8bf951..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-{{!
-Full record display.
-}}
-<table>
-  <tr>
-    <th>{{mkws-translate "Title"}}</th>
-    <td>
-      {{md-title}}
-      {{#if md-title-remainder}}
-        ({{md-title-remainder}})
-      {{/if}}
-      {{#if md-title-responsibility}}
-        <i>{{md-title-responsibility}}</i>
-      {{/if}}
-    </td>
-  </tr>
-  {{#if md-date}}
-  <tr>
-    <th>{{mkws-translate "Date"}}</th>
-    <td>{{md-date}}</td>
-  </tr>
-  {{/if}}
-  {{#if md-author}}
-  <tr>
-    <th>{{mkws-translate "Author"}}</th>
-    <td>{{md-author}}</td>
-  </tr>
-  {{/if}}
-  {{#if md-electronic-url}}
-  <tr>
-    <th>{{mkws-translate "Links"}}</th>
-    <td>
-      {{#each md-electronic-url}}
-        <a href="{{this}}">Link{{mkws-index1}}</a>
-      {{/each}}
-    </td>
-  </tr>
-  {{/if}}
-  {{#mkws-if-any location having="md-subject"}}
-  <tr>
-    <th>{{mkws-translate "Subject"}}</th>
-    <td>
-      {{#mkws-first location having="md-subject"}}
-        {{#if md-subject}}
-          {{#mkws-commaList md-subject}}
-            {{this}}{{/mkws-commaList}}
-        {{/if}}
-      {{/mkws-first}}
-    </td>
-  </tr>
-  {{/mkws-if-any}}
-  <tr>
-    <th>{{mkws-translate "Locations"}}</th>
-    <td>
-      {{#mkws-commaList location}}
-        {{mkws-attr "@name"}}{{/mkws-commaList}}
-    </td>
-  </tr>
-</table>
diff --git a/src/mkws-widget-main.templates/Records.handlebars b/src/mkws-widget-main.templates/Records.handlebars
deleted file mode 100644 (file)
index 03ba9a2..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-{{!
-Records from a search.
-
-hits:
-  containerClass - class  attribute for same
-  detailLinkId - id for the element triggering detail display
-  detailClick - a click event handler for details
-  renderedDetails - active record details rendered from the Record template
-  md-* - metadata fields passed through from backend
-}}
-{{#each hits}}
-  <div class="{{containerClass}}">
-    <a href="#" id="{{detailLinkId}}" onclick="{{detailClick}}">
-      <b>{{md-title}}</b>
-    </a>
-    {{#if md-title-remainder}}
-      <span>{{md-title-remainder}}</span>
-    {{/if}}
-    {{#if md-title-responsibility}}
-      <span><i>{{md-title-responsibility}}</i></span>
-    {{/if}}
-    {{#if renderedDetails}}
-      {{{renderedDetails}}}
-    {{/if}}
-  </div>
-{{/each}}
diff --git a/src/mkws-widget-main.templates/Results.handlebars b/src/mkws-widget-main.templates/Results.handlebars
deleted file mode 100644 (file)
index f0d405c..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-{{!
-Results -- compound widget to display search results
-
-team - team for this widget
-}}
-<table width="100%" border="0" cellpadding="6" cellspacing="0">
-  <tr>
-    <td class="mkwsTermlists-Container-wide mkwsTeam_{{team}}" width="250" valign="top">
-      <div class="mkwsTermlists mkwsTeam_{{team}}"></div>
-    </td>
-    <td class="mkwsMOTDContainer mkwsTeam_{{team}}" valign="top">
-      <div class="mkwsRanking mkwsTeam_{{team}}"></div>
-      <div class="mkwsPager mkwsTeam_{{team}}"></div>
-      <div class="mkwsNavi mkwsTeam_{{team}}"></div>
-      <div class="mkwsRecords mkwsTeam_{{team}}"></div>
-    </td>
-  </tr>
-  <tr>
-    <td colspan="2">
-      <div class="mkwsTermlists-Container-narrow mkwsTeam_{{team}}"></div>
-    </td>
-  </tr>
-</table>
-
diff --git a/src/mkws-widget-main.templates/Search.handlebars b/src/mkws-widget-main.templates/Search.handlebars
deleted file mode 100644 (file)
index 5530013..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{{!
-Search form
-
-team - MKWS team
-queryWidth - configured width for search box
-}}
-<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_{{team}}" action="">
-  <input class="mkwsQuery mkwsTeam_{{team}}" type="text" size="{{queryWidth}}">
-  <input class="mkwsButton mkwsTeam_{{team}}" type="submit" value="{{{mkws-translate "Search"}}}">
-</form>
-
diff --git a/src/mkws-widget-main.templates/Stat.handlebars b/src/mkws-widget-main.templates/Stat.handlebars
deleted file mode 100644 (file)
index d8ae997..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{{!
-Search statistics
-
-activeclients - number of targets currently searching
-clients - total targets for this search
-records - number of records returned and available
-hits - number of hits across all targets
-}}
- -- <span class="mkwsClientCount">{{{mkws-translate "Active clients"}}} : {{activeclients}}/{{clients}}</span> -- {{{mkws-translate "Retrieved records"}}} : {{records}}/{{hits}}
diff --git a/src/mkws-widget-main.templates/Switch.handlebars b/src/mkws-widget-main.templates/Switch.handlebars
deleted file mode 100644 (file)
index 2b8e29c..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-{{!
-Switch between record and target view
-
-recordClick - handler to switch to record view
-targetClick - handler to switch to target view
-}}
-<a href="#" onclick="{{{recordClick}}}">{{{mkws-translate "Records"}}}</a>
-<span>|</span>
-<a href="#" onclick="{{{targetClick}}}">{{{mkws-translate "Targets"}}}</a>
diff --git a/src/mkws-widget-main.templates/Targets.handlebars b/src/mkws-widget-main.templates/Targets.handlebars
deleted file mode 100644 (file)
index 99ed801..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-{{!
-Target detail
-
-data:
-  id - target id
-  hits - number of hits for this target
-  diagnostic - 
-  records - 
-  state - target state
-}}
-<table>
-  <thead>
-    <tr>
-      <td>{{{mkws-translate "Target ID"}}}</td>
-      <td>{{{mkws-translate "Hits"}}}</td>
-      <td>{{{mkws-translate "Diags"}}}</td>
-      <td>{{{mkws-translate "Records"}}}</td>
-      <td>{{{mkws-translate "State"}}}</td>
-      </td>
-    </tr>
-  </thead>
-  <tbody>
-  {{#each data}}
-    <tr>
-      <td>{{{id}}}</td>
-      <td>{{hits}}</td>
-      <td>{{diagnostic}}</td>
-      <td>{{records}}</td>
-      <td>{{hits}}</td>
-    </tr>
-  {{/each}}
-  </tbody>
-</table>
diff --git a/src/mkws-widget-termlists.templates/Facet.handlebars b/src/mkws-widget-termlists.templates/Facet.handlebars
deleted file mode 100644 (file)
index 621c9c1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{{!
-A facet in the search.
-
-name - facet identifier, typically English and lowercase
-caption - caption for this facet
-terms:
-  term - term name
-  count - count of items matching in the current search for this team
-  linkdata - attributes to add to the term element including an onclick handler
-}}
-
-<div class="mkwsFacetTitle">{{caption}}</div>
-{{#each terms}}
-  <div class="mkwsTerm">
-    <a href="#" {{{linkdata}}}>{{term}}</a> <span>{{count}}</span>
-  </div>
-{{/each}}
diff --git a/src/mkws-widget-termlists.templates/Termlists.handlebars b/src/mkws-widget-termlists.templates/Termlists.handlebars
deleted file mode 100644 (file)
index 7c6f3b8..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-{{!
-Termlists, a container of all configured facets.
-
-team - the current team
-facets - array of facet names
-}}
-
-<div class="mkwsTermlistsTitle">Termlists</div>
-{{#each facets}}
-  <div class="mkwsFacet mkwsTeam_{{../team}}" data-mkws-facet="{{this}}"></div>
-{{/each}}
diff --git a/src/mkws.templates/Done.handlebars b/src/mkws.templates/Done.handlebars
new file mode 100644 (file)
index 0000000..59a0b4f
--- /dev/null
@@ -0,0 +1,7 @@
+{{!
+Displayed on search completion
+
+count - number of results found
+}}
+{{{mkws-translate "Search complete: found"}}} {{count}} {{{mkws-translate "records"}}}
+
diff --git a/src/mkws.templates/Facet.handlebars b/src/mkws.templates/Facet.handlebars
new file mode 100644 (file)
index 0000000..621c9c1
--- /dev/null
@@ -0,0 +1,17 @@
+{{!
+A facet in the search.
+
+name - facet identifier, typically English and lowercase
+caption - caption for this facet
+terms:
+  term - term name
+  count - count of items matching in the current search for this team
+  linkdata - attributes to add to the term element including an onclick handler
+}}
+
+<div class="mkwsFacetTitle">{{caption}}</div>
+{{#each terms}}
+  <div class="mkwsTerm">
+    <a href="#" {{{linkdata}}}>{{term}}</a> <span>{{count}}</span>
+  </div>
+{{/each}}
diff --git a/src/mkws.templates/Image.handlebars b/src/mkws.templates/Image.handlebars
new file mode 100644 (file)
index 0000000..abee587
--- /dev/null
@@ -0,0 +1,18 @@
+{{!
+Records presented as images.
+
+hits:
+  containerClass - class  attribute for same
+  detailLinkId - id for the element triggering detail display
+  detailClick - a click event handler for details
+  renderedDetails - active record details rendered from the Record template
+  md-* - metadata fields passed through from backend
+}}
+{{#each hits}}
+  <a href="#" id="{{detailLinkId}}" onclick="{{detailClick}}">
+    {{#mkws-first md-thumburl}}
+      <img src="{{this}}" alt="{{../md-title}}"/>
+    {{/mkws-first}}
+    <br/>
+  </a>
+{{/each}}
diff --git a/src/mkws.templates/Lang.handlebars b/src/mkws.templates/Lang.handlebars
new file mode 100644 (file)
index 0000000..26ee6da
--- /dev/null
@@ -0,0 +1,19 @@
+{{!
+Language selection widget
+
+languages
+  code - two character language identifier
+  selected - exists for the current language
+  url - url to switch to this language
+}}
+{{#each languages}}
+  {{~#if selected~}}
+    <span>{{code}}</span>
+  {{~else~}}
+    <a href="{{{url}}}">{{code}}</a>
+  {{~/if~}}
+  {{#unless last}}
+    |
+  {{/unless}}
+{{/each}}
+
diff --git a/src/mkws.templates/Navi.handlebars b/src/mkws.templates/Navi.handlebars
new file mode 100644 (file)
index 0000000..7f3c554
--- /dev/null
@@ -0,0 +1,13 @@
+{{!
+Facet breadcrumbs -- filters on the current search
+
+filters
+  facet - name of facet being limited
+  value - limit to this value
+  click - handler script to remove limit
+}}
+{{#each filters}}
+  {{{mkws-translate facet}}}: <a class="mkwsRemovable" href="#" onclick="{{{click}}}">{{value}}</a>
+  {{#unless @last}}|{{/unless}}
+{{/each}}
+
diff --git a/src/mkws.templates/Pager.handlebars b/src/mkws.templates/Pager.handlebars
new file mode 100644 (file)
index 0000000..3f098e6
--- /dev/null
@@ -0,0 +1,46 @@
+{{!
+Pager
+
+nextClick - handler script for "next" button, only available if there is a next page
+prevClick - handler script for "previous" button if there is a previous page
+moreNext - indicates there are more pages following those displayed
+morePrev - indicates there are more pages preceding
+first - first record displayed
+last - last record displayed
+count - number of records available
+found - number of records found
+pages:
+  number - page number
+  click - script to go to this page unless it is the current one
+}}
+<div style="float: right">
+  {{mkws-translate "Displaying"}}:
+  {{first}} {{mkws-translate "to"}} {{last}}
+  {{mkws-translate "of"}} {{count}} ({{{mkws-translate "found"}}}: {{found}})
+</div>
+
+<div style="float: clear">
+  {{#if prevClick}}
+    <a href="#" class="mkwsPrev" onclick="{{prevClick}}">&#60;&#60; {{{mkws-translate "Prev"}}}</a> |
+  {{else}}
+    <span class="mkwsPrev">&#60;&#60; {{{mkws-translate "Prev"}}}</span> |
+  {{/if}}
+
+  {{#if morePrev}}...{{/if}}
+
+  {{#each pages}}
+    {{#if click}}
+      <a href="#" onclick="{{click}}">{{number}}</a>
+    {{else}}
+      <span class="mkwsCurrentPage">{{number}}</span>
+    {{/if}}
+  {{/each}}
+
+  {{#if moreNext}}...{{/if}}
+
+  {{#if nextClick}}
+    | <a href="#" class="mkwsNext" onclick="{{nextClick}}">{{{mkws-translate "Next"}}} &#62;&#62;</a>
+  {{else}}
+    | <span class="mkwsNext">{{{mkws-translate "Next"}}} &#62;&#62;</span>
+  {{/if}}
+</div>
diff --git a/src/mkws.templates/Progress.handlebars b/src/mkws.templates/Progress.handlebars
new file mode 100644 (file)
index 0000000..1b08a2c
--- /dev/null
@@ -0,0 +1,11 @@
+{{!
+Progress
+
+done - number of targets complete
+waiting - number of targets waiting
+}}
+<span class="mkwsDone">{{#mkws-repeat done}}&#x2588;{{/mkws-repeat}}</span>
+{{~#if waiting~}}
+<span class="mkwsWaiting">{{#mkws-repeat waiting}}&#x2588;{{/mkws-repeat}}</span>
+{{~/if~}}
+
diff --git a/src/mkws.templates/Ranking.handlebars b/src/mkws.templates/Ranking.handlebars
new file mode 100644 (file)
index 0000000..1c823bb
--- /dev/null
@@ -0,0 +1,42 @@
+{{!
+Ranking -- widget to select sort ordering and number of records to display
+
+team - team for this widget
+showSort
+showPerPage
+sort
+  key - machine readable value for this sort option
+  label - text to display for this sort option
+  selected - exists if this sort is selected
+perPage
+  perPage - a number of records per page that can be selected
+  selected - exists if this number is the current selection
+}}
+<form>
+  {{~#if showSort~}}
+    {{{mkws-translate "Sort by"}}}
+    <select class="mkwsSort mkwsTeam_{{team}}">
+      {{#each sort}}
+        {{#if selected}}
+          <option value="{{{key}}}" selected="selected">{{{mkws-translate label}}}</option>
+        {{else}}
+          <option value="{{key}}">{{{mkws-translate label}}}</option>
+        {{/if}}
+      {{/each}}  
+    </select>
+  {{~/if~}}
+  {{~#if showPerPage}}
+    {{{mkws-translate "and show"}}}
+    <select class="mkwsPerpage mkwsTeam_{{team}}">
+      {{#each perPage}}
+        {{#if selected}}
+          <option value="{{perPage}}" selected="selected">{{perPage}}</option>
+        {{else}}
+          <option value="{{perPage}}">{{perPage}}</option>
+        {{/if}}
+      {{/each}}  
+    </select>
+    {{{mkws-translate "per page"}}}
+  {{~/if~}}
+</form>
+
diff --git a/src/mkws.templates/Record.handlebars b/src/mkws.templates/Record.handlebars
new file mode 100644 (file)
index 0000000..f8bf951
--- /dev/null
@@ -0,0 +1,59 @@
+{{!
+Full record display.
+}}
+<table>
+  <tr>
+    <th>{{mkws-translate "Title"}}</th>
+    <td>
+      {{md-title}}
+      {{#if md-title-remainder}}
+        ({{md-title-remainder}})
+      {{/if}}
+      {{#if md-title-responsibility}}
+        <i>{{md-title-responsibility}}</i>
+      {{/if}}
+    </td>
+  </tr>
+  {{#if md-date}}
+  <tr>
+    <th>{{mkws-translate "Date"}}</th>
+    <td>{{md-date}}</td>
+  </tr>
+  {{/if}}
+  {{#if md-author}}
+  <tr>
+    <th>{{mkws-translate "Author"}}</th>
+    <td>{{md-author}}</td>
+  </tr>
+  {{/if}}
+  {{#if md-electronic-url}}
+  <tr>
+    <th>{{mkws-translate "Links"}}</th>
+    <td>
+      {{#each md-electronic-url}}
+        <a href="{{this}}">Link{{mkws-index1}}</a>
+      {{/each}}
+    </td>
+  </tr>
+  {{/if}}
+  {{#mkws-if-any location having="md-subject"}}
+  <tr>
+    <th>{{mkws-translate "Subject"}}</th>
+    <td>
+      {{#mkws-first location having="md-subject"}}
+        {{#if md-subject}}
+          {{#mkws-commaList md-subject}}
+            {{this}}{{/mkws-commaList}}
+        {{/if}}
+      {{/mkws-first}}
+    </td>
+  </tr>
+  {{/mkws-if-any}}
+  <tr>
+    <th>{{mkws-translate "Locations"}}</th>
+    <td>
+      {{#mkws-commaList location}}
+        {{mkws-attr "@name"}}{{/mkws-commaList}}
+    </td>
+  </tr>
+</table>
diff --git a/src/mkws.templates/Records.handlebars b/src/mkws.templates/Records.handlebars
new file mode 100644 (file)
index 0000000..03ba9a2
--- /dev/null
@@ -0,0 +1,26 @@
+{{!
+Records from a search.
+
+hits:
+  containerClass - class  attribute for same
+  detailLinkId - id for the element triggering detail display
+  detailClick - a click event handler for details
+  renderedDetails - active record details rendered from the Record template
+  md-* - metadata fields passed through from backend
+}}
+{{#each hits}}
+  <div class="{{containerClass}}">
+    <a href="#" id="{{detailLinkId}}" onclick="{{detailClick}}">
+      <b>{{md-title}}</b>
+    </a>
+    {{#if md-title-remainder}}
+      <span>{{md-title-remainder}}</span>
+    {{/if}}
+    {{#if md-title-responsibility}}
+      <span><i>{{md-title-responsibility}}</i></span>
+    {{/if}}
+    {{#if renderedDetails}}
+      {{{renderedDetails}}}
+    {{/if}}
+  </div>
+{{/each}}
diff --git a/src/mkws.templates/Results.handlebars b/src/mkws.templates/Results.handlebars
new file mode 100644 (file)
index 0000000..f0d405c
--- /dev/null
@@ -0,0 +1,24 @@
+{{!
+Results -- compound widget to display search results
+
+team - team for this widget
+}}
+<table width="100%" border="0" cellpadding="6" cellspacing="0">
+  <tr>
+    <td class="mkwsTermlists-Container-wide mkwsTeam_{{team}}" width="250" valign="top">
+      <div class="mkwsTermlists mkwsTeam_{{team}}"></div>
+    </td>
+    <td class="mkwsMOTDContainer mkwsTeam_{{team}}" valign="top">
+      <div class="mkwsRanking mkwsTeam_{{team}}"></div>
+      <div class="mkwsPager mkwsTeam_{{team}}"></div>
+      <div class="mkwsNavi mkwsTeam_{{team}}"></div>
+      <div class="mkwsRecords mkwsTeam_{{team}}"></div>
+    </td>
+  </tr>
+  <tr>
+    <td colspan="2">
+      <div class="mkwsTermlists-Container-narrow mkwsTeam_{{team}}"></div>
+    </td>
+  </tr>
+</table>
+
diff --git a/src/mkws.templates/Search.handlebars b/src/mkws.templates/Search.handlebars
new file mode 100644 (file)
index 0000000..5530013
--- /dev/null
@@ -0,0 +1,11 @@
+{{!
+Search form
+
+team - MKWS team
+queryWidth - configured width for search box
+}}
+<form name="mkwsSearchForm" class="mkwsSearchForm mkwsTeam_{{team}}" action="">
+  <input class="mkwsQuery mkwsTeam_{{team}}" type="text" size="{{queryWidth}}">
+  <input class="mkwsButton mkwsTeam_{{team}}" type="submit" value="{{{mkws-translate "Search"}}}">
+</form>
+
diff --git a/src/mkws.templates/Stat.handlebars b/src/mkws.templates/Stat.handlebars
new file mode 100644 (file)
index 0000000..d8ae997
--- /dev/null
@@ -0,0 +1,9 @@
+{{!
+Search statistics
+
+activeclients - number of targets currently searching
+clients - total targets for this search
+records - number of records returned and available
+hits - number of hits across all targets
+}}
+ -- <span class="mkwsClientCount">{{{mkws-translate "Active clients"}}} : {{activeclients}}/{{clients}}</span> -- {{{mkws-translate "Retrieved records"}}} : {{records}}/{{hits}}
diff --git a/src/mkws.templates/Switch.handlebars b/src/mkws.templates/Switch.handlebars
new file mode 100644 (file)
index 0000000..2b8e29c
--- /dev/null
@@ -0,0 +1,9 @@
+{{!
+Switch between record and target view
+
+recordClick - handler to switch to record view
+targetClick - handler to switch to target view
+}}
+<a href="#" onclick="{{{recordClick}}}">{{{mkws-translate "Records"}}}</a>
+<span>|</span>
+<a href="#" onclick="{{{targetClick}}}">{{{mkws-translate "Targets"}}}</a>
diff --git a/src/mkws.templates/Targets.handlebars b/src/mkws.templates/Targets.handlebars
new file mode 100644 (file)
index 0000000..99ed801
--- /dev/null
@@ -0,0 +1,33 @@
+{{!
+Target detail
+
+data:
+  id - target id
+  hits - number of hits for this target
+  diagnostic - 
+  records - 
+  state - target state
+}}
+<table>
+  <thead>
+    <tr>
+      <td>{{{mkws-translate "Target ID"}}}</td>
+      <td>{{{mkws-translate "Hits"}}}</td>
+      <td>{{{mkws-translate "Diags"}}}</td>
+      <td>{{{mkws-translate "Records"}}}</td>
+      <td>{{{mkws-translate "State"}}}</td>
+      </td>
+    </tr>
+  </thead>
+  <tbody>
+  {{#each data}}
+    <tr>
+      <td>{{{id}}}</td>
+      <td>{{hits}}</td>
+      <td>{{diagnostic}}</td>
+      <td>{{records}}</td>
+      <td>{{hits}}</td>
+    </tr>
+  {{/each}}
+  </tbody>
+</table>
diff --git a/src/mkws.templates/Termlists.handlebars b/src/mkws.templates/Termlists.handlebars
new file mode 100644 (file)
index 0000000..7c6f3b8
--- /dev/null
@@ -0,0 +1,11 @@
+{{!
+Termlists, a container of all configured facets.
+
+team - the current team
+facets - array of facet names
+}}
+
+<div class="mkwsTermlistsTitle">Termlists</div>
+{{#each facets}}
+  <div class="mkwsFacet mkwsTeam_{{../team}}" data-mkws-facet="{{this}}"></div>
+{{/each}}