From 4eb2cdda0c6110fb1dfcde4cdd1076a61192ca1f Mon Sep 17 00:00:00 2001 From: Benjamin Attal Date: Tue, 27 May 2014 13:13:19 -0400 Subject: [PATCH] Results styling --- static/js/index.js | 7 ++----- static/sass/index.sass | 23 +++++++++++++++++++---- templates/index.html | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/static/js/index.js b/static/js/index.js index b8b0ad4..875e2ca 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -27,6 +27,7 @@ var testCodelet = { [17, -1, 17, -1] ]] ] }, + 'origin': ['GitHub', 'https://github.com', ''], 'authors': ['sevko', 'earwig'], 'html_code': codeExample }; @@ -154,12 +155,9 @@ function createResult(codelet) { authors.id = 'authors'; //Add the bulk of the html - var hostUrl = codelet.code_url.match(/htt(p|ps):\/\/\w+\.\w+/)[0], - hostName = hostUrl.split('://')[1].split('.')[0]; - title.innerHTML = 'File ' + codelet.filename + ''; - site.innerHTML = 'on ' + hostName +''; + site.innerHTML = 'on ' + codelet.origin[0] +''; dateModified.innerHTML = 'Last modified ' + codelet.date_modified; // Needs to be changed from int to string on the server language.innerHTML = codelet.language; @@ -187,7 +185,6 @@ function createResult(codelet) { displayInfo.appendChild(title); displayInfo.appendChild(site); - displayInfo.appendChild(dateModified); hiddenInfo.appendChild(dateCreated); hiddenInfo.appendChild(language); diff --git a/static/sass/index.sass b/static/sass/index.sass index cb8ba7c..8c8ec32 100644 --- a/static/sass/index.sass +++ b/static/sass/index.sass @@ -104,8 +104,22 @@ div#results width: 80% /* TODO: - 1) On the side - - add way to cycle through hits in the code.*/ + 1) Sidebar + - Add way to cycle through hits in the code. + 2) Hidden info + - Use effect to make it transition into view. + - Add date modified. + - Get rid of symbols matches. + - Don't use monospace. + - Add links for authors. + - Cross out search terms based on what's in the codelet. + 3) Header + - Remove date modified. + - Make the title bigger. + - Add an icon for the website. + - Change the spacing. + 4) Code body + - Add highlighting.*/ div.result width: $resultWidth height: 200px @@ -126,8 +140,8 @@ div#results text-transform: capitalize #date-modified - font-family: monospace - color: #333 + font-style: italic + color: #777 display: block table @@ -168,6 +182,7 @@ div#results width: $hiddenInfoWidth text-align: center font-size: 1.2em + font-family: monospace #date-created display: block diff --git a/templates/index.html b/templates/index.html index aa95add..c2912c3 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,7 +6,7 @@ = block head {{ assets.tag("index.css") }} - {{ assets.tag("highlight.css") }} + {{ assets.tag("lib/highlight.css") }} {{ assets.tag("jquery.min.js") }} = endblock