From 0e411544dd2afaafb14b0ee5a66698741915760c Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 10 Jan 2012 12:05:01 +0100 Subject: [PATCH] look changes --- .../templates/dictionary/note_list.html | 3 + apps/infopages/views.py | 13 +++- apps/reporting/templates/reporting/main.html | 6 +- apps/search/views.py | 9 ++- wolnelektury/settings.py | 3 +- wolnelektury/static/css/base.css | 4 +- wolnelektury/static/css/catalogue.css | 20 ++++-- wolnelektury/static/css/header.css | 29 +++++++-- wolnelektury/static/js/base.js | 62 +++++++++++++++++++ wolnelektury/static/js/search.js | 4 +- wolnelektury/templates/base.html | 4 +- .../templates/catalogue/catalogue.html | 5 ++ .../templates/catalogue/search_no_hits.html | 6 +- .../catalogue/tagged_object_list.html | 4 +- 14 files changed, 141 insertions(+), 31 deletions(-) diff --git a/apps/dictionary/templates/dictionary/note_list.html b/apps/dictionary/templates/dictionary/note_list.html index aad0ddfbe..6eac93a89 100755 --- a/apps/dictionary/templates/dictionary/note_list.html +++ b/apps/dictionary/templates/dictionary/note_list.html @@ -10,6 +10,7 @@ {% block body %}

{% trans "Footnotes" %}

+

{% trans "By first letter" %}: @@ -50,4 +51,6 @@ {% endif %} +

+ {% endblock %} diff --git a/apps/infopages/views.py b/apps/infopages/views.py index e1e745148..d5dee7630 100644 --- a/apps/infopages/views.py +++ b/apps/infopages/views.py @@ -3,7 +3,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django.shortcuts import render_to_response, get_object_or_404 -from django.template import RequestContext, Template +from django.template import RequestContext, Template, TemplateSyntaxError from infopages.models import InfoPage @@ -11,8 +11,15 @@ from infopages.models import InfoPage def infopage(request, slug): page = get_object_or_404(InfoPage, slug=slug) rc = RequestContext(request) - left_column = Template(page.left_column).render(rc) - right_column = Template(page.right_column).render(rc) + try: + left_column = Template(page.left_column).render(rc) + except TemplateSyntaxError: + left_column = '' + + try: + right_column = Template(page.right_column).render(rc) + except TemplateSyntaxError: + left_column = '' return render_to_response('infopages/infopage.html', locals(), context_instance=RequestContext(request)) diff --git a/apps/reporting/templates/reporting/main.html b/apps/reporting/templates/reporting/main.html index 3960e79b7..485610dd7 100755 --- a/apps/reporting/templates/reporting/main.html +++ b/apps/reporting/templates/reporting/main.html @@ -10,7 +10,7 @@ {% block body %}

Statystyka

-

Katalog biblioteki w formacie PDF.

