Filter menu items
authorRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Tue, 14 Jan 2014 11:23:04 +0000 (12:23 +0100)
committerRadek Czajka <radekczajka@nowoczesnapolska.org.pl>
Tue, 14 Jan 2014 11:23:04 +0000 (12:23 +0100)
apps/catalogue/templates/catalogue/book_text.html
apps/catalogue/templates/catalogue/tag_list_split.html
apps/wolnelektury_core/static/js/base.js
apps/wolnelektury_core/static/scss/book_text/body.scss
apps/wolnelektury_core/static/scss/main/header.scss

index e4ed91f..37a8a1e 100644 (file)
@@ -9,7 +9,7 @@
 
 {% block menu %}
 <li><a href="{{ book.get_absolute_url }}" id="menu-book" data-box="book-short">
-    <img src="{% thumbnail book.cover '80x111' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover.url }}{% endthumbnail %}"
+    <img src="{% thumbnail book.cover_thumb '80x111' as thumb %}{{ thumb.url }}{% empty %}{{ book.cover_thumb.url }}{% endthumbnail %}"
         width="80" height="111"
         alt="{{ book.pretty_title }}"
         title="{{ book.pretty_title }}">
index 5dcf783..a26459c 100644 (file)
@@ -1,18 +1,14 @@
 {% load i18n %}
 {% if books %}
-<div class="simple-toggler-scope">
-<p class="mono">
-  <a href="#" class="simple-toggler">{% trans "Literature" %}&nbsp;↓</a>
+<p>
+  <a href="#">{% trans "Literature" %}:</a>
 </p>
-<div class="simple-hidden-box simple-hidden-initially">{{books|safe}}</div>
-</div>
+<div>{{books|safe}}</div>
 {% endif %}
 
 {% if pictures %}
-<div class="simple-toggler-scope">
-<p class="mono">
-  <a href="#" class="simple-toggler">{% trans "Gallery" %}&nbsp;↓</a>
+<p>
+  <a href="#">{% trans "Gallery" %}:</a>
 </p>
-<div class="simple-hidden-box simple-hidden-initially">{{pictures|safe}}</div>
-</div>
+<div>{{pictures|safe}}</div>
 {% endif %}
index 9ba5631..4b6c5d3 100755 (executable)
                                 dataType: "json",
                             }).done(function(data) {
                                 $.each(data, function(index, value) {
-                                    $('#menu-' + index).html(value);
+                                    var $menuitem = $('#menu-' + index);
+                                    $menuitem.html(value);
+                                    var $minisearch = $("<input class='mini-search' style='margin-bottom: 1em' />");
+                                    $minisearch.keyup(function() {
+                                        var s = $(this).val().toLowerCase();
+                                        if (s) {
+                                            $("li", $menuitem).each(function() {
+                                                if ($("a", this).text().toLowerCase().indexOf(s) != -1)
+                                                    $(this).show();
+                                                else $(this).hide();
+                                            });
+                                        }
+                                        else {
+                                            $("li", $menuitem).css("display", "");
+                                        }
+                                    });
+                                    $menuitem.prepend($minisearch);
                                 });
                                 menu_loaded = true;
                             });
                                        if (p == $current)
                                                return;
                                        if (p.hasClass('hidden-box-trigger') 
-                                           || p.hasClass('simple-toggler'))
+                                           || p.hasClass('simple-toggler')
+                        || p.hasClass('mini-search'))
                                                return;
                                        p = p.parent();
                                }
index 2f1710d..912d55b 100644 (file)
@@ -3,8 +3,6 @@
  * Everything besides the menu.
  */
 #big-pane {
-    display: flex;
-    flex-direction: row;
     justify-content: left;
     position: relative;
     @include min-screen($W_BOOK_TEXT_MAX) {
 }
 
 .with-other-text {
+    #big-pane {
+        display: flex;
+        flex-direction: row;
+    }
     #main-text, #other-text {
         @include right-without-themes;
 
index 770e43b..63bd867 100755 (executable)
@@ -37,6 +37,8 @@ header#main {
     background-color: $header_bg;
     color: #bbb;
 
+    text-align:center;
+
     @media screen and (min-width: 62.5em) {
         position: relative;
         @include size(height, 94px);
@@ -51,15 +53,11 @@ header#main {
     #logo {
         display: block;
         @include size(height, 94px);
-        @include size(width, 94px);
 
         @media screen and (min-width: 24em) {
+            @include size(width, 173px);
             float: left;
         }
-
-        img {
-            display: block;
-        }
     }
 
     #tagline {