Add mock Search class for development.
[wolnelektury.git] / apps / wolnelektury_core / views.py
index f8de19e..80156bf 100644 (file)
@@ -1,3 +1,7 @@
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
 from datetime import datetime
 import feedparser
 
@@ -16,11 +20,12 @@ from django.conf import settings
 from ajaxable.utils import AjaxableFormView
 from catalogue.models import Book
 from ajaxable.utils import placeholdized
+from social.templatetags.social_tags import choose_cite
 
 
-@never_cache
 def main_page(request):
-    last_published = Book.objects.filter(parent=None).order_by('-created_at')[:4]
+    last_published = Book.objects.exclude(cover_thumb='').filter(parent=None).order_by('-created_at')[:4]
+    cite = choose_cite(RequestContext(request))
 
     return render_to_response("main_page.html", locals(),
         context_instance=RequestContext(request))
@@ -88,11 +93,12 @@ def logout_then_redirect(request):
     return HttpResponseRedirect(urlquote_plus(request.GET.get('next', '/'), safe='/?='))
 
 
+@never_cache
 def clock(request):
-    """ Provides server time for jquery.countdown,
+    """ Provides server UTC time for jquery.countdown,
     in a format suitable for Date.parse()
     """
-    return HttpResponse(datetime.now().strftime('%Y/%m/%d %H:%M:%S'))
+    return HttpResponse(datetime.utcnow().strftime('%Y/%m/%d %H:%M:%S UTC'))
 
 
 def publish_plan(request):