look changes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 10 Jan 2012 11:05:01 +0000 (12:05 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 10 Jan 2012 11:05:01 +0000 (12:05 +0100)
14 files changed:
apps/dictionary/templates/dictionary/note_list.html
apps/infopages/views.py
apps/reporting/templates/reporting/main.html
apps/search/views.py
wolnelektury/settings.py
wolnelektury/static/css/base.css
wolnelektury/static/css/catalogue.css
wolnelektury/static/css/header.css
wolnelektury/static/js/base.js
wolnelektury/static/js/search.js
wolnelektury/templates/base.html
wolnelektury/templates/catalogue/catalogue.html
wolnelektury/templates/catalogue/search_no_hits.html
wolnelektury/templates/catalogue/tagged_object_list.html

index aad0ddf..6eac93a 100755 (executable)
@@ -10,6 +10,7 @@
 {% block body %}
     <h1>{% trans "Footnotes" %}</h1>
 
+<div class="normal-text">
 
 <p>
 {% trans "By first letter" %}:
@@ -50,4 +51,6 @@
 
 {% endif %}
 
+</div>
+
 {% endblock %}
index e1e7451..d5dee76 100644 (file)
@@ -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))
index 3960e79..485610d 100755 (executable)
@@ -10,7 +10,7 @@
 {% block body %}
     <h1>Statystyka</h1>
 
-    <p><a href="{% url reporting_catalogue_pdf %}">Katalog biblioteki w formacie PDF.</a></p>
+    <div class="normal-text">
 
     <table class="stats">
         <tr><th>Utwory</th></tr>
                 <td>{{ mt.size|filesizeformat }}</td>
                 <td>{{ mt.deprecated }}
                     {% for m in mt.deprecated_files %}
-                        <br/><a href="{{ m.book.get_absolute_url }}">{{ m }}</a>
+                        <br/><a href="{{ m.book.get_absolute_url }}">{% book_title m.book %}: {{ m }}</a>
                     {% endfor %}
                 </td>
             </tr>
         {% endfor %}
     </table>
 
+    </div>
+
 {% endblock %}
index e73b92a..403d1ae 100644 (file)
@@ -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,
index cc09b0b..71d5474 100644 (file)
@@ -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',
     },
index ea729b4..5ce2f5a 100755 (executable)
@@ -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;
index b754299..ff7ea4b 100755 (executable)
@@ -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
index d941eb6..9435ad7 100755 (executable)
     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 {
index 51107fe..36a85d0 100755 (executable)
@@ -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) {
index c41a672..47b6665 100644 (file)
@@ -42,8 +42,8 @@ var __bind = function (self, fn) {
        });
 
     $(function() {
-       $("#search-area input[name=q]").search();
-       
+        $("#search").search().labelify({labelledClass: "blur"});
     });
 
+
 })(jQuery);
index 04330f2..3ed1984 100644 (file)
             <form id="search-area" action="/fullsearch/">
                 
                 <span id="search-field" class="grid-line">
-                    <input title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">
+                    <input id="search" title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">
                 </span><span id="search-button">
                     <button type='submit'><span class="mono">{% trans "Search" %}</span></button>
                 </span>
                 
+                <div class="clearboth"></div>
             </form>
 
 
 
-            <div class="clearboth"></div>
         </div>
         </div>
 
index 3840362..c84ebbb 100644 (file)
     <h1>{% trans "Catalogue" %}</h1>
 
     <div class="normal-text">
+
+    <p><a href="{% url reporting_catalogue_pdf %}">
+        {% trans "Download the catalogue in PDF format." %}
+    </a></p>
+
     <h2></a>{% trans "Authors" %}<a name="autorzy"></a></h2>
     {% tag_list categories.author %}
 
index 3f51559..50ad2d3 100644 (file)
@@ -9,15 +9,17 @@
 {% block body %}
     <h1>{% trans "Search" %}</h1>
 
-    <div id="books-list">
+    <div class="left-column">
+    <div class="normal-text">
         <p>{% trans "Sorry! Search cirteria did not match any resources." %}</p>
 
                <p>{% 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 %}</p>
         {% include "info/join_us.html" %}
     </div>
+    </div>
 
-    <div class="column-right block-form">
+    <div class="right-column">
         {% include "publishing_suggest.html" %}
     </div>
 {% endblock %}
index 7c33a37..7d3642f 100644 (file)
 
         {% if object_list %}
             {% spaceless %}
-            <ol>
+            <ol class='work-list'>
             {% for book in object_list %}
-                <li>
+                <li class='work-item'>
                     {% if user_is_owner %}
                         <a href="{% url remove_from_shelf last_tag.slug book.slug %}" class="remove-from-shelf">{% trans "Delete" %}</a>
                     {% endif %}