Log the actual query when a search is submitted.
[mkws-moved-to-github.git] / tools / htdocs / mkws.js
index c11738a..b6f059e 100644 (file)
@@ -281,23 +281,9 @@ function renderSummary(hit)
        loadTemplate("Summary");
     }
 
-    if (mkws.templateSummary) {
-       hit._id = "mkwsRec_" + hit.recid;
-       hit._onclick = "mkws.showDetails(this.id);return false;"
-       return mkws.templateSummary(hit);
-    } else {
-       var html = [];
-       html.push('<a href="#" id="mkwsRec_'+hit.recid
-                 +'" onclick="mkws.showDetails(this.id);return false;"><b>'
-                 + hit["md-title"] +' </b></a>');
-       if (hit["md-title-remainder"] !== undefined) {
-           html.push('<span>' + hit["md-title-remainder"] + ' </span>');
-       }
-       if (hit["md-title-responsibility"] !== undefined) {
-           html.push('<span><i>'+hit["md-title-responsibility"]+'</i></span>');
-       }
-       return html.join('');
-    }
+    hit._id = "mkwsRec_" + hit.recid;
+    hit._onclick = "mkws.showDetails(this.id);return false;"
+    return mkws.templateSummary(hit);
 }
 
 
@@ -463,7 +449,7 @@ function triggerSearch ()
        }
     }
 
-    debug("triggerSearch: filters = " + JSON.stringify(mkws.filters) + ", pp2filter = " + pp2filter + ", pp2limit = " + pp2limit);
+    debug("triggerSearch(" + document.mkwsSearchForm.mkwsQuery.value + "): filters = " + JSON.stringify(mkws.filters) + ", pp2filter = " + pp2filter + ", pp2limit = " + pp2limit);
     my_paz.search(document.mkwsSearchForm.mkwsQuery.value, recPerPage, curSort, pp2filter, undefined, { limit: pp2limit });
 }
 
@@ -796,6 +782,18 @@ function defaultTemplate(name)
        </tr>\
       </table>\
 ';
+    } else if (name === "Summary") {
+       return '\
+      <a href="#" id="{{_id}}" onclick="{{_onclick}}">\
+       <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}}\
+';
     }
 
     var s = "There is no default '" + name +"' template!";