+
+
+ // title and link
+ var link = choose_url(hit);
+ if (!link) link = choose_url(hit['location'][0]);
+
+ html += '<h3 class="title">';
+ if (link) html += '<a href="' + link + '" target="_blank" class="title">';
+ html += hit["md-title"];
+ if (hit["md-title-remainder"])
+ html += ' - ' + hit["md-title-remainder"];
+ if (link) html += '</a>';
+ html += '</h3>';
+
+
+ html += '<div class="meta">';
+ // author
+ if (hit["md-author"]) {
+ html += '<span class="creator">' + Drupal.t('By')
+ + ' <em>' + hit['md-author'] + '</em></span> ';
+ } else if (hit['md-title-responsibility']) {
+ html += '<span class="creator">' + ' <em>' + hit['md-title-responsibility'] + '</em></span>';
+ }
+ // date
+ if (hit['md-date']) {
+ html += '<span class="publication_date"> (<em>'
+ + hit['md-date'] + '</em>)</span>';
+ }
+ html += '</div>';
+
+ // journal title
+ html += '<div class="meta">';
+ if (hit["location"] && hit["location"][0] && hit["location"][0]["md-journal-title"]) {
+ html += hit["location"][0]["md-journal-title"];
+ if (hit["location"][0]["md-journal-subpart"]) {
+ html += ' ' + hit["location"][0]["md-journal-subpart"];
+ }
+ } else if (hit["md-journal-title"]) {
+ html += hit["md-journal-title"];
+ if (hit["md-journal-subpart"]) {
+ html += ' ' + hit["md-journal-subpart"];
+ }
+ }
+ html += '</div>';
+
+
+ // description
+ if (hit["md-description"]) {
+ html += '<div class="abstract"><p>';
+ // limit description to 400 characters
+ html += hit["md-description"][0].substr(0, 400);
+ html += '</p></div>';
+ }
+
+
+ // subjects
+ if (hit["location"] && hit["location"][0] && hit["location"][0]["md-subject"]) {
+ html += '<div class="subjects"><h4>'
+ + Drupal.t('Subjects') + ':</h4><ul>';
+ for (var i = 0; i < hit["location"][0]["md-subject"].length; i++) {
+ html += '<li>' + hit["location"][0]["md-subject"][i] + '</li>';
+ }
+ html += '</ul></div>';