Drupal.theme.prototype.mkdruResult = function(hit, num, detailLink) {
+ var link = choose_url(hit);
+ if (!link) link = choose_url(hit['location'][0]);
var html = "";
- html += '<li class="mkdru-result" id="rec_' + hit.recid + '" >'
- + '<span>' + num + '. </span>'
- + '<a href="' + detailLink + '" class="mkdru-result-title">'
- + hit["md-title"] + '</a> ';
- if (hit["md-title-remainder"] !== undefined) {
- html += '<span class="mkdru-result-title-remainder">'
- + hit["md-title-remainder"] + ' </span>';
+ html += '<li class="search-result" id="rec_' + hit.recid + '" >'
+ + '<h3 class="title">';
+ if (link) html += '<a href="'+link+'" target="_blank" >';
+ html += hit["md-title"];
+ if (link) html += '</a>';
+ html += '</h3>';
+ html += '<div class="search-snippet-info">'
+ + '<p class="search-snippet"></p>'
+ + '<div class="ting-object clearfix">'
+ + '<div class="ting-overview clearfix">'
+ + '<div class="left-column left">'
+ + '<div class="picture"></div>'
+ + '</div>'
+ + '<div class="right-column left">';
+ if (hit["md-author"]) {
+ html += '<div class="creator"><span class="byline">By </span>'
+ + '<a class="author" href="/search/meta/'+hit['md-author']+'">'
+ + hit['md-author']+'</a>';
+ if (hit['md-date']) {
+ html += '<span class="date"> ('+hit['md-date']+')</span>';
+ }
+ html += '</div><p></p>';
}
- if (hit["md-title-responsibility"] !== undefined) {
- html += '<span class="mkdru-result-author"><i>'
- + hit["md-title-responsibility"]
- + '</i></span>';
+ html += "</div>";
+ if (hit["md-description"]) {
+ // limit description to 400 characters
+ html += hit["md-description"][0].substr(0, 400);
}
+ html += '</div>'
+ html += '</div>'
+ html += '</div>'
html += '</li>';
return html;
};
return html;
};
-Drupal.theme.prototype.mkdruFacetContainer = function (facetCfg) {
- return "";
+Drupal.theme.prototype.mkdruFacetContainer = function (facetsCfg) {
+ var fs = [];
+ for (var fname in facetsCfg) {
+ facetsCfg[fname].originalKey = fname;
+ fs.push(facetsCfg[fname]);
+ }
+ fs.sort(function (a,b) { return a.orderWeight - b.orderWeight });
+ var html = '<div class="content"><table class="mkdru-facets-table"><tr>';
+ for (var i=0; i<fs.length; i++) {
+ var f = fs[i];
+ html += '<td><fieldset class="form-wrapper">'
+ html += '<legend><span class="fieldset-legend">'+f.displayName
+ +'</span></legend>';
+ html += '<div class="fieldset-wrapper">';
+ html += '<div class="mkdru-facet-'+f.originalKey+'"/>';
+ html += '</div>';
+ html += '</fieldset></td>'
+ }
+ html += '</tr></table></div>';
+ return html;
};