+
@@ -26,11 +26,13 @@ {% endfor %}
Utwory
{{ mt.size|filesizeformat }} {{ mt.deprecated }} {% for m in mt.deprecated_files %} -
{{ m }} +
{% book_title m.book %}: {{ m }} {% endfor %}
+
+ {% endblock %} diff --git a/apps/search/views.py b/apps/search/views.py index e73b92a2c..403d1ae3f 100644 --- a/apps/search/views.py +++ b/apps/search/views.py @@ -8,10 +8,9 @@ from django.http import HttpResponse, HttpResponseRedirect, Http404, HttpRespons from django.utils.translation import ugettext as _ from catalogue.utils import get_random_hash -from catalogue.models import Book, Tag, Fragment, TAG_CATEGORIES +from catalogue.models import Book, Tag, Fragment from catalogue.fields import dumps from catalogue.views import JSONResponse -from catalogue import forms from search import Search, JVM, SearchResult from lucene import StringReader from suggest.forms import PublishingSuggestForm @@ -151,13 +150,13 @@ def main(request): elif len(results) == 0: form = PublishingSuggestForm(initial={"books": query + ", "}) return render_to_response('catalogue/search_no_hits.html', - {'tags': tag_list, 'prefix': query, "pubsuggest_form": form, - 'form': forms.SearchForm()}, + {'tags': tag_list, 'prefix': query, + "form": form}, context_instance=RequestContext(request)) return render_to_response('catalogue/search_multiple_hits.html', {'tags': tag_list, 'prefix': query, - 'results': results, 'from': forms.SearchForm()}, + 'results': results}, context_instance=RequestContext(request)) # return render_to_response('newsearch/search.html', {'results': results, diff --git a/wolnelektury/settings.py b/wolnelektury/settings.py index cc09b0b08..71d5474f9 100644 --- a/wolnelektury/settings.py +++ b/wolnelektury/settings.py @@ -219,8 +219,7 @@ COMPRESS_JS = { 'js/search.js', - #~ 'js/jquery.autocomplete.js', - #~ 'js/jquery.labelify.js', 'js/catalogue.js', + 'js/jquery.labelify.js', ), 'output_filename': 'js/base?.min.js', }, diff --git a/wolnelektury/static/css/base.css b/wolnelektury/static/css/base.css index ea729b48c..5ce2f5a78 100755 --- a/wolnelektury/static/css/base.css +++ b/wolnelektury/static/css/base.css @@ -36,12 +36,12 @@ h1 { } .left-column { - width: 48em; + width: 47em; float: left; } .right-column { float:right; - width: 48em; + width: 47em; } .normal-text { font-size: 1.3em; diff --git a/wolnelektury/static/css/catalogue.css b/wolnelektury/static/css/catalogue.css index b75429992..ff7ea4b9c 100755 --- a/wolnelektury/static/css/catalogue.css +++ b/wolnelektury/static/css/catalogue.css @@ -1,15 +1,23 @@ -#books-list ol { +.work-list { margin: 0; padding: 0; list-style: none; } -#books-list li { - display: inline-block; +.work-item { margin: 0; padding: 0; } +.books .work-item { + display: inline-block; +} + + +#tagged-object-list .left-column, #tagged-object-list .right-column { + width: 48em; +} + /* listing of all books */ #book-list { @@ -54,4 +62,8 @@ border-left: 1px #cfcfcf solid; padding: 10px; background-color: white; -} \ No newline at end of file +} + + + +fragment \ No newline at end of file diff --git a/wolnelektury/static/css/header.css b/wolnelektury/static/css/header.css index d941eb61e..9435ad7c0 100755 --- a/wolnelektury/static/css/header.css +++ b/wolnelektury/static/css/header.css @@ -67,23 +67,42 @@ width: 63.1em; padding-left: .5em; padding-right: 0; - padding-top: 0.5em; + padding-top: 0.6em; padding-bottom: 0; } -#search-field input { +#search { + font-size: 1.3em; padding: 0; - height: 3.3em; - border: none; + /*height: 3.3em; width: 62.6em; - font-size: 1em; padding-left: .5em; -webkit-border-radius: .5em; -moz-border-radius: .5em; + border: none; border-radius: .5em; -webkit-box-shadow:0 0 .5em #444 inset; -moz-box-shadow:0 0 .5em #444 inset; + box-shadow: 0 0 .5em #444 inset;*/ + height: 2.54em; + width: 47.47em; + padding-left: 1em; + -webkit-border-radius: .38em; + -moz-border-radius: .38em; + border: none; + border-radius: .38em; + -webkit-box-shadow:0 0 .38em #444 inset; + -moz-box-shadow:0 0 .38em #444 inset; box-shadow: 0 0 .5em #444 inset; + + font-family: Georgia; + background-color: #fff; + color: #000; +} +#search.blur { + font-family: Georgia; + font-style: italic; + color: #888; } #search-button { diff --git a/wolnelektury/static/js/base.js b/wolnelektury/static/js/base.js index 51107fe8b..36a85d06f 100755 --- a/wolnelektury/static/js/base.js +++ b/wolnelektury/static/js/base.js @@ -1,5 +1,67 @@ (function($) { $(function() { + $.fn.toggle_slide = function(p) { + cont = $(this); + short_el = p['short_el'] || $(':first-child', this); + long_el = p['long_el'] || short_el.next(); + button = p['button']; + short_text = p['short_text'], + long_text = p['long_text']; + + var toggle_fun = function(cont, short_el, long_el, button, short_text, long_text) { + var toggle = function() { + if (cont.hasClass('short')) { + cont.animate({"height": long_el.attr("cont_h")+'px'}, {duration: "fast" }).removeClass('short'); + short_el.hide(); + long_el.show(); + if (button && long_text) button.html(long_text); + } else { + cont.animate({"height": short_el.attr("cont_h")+'px'}, {duration: "fast" }).addClass('short'); + long_el.hide(); + short_el.show(); + if (button && short_text) button.html(short_text); + } + return false; + } + return toggle; + } + if (long_el.html().length <= short_el.html().length) + return; + + // ensure long element shown first + long_el.show();short_el.hide(); + long_el.attr("cont_h", $(this).height()).hide(); + short_el.show().attr("cont_h", $(this).height()); + $(this).addClass('short'); + + if (button && short_text) button.html(short_text); + if (button) button.hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#EEE'}); } + ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); + short_el.hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); + long_el.hover( + function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, + function() { $(this).css({background: '#FFF'}); } + ).click(toggle_fun(cont, short_el, long_el, button, short_text, long_text)); + }; + + + // Fragments + $('.fragment-short-text').each(function() { + var fragment = $(this).closest('.fragment'); + fragment.toggle_slide({ + short_el: $(this), + long_el: fragment.find('.fragment-text') + }) + }); + + + + $('#themes-list-toggle').click(function(event) { diff --git a/wolnelektury/static/js/search.js b/wolnelektury/static/js/search.js index c41a672d0..47b6665a6 100644 --- a/wolnelektury/static/js/search.js +++ b/wolnelektury/static/js/search.js @@ -42,8 +42,8 @@ var __bind = function (self, fn) { }); $(function() { - $("#search-area input[name=q]").search(); - + $("#search").search().labelify({labelledClass: "blur"}); }); + })(jQuery); diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html index 04330f232..3ed1984a0 100644 --- a/wolnelektury/templates/base.html +++ b/wolnelektury/templates/base.html @@ -75,16 +75,16 @@
- + +
-
diff --git a/wolnelektury/templates/catalogue/catalogue.html b/wolnelektury/templates/catalogue/catalogue.html index 38403626a..c84ebbbf3 100644 --- a/wolnelektury/templates/catalogue/catalogue.html +++ b/wolnelektury/templates/catalogue/catalogue.html @@ -11,6 +11,11 @@

