From 9122cfed447a643a8c383be5558fd82fc3be7cc7 Mon Sep 17 00:00:00 2001 From: yvesf Date: Fri, 26 Nov 2010 19:04:25 +0100 Subject: prettify --- .gitignore | 1 + query.py | 21 --------------------- static/logo.png | Bin 0 -> 13557 bytes static/style.css | 23 ++++++++++++----------- templates/_base.html | 32 +++++++++++++++++++------------- templates/search.html | 23 ++++++++++++++++------- 6 files changed, 48 insertions(+), 52 deletions(-) delete mode 100644 query.py create mode 100644 static/logo.png diff --git a/.gitignore b/.gitignore index 9015a7a..7b64245 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ index +*pyc diff --git a/query.py b/query.py deleted file mode 100644 index b9033f3..0000000 --- a/query.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/python2.6 -# coding: utf-8 -from whoosh.index import open_dir -from whoosh.qparser import QueryParser - -index = open_dir(u"index", mapped=False) - - -searcher = index.searcher() - -while True: - term = raw_input("query> ") - query = QueryParser("content").parse(term) - print query - - results = searcher.search(query) - for result in results: - print "Match in {0}".format(result.get("path")) - - print "{0} results".format(len(results)) - diff --git a/static/logo.png b/static/logo.png new file mode 100644 index 0000000..2e2082d Binary files /dev/null and b/static/logo.png differ diff --git a/static/style.css b/static/style.css index 0a036ed..5e767e8 100644 --- a/static/style.css +++ b/static/style.css @@ -1,17 +1,14 @@ div#header { font-size: 150%; } - -div#search { - text-align: center; -} - -div#search span.preSearchField { - font-style: italic; +div#header img { + float: left; } -div#content div#navigation { - text-align: center; +div#search { + position: absolute; + top: 40px; + left: 260px; } div#footer { @@ -35,14 +32,18 @@ div.book div.c_frontpage img.frontpage { overflow-y: visible; } +div.book div.c_frontpage div.loader { + display: none; + text-align: center; + padding-top: 100px; +} + div.book div.c_matches, div.book div.description { margin-left: 260px; padding-left: 5px; } - - div.book div.toolbar { background-color: white; border: 1px solid black; diff --git a/templates/_base.html b/templates/_base.html index ba9e8f2..d6d2010 100644 --- a/templates/_base.html +++ b/templates/_base.html @@ -3,30 +3,36 @@ {% block head %} - + {% block title %}{% endblock %} - booksearch {% block javascript %}{% endblock %} {% endblock %} - -
+
{% block content %}{% endblock %}
diff --git a/templates/search.html b/templates/search.html index dc4cfe8..adbd92d 100644 --- a/templates/search.html +++ b/templates/search.html @@ -18,17 +18,22 @@ ui.newContent.children("div.excerpt").html(data); } ); - /* update image preview */ var frontpage = jQuery(this).parent().parent().find("img.frontpage"); - frontpage.attr('src', "{{ url_for("static", filename="ajax-loader.gif") }}"); + var loader = jQuery(this).parent().parent().find("div.loader"); + frontpage.attr('src', "{{ url_for("do_page_image",docnum=-9999) }}".replace("-9999", docnum)); + frontpage.hide(); + loader.show() frontpage.load(function() { - frontpage.attr('src', "{{ url_for("do_page_image",docnum=-9999) }}".replace("-9999", docnum)); + loader.hide(); + frontpage.show(); }); - - /* scroll image preview */ - var offset = ui.newHeader[0].offsetTop - frontpage.parent()[0].offsetTop; - frontpage.parent().css({paddingTop: offset+"px"}); + }); + acc.bind('accordionchange', function(event, ui) { + /* align image preview to current match */ + var frontpage = jQuery(this).parent().parent().find("img.frontpage"); + var offset = ui.newHeader[0].offsetTop - frontpage.parent()[0].offsetTop; + frontpage.parent().animate({paddingTop: offset}); }); }); @@ -51,6 +56,10 @@
+
+ + Loading.. +
filename, creationtime, indexed-time, +any pdf metadata -- cgit v1.2.1