Initial commit with results/pager/status styled
authorJakub Skoczen <jakub@indexdata.dk>
Wed, 2 Mar 2011 13:41:20 +0000 (14:41 +0100)
committerJakub Skoczen <jakub@indexdata.dk>
Wed, 2 Mar 2011 13:41:20 +0000 (14:41 +0100)
Ding2 seems to have no actuall theme yet, so this is mostly bartik-like

css/mkdruding2.css [new file with mode: 0644]
mkdruding2.info [new file with mode: 0644]
mkdruding2.js [new file with mode: 0644]
template.php [new file with mode: 0644]
templates/mkdru-results.tpl.php [new file with mode: 0644]

diff --git a/css/mkdruding2.css b/css/mkdruding2.css
new file mode 100644 (file)
index 0000000..804dfc3
--- /dev/null
@@ -0,0 +1,29 @@
+.mkdru-result-description {
+  font-size: 0.8em;
+}
+
+.mkdru-pager-container {
+  text-align: center;
+  background-color: #F6F6F2;
+  border-color: #F9F9F9;
+  padding: 3px 5px 3px 5px;
+}
+
+.mkdru-pager-inner-container {
+  border-top: 1px solid #D6D6D6;
+  border-bottom: 1px solid #D6D6D6;
+  padding: 5px 0px 5px 0px;
+}
+
+.mkdru-status-container {
+  background-color: #F6F6F2;
+  border-color: #F9F9F9;
+  padding: 3px 5px 3px 5px;
+}
+
+.mkdru-status-inner-container {
+  border-top: 1px solid #D6D6D6;
+  border-bottom: 1px solid #D6D6D6;
+  padding: 5px 0px 5px 0px;
+}
+
diff --git a/mkdruding2.info b/mkdruding2.info
new file mode 100644 (file)
index 0000000..7f603d3
--- /dev/null
@@ -0,0 +1,27 @@
+name = Ding2-like mkdru theme
+description = Style metasearch results like the results from the data-well
+core = 7.x
+base theme = bartik
+
+stylesheets[all][] = css/mkdruding2.css
+
+regions[header] = Header
+regions[help] = Help
+regions[page_top] = Page top
+regions[page_bottom] = Page bottom
+regions[highlighted] = Highlighted
+
+regions[featured] = Featured
+regions[content] = Content
+regions[sidebar_first] = Sidebar first
+regions[sidebar_second] = Sidebar second
+
+regions[triptych_first] = Triptych first
+regions[triptych_middle] = Triptych middle
+regions[triptych_last] = Triptych last
+
+regions[footer_firstcolumn] = Footer first column
+regions[footer_secondcolumn] = Footer second column
+regions[footer_thirdcolumn] = Footer third column
+regions[footer_fourthcolumn] = Footer fourth column
+regions[footer] = Footer
diff --git a/mkdruding2.js b/mkdruding2.js
new file mode 100644 (file)
index 0000000..e601817
--- /dev/null
@@ -0,0 +1,35 @@
+Drupal.theme.mkdruResult = function(hit, num, detailLink) {
+  var html = "";
+  html += '<li class="search-result" id="rec_' + hit.recid + '" >'
+    + '<h3 class="title">'
+    + '<a href="' + hit['location'][0]['md-electronic-url'] 
+    + '" target="_blank" >'
+    + hit["md-title"] + '</a></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>';
+  }
+  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;
+};
diff --git a/template.php b/template.php
new file mode 100644 (file)
index 0000000..aa215d8
--- /dev/null
@@ -0,0 +1,6 @@
+<?php 
+function mkdruding2_preprocess_page(&$vars, $hook) {
+  //wouold be nice to include this only during search hook
+  drupal_add_js(drupal_get_path('theme', 'mkdruding2') . '/mkdruding2.js');
+}
+
diff --git a/templates/mkdru-results.tpl.php b/templates/mkdru-results.tpl.php
new file mode 100644 (file)
index 0000000..b3550de
--- /dev/null
@@ -0,0 +1,18 @@
+<div class="mkdru-detail"></div>
+<div class="mkdru-results">
+  <div class="mkdru-above mkdru-above-below mkdru-status-container">
+    <div class="mkdru-status-inner-container">
+      <span class="mkdru-counts"></span>
+      <span class="mkdru-status"></span>
+    </div>
+  </div>
+  <div class="mkdru-navi"></div>
+  <ul class="mkdru-result-list search-results">
+  </ul>
+  <div class="mkdru-below mkdru-above-below mkdru-pager-container">
+    <div class="mkdru-pager-inner-container">
+      <span class="mkdru-pager">
+      </span>
+    </div>
+  </div>
+</div>