From: Radek Czajka Date: Wed, 28 Dec 2011 16:29:37 +0000 (+0100) Subject: publishing plan, plus some layout fixes X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/6c071c6cbb739209e9d8488ff7080f8ad7c7d2d0?hp=76fc2ed0abc7ff4bb7ddee798a115f11bf51ee1c publishing plan, plus some layout fixes --- diff --git a/wolnelektury/static/css/base.css b/wolnelektury/static/css/base.css index f55a39e01..d7be8e395 100755 --- a/wolnelektury/static/css/base.css +++ b/wolnelektury/static/css/base.css @@ -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; diff --git a/wolnelektury/static/css/book_box.css b/wolnelektury/static/css/book_box.css index ca2e72696..272f558b3 100755 --- a/wolnelektury/static/css/book_box.css +++ b/wolnelektury/static/css/book_box.css @@ -109,19 +109,33 @@ .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; } diff --git a/wolnelektury/static/css/header.css b/wolnelektury/static/css/header.css index 79e8815d6..71dd09c95 100755 --- a/wolnelektury/static/css/header.css +++ b/wolnelektury/static/css/header.css @@ -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; diff --git a/wolnelektury/static/fonts/WL-Nav.ttf b/wolnelektury/static/fonts/WL-Nav.ttf index 05282b866..e73dedf6f 100644 Binary files a/wolnelektury/static/fonts/WL-Nav.ttf and b/wolnelektury/static/fonts/WL-Nav.ttf differ diff --git a/wolnelektury/static/fonts/WL.ttf b/wolnelektury/static/fonts/WL.ttf index 7feb6b403..6a8934a1b 100644 Binary files a/wolnelektury/static/fonts/WL.ttf and b/wolnelektury/static/fonts/WL.ttf differ diff --git a/wolnelektury/templates/catalogue/book_short.html b/wolnelektury/templates/catalogue/book_short.html index c80efff91..524617425 100644 --- a/wolnelektury/templates/catalogue/book_short.html +++ b/wolnelektury/templates/catalogue/book_short.html @@ -60,7 +60,7 @@
  • {% if book.has_mp3_file %} - {% trans "Audiobook" %} + {% trans "Listen" %} {% endif %}
  • diff --git a/wolnelektury/templates/main_page.html b/wolnelektury/templates/main_page.html index 2a63ed57c..002d45bc0 100755 --- a/wolnelektury/templates/main_page.html +++ b/wolnelektury/templates/main_page.html @@ -60,6 +60,7 @@
  • {% trans "Widget" %}
  • {% trans "Public domain counter" %}
  • {% trans "Missing a book?" %}
  • +
  • {% trans "Publishing plan" %}
  • diff --git a/wolnelektury/templates/publish_plan.html b/wolnelektury/templates/publish_plan.html new file mode 100755 index 000000000..2a6d90a8d --- /dev/null +++ b/wolnelektury/templates/publish_plan.html @@ -0,0 +1,16 @@ +{% extends "base.html" %} +{% load i18n %} + +{% block titleextra %}{% trans "Publishing plan" %}{% endblock titleextra %} + + +{% block body %} +

    {% trans "Publishing plan" %}

    + + + +{% endblock %} diff --git a/wolnelektury/urls.py b/wolnelektury/urls.py index 4ec1b3713..63a49eca6 100644 --- a/wolnelektury/urls.py +++ b/wolnelektury/urls.py @@ -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'), diff --git a/wolnelektury/views.py b/wolnelektury/views.py index 0af07f454..3fa4337af 100755 --- a/wolnelektury/views.py +++ b/wolnelektury/views.py @@ -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))