clean dev
authorJan Szejko <jan.szejko@gmail.com>
Tue, 12 Apr 2016 15:18:17 +0000 (17:18 +0200)
committerJan Szejko <jan.szejko@gmail.com>
Tue, 12 Apr 2016 15:18:17 +0000 (17:18 +0200)
src/catalogue/templates/catalogue/plain_list.html
src/catalogue/templates/catalogue/tagged_object_list.html
src/catalogue/views.py
src/wolnelektury/static/img/read-white.png
src/wolnelektury/static/img/read-white.svg
src/wolnelektury/static/scss/main/base.scss
src/wolnelektury/static/scss/main/book_box.scss

index fb2abe0..e26bb7f 100644 (file)
@@ -3,21 +3,21 @@
 
 
 <div class='{% if paged %}plain-list-paged {% endif %}plain-list-container white-box'>
 
 
 <div class='{% if paged %}plain-list-paged {% endif %}plain-list-container white-box'>
-<div class='plain-list' style=''>
-{% for initial, object_list in names %}
-    {% if initial_blocks %}<div class="initial-block">{% endif %}
-    {% if initial %}
+  <div class="pager-center">
+      <div class="pager"></div>
+  </div>
+  <div class='plain-list' style=''>
+    {% for initial, object_list in names %}
+      {% if initial_blocks %}<div class="initial-block">{% endif %}
+      {% if initial %}
         <p class="header">{{ initial }}</p>
         <p class="header">{{ initial }}</p>
-    {% endif %}
-    {% for item in object_list %}
+      {% endif %}
+      {% for item in object_list %}
         <p><a href="{% if book %}{% url 'book_fragments' book.slug item.slug %}{% elif choice %}{% catalogue_url list_type choice item %}{% elif list_type == 'gallery' and item.get_absolute_gallery_url %}{{ item.get_absolute_gallery_url }}{% else %}{{ item.get_absolute_url }}{% endif %}">{{ item }}{% if item.count %}&nbsp;({{ item.count}}){% endif %}</a></p>
         <p><a href="{% if book %}{% url 'book_fragments' book.slug item.slug %}{% elif choice %}{% catalogue_url list_type choice item %}{% elif list_type == 'gallery' and item.get_absolute_gallery_url %}{{ item.get_absolute_gallery_url }}{% else %}{{ item.get_absolute_url }}{% endif %}">{{ item }}{% if item.count %}&nbsp;({{ item.count}}){% endif %}</a></p>
-    {% endfor %}
+      {% endfor %}
     {% if initial_blocks %}</div>{% endif %}
     {% if initial_blocks %}</div>{% endif %}
-{% endfor %}
-</div>
-    <div class="pager-center">
-        <div class="pager"></div>
-    </div>
+    {% endfor %}
+  </div>
 </div>
 
 {% endspaceless %}
 </div>
 
 {% endspaceless %}
index 9af03f5..7603d7b 100644 (file)
@@ -42,6 +42,7 @@
     {% endif %}
 </div>
 
     {% endif %}
 </div>
 
+{% comment %}
 {% if list_type == 'books' and not tags %}
     <section>
         <h1>{% trans "Recent publications" %}</h1>
 {% if list_type == 'books' and not tags %}
     <section>
         <h1>{% trans "Recent publications" %}</h1>
@@ -57,6 +58,7 @@
         {% endfor %}
     </section>
 {% endif %}
         {% endfor %}
     </section>
 {% endif %}
+{% endcomment %}
 
 {% if theme_is_set %}
     {% work_list object_list %}
 
 {% if theme_is_set %}
     {% work_list object_list %}
index 3cd6bc1..98dafc5 100644 (file)
@@ -133,13 +133,14 @@ def object_list(request, objects, fragments=None, related_tags=None, tags=None,
 def literature(request):
     books = Book.objects.filter(parent=None)
 
 def literature(request):
     books = Book.objects.filter(parent=None)
 
-    last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:20]
-    most_popular = Book.objects.exclude(cover_thumb='')\
-                       .order_by('-popularity__count', 'sort_key_author', 'sort_key')[:20]
-    return object_list(request, books, related_tags=get_top_level_related_tags([]), extra={
-        'last_published': last_published,
-        'most_popular': most_popular,
-    })
+    # last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:20]
+    # most_popular = Book.objects.exclude(cover_thumb='')\
+    #                    .order_by('-popularity__count', 'sort_key_author', 'sort_key')[:20]
+    return object_list(request, books, related_tags=get_top_level_related_tags([]))
+    # extra={
+    #     'last_published': last_published,
+    #     'most_popular': most_popular,
+    # })
 
 
 def gallery(request):
 
 
 def gallery(request):
@@ -199,7 +200,7 @@ def theme_list(request, tags, list_type):
         books = Book.tagged.with_all(shelf_tags).order_by()
         fragments = fragments.filter(Q(book__in=books) | Q(book__ancestor__in=books))
 
         books = Book.tagged.with_all(shelf_tags).order_by()
         fragments = fragments.filter(Q(book__in=books) | Q(book__ancestor__in=books))
 
