From 79e33481a9b21af1100d619549361ac4df93c975 Mon Sep 17 00:00:00 2001
From: Jorge Solorzano <jorsol@ongres.com>
Date: Tue, 5 Jun 2018 00:39:31 -0600
Subject: [PATCH] Improve style of list search results using Bootstrap Card

---
 templates/search/listsearch.html | 13 ++++++++-----
 templates/search/sitesearch.html | 11 +++++++----
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/templates/search/listsearch.html b/templates/search/listsearch.html
index 7c7ead8..071b0d3 100644
--- a/templates/search/listsearch.html
+++ b/templates/search/listsearch.html
@@ -53,11 +53,14 @@
     <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount == 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
     {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
     {%for hit in hits %}
-      {{forloop.counter0|add:firsthit}}. <a href="https://www.postgresql.org/message-id/{{hit.messageid}}">{{hit.subject}}</a> [{{hit.rank|floatformat:2}}]<br/>
-      From {{hit.author}} on {{hit.date}}.<br/>
-      {{hit.abstract|safe}}<br/>
-      <a href="https://www.postgresql.org/message-id/{{hit.messageid}}">https://www.postgresql.org/message-id/{{hit.messageid}}</a><br/>
-      <br/>
+    <div class="card border-0" style="max-width: 65%;">
+      <div class="card-body">
+        <h5 class="card-title" style="text-transform: none; font-size:1.2em">{{forloop.counter0|add:firsthit}}. <a class="card-link" href="https://www.postgresql.org/message-id/{{hit.messageid}}">{{hit.subject}}</a> [{{hit.rank|floatformat:2}}]</h5>
+        <h6 class="card-subtitle mb-2 text-muted" style="text-transform: none; font-size:1.0em">From {{hit.author|escape}} on {{hit.date}}</h6>
+        <p class="card-text">{{hit.abstract|safe}}</p>
+        <a href="https://www.postgresql.org/message-id/{{hit.messageid}}" class="card-link" style="font-size:0.8em">https://www.postgresql.org/message-id/{{hit.messageid}}</a>
+      </div>
+    </div>
     {%endfor%}
     {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
   {%endif%}
diff --git a/templates/search/sitesearch.html b/templates/search/sitesearch.html
index bb40a76..835d610 100644
--- a/templates/search/sitesearch.html
+++ b/templates/search/sitesearch.html
@@ -37,10 +37,13 @@
  <h2>Results {{firsthit}}-{{lasthit}} of {%if hitcount == 1000%}more than 1000{%else%}{{hitcount}}{%endif%}.</h2>
  {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
  {%for hit in hits %}
-  {{forloop.counter0|add:firsthit}}. <a href="{{hit.url}}">{{hit.title}}</a> [{{hit.rank|floatformat:2}}]<br/>
-  <div>...{{hit.abstract|safe}}...</div>
-  <a href="{{hit.url}}">{{hit.url}}</a><br/>
-  <br/>
+  <div class="card border-0" style="max-width: 65%;">
+    <div class="card-body">
+      <h5 class="card-title" style="text-transform: none; font-size:1.2em">{{forloop.counter0|add:firsthit}}. <a href="{{hit.url}}">{{hit.title}}</a> [{{hit.rank|floatformat:2}}]</h5>
+      <p class="card-text">...{{hit.abstract|safe}}...</p>
+      <a href="{{hit.url}}" class="card-link" style="font-size:0.8em">{{hit.url}}</a>
+    </div>
+  </div>
  {%endfor%}
  {%if pagelinks %}Result pages: {{pagelinks|safe}}<br/><br/>{%endif%}
 {%endif%}
-- 
2.17.0

