From c4c1b43e5cdaedec5d7588d6ae82708b25556104 Mon Sep 17 00:00:00 2001
From: Omar Roth <omarroth@hotmail.com>
Date: Sun, 7 Jan 2018 11:43:13 -0600
Subject: [PATCH] Add thumbnail to search

---
 assets/css/custom.css |  9 +++++++++
 src/views/search.ecr  | 13 ++++++++++++-
 2 files changed, 21 insertions(+), 1 deletion(-)
 create mode 100644 assets/css/custom.css

diff --git a/assets/css/custom.css b/assets/css/custom.css
new file mode 100644
index 00000000..2aa91778
--- /dev/null
+++ b/assets/css/custom.css
@@ -0,0 +1,9 @@
+a.link {
+    color: #222;
+    text-decoration: none;
+}
+
+a:hover.link,
+a:active.link {
+    color: #167ac6;
+}
\ No newline at end of file
diff --git a/src/views/search.ecr b/src/views/search.ecr
index 9dedd89f..1b7cadc5 100644
--- a/src/views/search.ecr
+++ b/src/views/search.ecr
@@ -2,5 +2,16 @@
     <%= query.size > 30 ? query[0,30] + "..." : query %>
 <% end %>
 <% videos_list.each do |video| %>
-<p><a href="/watch?v=<%= video.id %>"><%= video.info["title"] %></a></p>
+<div class="pure-g">
+    <div class="pure-u-1 pure-u-md-1-6">
+        <a class="link" href="/watch?v=<%= video.id %>">
+            <img style="width: 90%" src="<%= video.info["thumbnail_url"] %>">
+        </a>
+    </div>
+    <div class="pure-u-1 pure-u-md-5-6">
+        <a style="width: 100%; height:100%; display: block; position: relative" class="link" href="/watch?v=<%= video.id %>">
+            <%= video.info["title"] %>
+        </a>
+    </div>
+</div>
 <% end %>
\ No newline at end of file