-    if not fragments and len(tags) == 1:
+    if not fragments and len(tags) == 1 and list_type == 'books':
         tag = tags[0]
         if tag.category == 'theme' and (
                 PictureArea.tagged.with_any([tag]).exists() or
         tag = tags[0]
         if tag.category == 'theme' and (
                 PictureArea.tagged.with_any([tag]).exists() or
@@ -221,7 +222,7 @@ def tagged_object_list(request, tags, list_type):
     if list_type == 'gallery' and any(tag.category == 'set' for tag in tags):
         raise Http404
 
     if list_type == 'gallery' and any(tag.category == 'set' for tag in tags):
         raise Http404
 
-    if any(tag.category == 'theme' for tag in tags):
+    if any(tag.category in ('theme', 'thing') for tag in tags):
         return theme_list(request, tags, list_type=list_type)
 
     if list_type == 'books':
         return theme_list(request, tags, list_type=list_type)
 
     if list_type == 'books':
@@ -261,6 +262,7 @@ def book_fragments(request, slug, theme_slug):
         'book': book,
         'theme': theme,
         'fragments': fragments,
         'book': book,
         'theme': theme,
         'fragments': fragments,
+        'active_menu_item': 'books',
     }, context_instance=RequestContext(request))
 
 
     }, context_instance=RequestContext(request))
 
 
@@ -274,6 +276,7 @@ def book_detail(request, slug):
         'book': book,
         'tags': book.tags.exclude(category__in=('set', 'theme')),
         'book_children': book.children.all().order_by('parent_number', 'sort_key'),
         'book': book,
         'tags': book.tags.exclude(category__in=('set', 'theme')),
         'book_children': book.children.all().order_by('parent_number', 'sort_key'),
+        'active_menu_item': 'books',
     }, context_instance=RequestContext(request))
 
 
     }, context_instance=RequestContext(request))
 
 
@@ -329,7 +332,7 @@ def book_text(request, slug):
 
     if not book.has_html_file():
         raise Http404
 
     if not book.has_html_file():
         raise Http404
-    return render_to_response('catalogue/book_text.html', {'book': book,}, context_instance=RequestContext(request))
+    return render_to_response('catalogue/book_text.html', {'book': book}, context_instance=RequestContext(request))
 
 
 # ==========
 
 
 # ==========
index 47f7e17..7db8916 100644 (file)
Binary files a/src/wolnelektury/static/img/read-white.png and b/src/wolnelektury/static/img/read-white.png differ
index 7fd5af1..294d8c7 100644 (file)
@@ -11,7 +11,7 @@
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    version="1.1"
    width="13.0625"
    xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
    version="1.1"
    width="13.0625"
-   height="21"
+   height="9.0397387"
    id="svg6288"
    inkscape:version="0.48.4 r9939"
    sodipodi:docname="read-white.svg"
    id="svg6288"
    inkscape:version="0.48.4 r9939"
    sodipodi:docname="read-white.svg"
@@ -33,7 +33,7 @@
      showgrid="false"
      inkscape:zoom="11.271642"
      inkscape:cx="6.426905"
      showgrid="false"
      inkscape:zoom="11.271642"
      inkscape:cx="6.426905"
-     inkscape:cy="15.412616"
+     inkscape:cy="10.355676"
      inkscape:window-x="0"
      inkscape:window-y="24"
      inkscape:window-maximized="1"
      inkscape:window-x="0"
      inkscape:window-y="24"
      inkscape:window-maximized="1"
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
         <dc:format>image/svg+xml</dc:format>
         <dc:type
            rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
-        <dc:title></dc:title>
+        <dc:title />
       </cc:Work>
     </rdf:RDF>
   </metadata>
   <g
       </cc:Work>
     </rdf:RDF>
   </metadata>
   <g
-     transform="translate(-258.99199,-645.65414)"
+     transform="translate(-258.99199,-652.55746)"
      id="layer1"
      style="fill:#ffffff">
     <g
      id="layer1"
      style="fill:#ffffff">
     <g
index 3d1097f..48c63fe 100755 (executable)
@@ -176,15 +176,13 @@ ul.plain {
         border-bottom-right-radius: 4px;
       }
     }
         border-bottom-right-radius: 4px;
       }
     }
-    .active {
-      > a, span {
-        &, &:hover, &:focus {
-          z-index: 2;
-          color: #fff;
-          cursor: default;
-          background-color: #337ab7;
-          border-color: #337ab7;
-        }
+    .current {
+      &, &:hover, &:focus {
+        z-index: 2;
+        color: #fff;
+        cursor: default;
+        background-color: #337ab7;
+        border-color: #337ab7;
       }
     }
     .disabled {
       }
     }
     .disabled {
index 084c278..bf87d75 100755 (executable)
       @include size(margin-right, 3.71px);
       vertical-align: middle;
       font-weight: normal;
       @include size(margin-right, 3.71px);
       vertical-align: middle;
       font-weight: normal;
+      // ugly quick fix
+      position: relative;
+      bottom: 2px;
     }
   }
 
     }
   }