publishing plan, plus some layout fixes
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 28 Dec 2011 16:29:37 +0000 (17:29 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Wed, 28 Dec 2011 16:29:37 +0000 (17:29 +0100)
wolnelektury/static/css/base.css
wolnelektury/static/css/book_box.css
wolnelektury/static/css/header.css
wolnelektury/static/fonts/WL-Nav.ttf
wolnelektury/static/fonts/WL.ttf
wolnelektury/templates/catalogue/book_short.html
wolnelektury/templates/main_page.html
wolnelektury/templates/publish_plan.html [new file with mode: 0755]
wolnelektury/urls.py
wolnelektury/views.py

index f55a39e..d7be8e3 100755 (executable)
@@ -90,6 +90,7 @@ h2 {
     -moz-box-shadow: 2px 2px 2px #ddd;
     -webkit-box-shadow: 2px 2px 2px #ddd;
     box-shadow: 2px 2px 2px #ddd;
+    z-index: 500;
 }
 #themes-list ul {
     list-style: none;
index ca2e726..272f558 100755 (executable)
 .book-box-tools {
     font-size: 1.1em;
 }
-.book-box-tools a:before {
+.book-box-read a:before {
+    content: "\2609";
+    font-family: WL-Nav;
+    font-size: 2.25em;
+    margin-right: .15em;
+    vertical-align: middle;
+}
+.book-box-download a:before {
     content: "⇩";
     font-family: WL-Nav;
-    font-size: 2em;
-    margin-right: .25em;
+    font-size: 2.25em;
+    margin-right: .15em;
+    vertical-align: middle;
+}
+.book-box-audiobook a:before {
+    content: "\266B";
+    font-family: WL-Nav;
+    font-size: 2.25em;
+    margin-right: .15em;
     vertical-align: middle;
 }
 .book-box-read {
-    width: 11em;
+    width: 11.5em;
 }
 .book-box-download {
-    width: 8em;
+    width: 8.5em;
 }
 .book-box-audiobook {
-    width: 8em;
+    width: 7em;
 }
index 79e8815..71dd09c 100755 (executable)
@@ -66,8 +66,8 @@
     display: inline-block;
     width: 63.1em;
     padding-left: .5em;
-    padding-right: .5em;
-    padding-top: 0;
+    padding-right: 0;
+    padding-top: 0.5em;
     padding-bottom: 0;
 }
 
@@ -75,7 +75,7 @@
     padding: 0;
     height: 3.3em;
     border: none;
-    width: 62.6em;
+    width: 63.1em;
     font-size: 1em;
     padding-left: .5em;
     -webkit-border-radius: .5em;
@@ -92,6 +92,7 @@
     padding: 0;
     margin: 0;
     width: 9.4em;
+    float: right;
 }
 #search-button button {
     font-size: 1em;
index 05282b8..e73dedf 100644 (file)
Binary files a/wolnelektury/static/fonts/WL-Nav.ttf and b/wolnelektury/static/fonts/WL-Nav.ttf differ
index 7feb6b4..6a8934a 100644 (file)
Binary files a/wolnelektury/static/fonts/WL.ttf and b/wolnelektury/static/fonts/WL.ttf differ
index c80efff..5246174 100644 (file)
@@ -60,7 +60,7 @@
         </li>
         <li class="book-box-audiobook">
         {% if book.has_mp3_file %}
-            <a href="" class="mono">{% trans "Audiobook" %}</a>
+            <a href="" class="mono">{% trans "Listen" %}</a>
         {% endif %}
         </li>
     </ul>
index 2a63ed5..002d45b 100755 (executable)
@@ -60,6 +60,7 @@
             <li><a href="{% url infopage "widget" %}">{% trans "Widget" %}</a></li>
             <li><a href="">{% trans "Public domain counter" %}</a></li>
             <li><a href="{% url suggest_publishing %}" id="suggest-publishing" class="ajaxable">{% trans "Missing a book?" %}</a></li>
+            <li><a href="{% url publish_plan %}">{% trans "Publishing plan" %}</a></li>
         </ul>
     </div>
 
diff --git a/wolnelektury/templates/publish_plan.html b/wolnelektury/templates/publish_plan.html
new file mode 100755 (executable)
index 0000000..2a6d90a
--- /dev/null
@@ -0,0 +1,16 @@
+{% extends "base.html" %}
+{% load i18n %}
+
+{% block titleextra %}{% trans "Publishing plan" %}{% endblock titleextra %}
+
+
+{% block body %}
+<h1>{% trans "Publishing plan" %}</h1>
+
+<ul>
+{% for elem in plan %}
+    <li><a href="{{ elem.link }}">{{ elem.title }}</a></li>
+{% endfor %}
+</ul>
+
+{% endblock %}
index 4ec1b37..63a49ec 100644 (file)
@@ -11,6 +11,7 @@ admin.autodiscover()
 
 urlpatterns = patterns('wolnelektury.views',
     url(r'^$', 'main_page', name='main_page'),
+    url(r'^planowane/$', 'publish_plan', name='publish_plan'),
 
     url(r'^zegar/$', 'clock', name='clock'),
 
index 0af07f4..3fa4337 100755 (executable)
@@ -1,13 +1,15 @@
 from datetime import datetime
+import feedparser
 
 from django.contrib import auth
 from django.contrib.auth.forms import UserCreationForm, AuthenticationForm
+from django.core.cache import cache
 from django.http import HttpResponse, HttpResponseRedirect
 from django.shortcuts import render_to_response
 from django.template import RequestContext
 from django.utils.http import urlquote_plus
 from django.utils.translation import ugettext_lazy as _
-from django.views.decorators import cache
+from django.views.decorators.cache import never_cache
 
 from ajaxable.utils import AjaxableFormView
 from catalogue.models import Book
@@ -55,7 +57,7 @@ class RegisterFormView(AjaxableFormView):
         auth.login(request, user)
 
 
-@cache.never_cache
+@never_cache
 def logout_then_redirect(request):
     auth.logout(request)
     return HttpResponseRedirect(urlquote_plus(request.GET.get('next', '/'), safe='/?='))
@@ -66,3 +68,26 @@ def clock(request):
     in a format suitable for Date.parse()
     """
     return HttpResponse(datetime.now().strftime('%Y/%m/%d %H:%M:%S'))
+
+
+def publish_plan(request):
+    cache_key = "publish_plan"
+    plan = cache.get(cache_key)
+
+    if plan is None:
+        plan = []
+        try:
+            feed = feedparser.parse('http://localhost:8000/documents/track/editor-proofreading/')
+        except:
+            pass
+        else:
+            for i in range(len(feed['entries'])):
+                print i
+                plan.append({
+                    'title': feed['entries'][i].title,
+                    'link': feed['entries'][i].link,
+                    })
+        cache.set(cache_key, plan, 1800)
+
+    return render_to_response("publish_plan.html", {'plan': plan},
+        context_instance=RequestContext(request))