{% trans "Catalogue" %}

+ +

+ {% trans "Download the catalogue in PDF format." %} +

+

{% trans "Authors" %}

{% tag_list categories.author %} diff --git a/wolnelektury/templates/catalogue/search_no_hits.html b/wolnelektury/templates/catalogue/search_no_hits.html index 3f51559ab..50ad2d33d 100644 --- a/wolnelektury/templates/catalogue/search_no_hits.html +++ b/wolnelektury/templates/catalogue/search_no_hits.html @@ -9,15 +9,17 @@ {% block body %}

{% trans "Search" %}

-
+
+

{% trans "Sorry! Search cirteria did not match any resources." %}

{% blocktrans %}Search engine supports following criteria: title, author, theme/topic, epoch, kind and genre. As for now we do not support full text search.{% endblocktrans %}

{% include "info/join_us.html" %}
+
-
+
{% include "publishing_suggest.html" %}
{% endblock %} diff --git a/wolnelektury/templates/catalogue/tagged_object_list.html b/wolnelektury/templates/catalogue/tagged_object_list.html index 7c33a3740..7d3642fa6 100644 --- a/wolnelektury/templates/catalogue/tagged_object_list.html +++ b/wolnelektury/templates/catalogue/tagged_object_list.html @@ -130,9 +130,9 @@ {% if object_list %} {% spaceless %} -
    +
      {% for book in object_list %} -
    1. +
    2. {% if user_is_owner %} {% trans "Delete" %} {% endif %} -- 2.20.1