Merge branch 'pretty' of https://github.com/fnp/wolnelektury into pretty
authorMarcin Koziej <marcin@lolownia.org>
Mon, 12 Mar 2012 08:43:25 +0000 (09:43 +0100)
committerMarcin Koziej <marcin@lolownia.org>
Mon, 12 Mar 2012 08:43:25 +0000 (09:43 +0100)
30 files changed:
apps/api/handlers.py
apps/catalogue/migrations/0026_set_names.py [new file with mode: 0644]
apps/catalogue/templatetags/catalogue_tags.py
requirements.txt
wolnelektury/context_processors.py
wolnelektury/settings.py
wolnelektury/static/css/base.css
wolnelektury/static/css/book_box.css
wolnelektury/static/css/catalogue.css
wolnelektury/static/css/cite.css
wolnelektury/static/css/dialogs.css
wolnelektury/static/css/header.css
wolnelektury/static/css/logo.css
wolnelektury/static/css/main_page.css
wolnelektury/static/css/screen.css [new file with mode: 0644]
wolnelektury/static/img/auth/google-icon.png [new file with mode: 0644]
wolnelektury/static/img/auth/google.png [new file with mode: 0644]
wolnelektury/static/img/auth/openid-large.png?1237615666 [new file with mode: 0644]
wolnelektury/static/img/auth/openid.png [new file with mode: 0644]
wolnelektury/templates/auth/login.html [new file with mode: 0644]
wolnelektury/templates/auth/login_register.html
wolnelektury/templates/base.html
wolnelektury/templates/catalogue/book_detail.html
wolnelektury/templates/catalogue/book_short.html
wolnelektury/templates/lesmianator/poem.html
wolnelektury/templates/main_page.html
wolnelektury/templates/socialaccount/snippets/provider_list.html [new file with mode: 0644]
wolnelektury/templates/superbase.html [new file with mode: 0644]
wolnelektury/urls.py
wolnelektury/views.py

index fddff74..0255c05 100644 (file)
@@ -36,6 +36,9 @@ category_plural={}
 for k, v in category_singular.items():
     category_plural[v] = k
 
+book_tag_categories = ['author', 'epoch', 'kind', 'genre']
+
+
 
 def read_tags(tags, allowed):
     """ Reads a path of filtering tags.
@@ -88,49 +91,64 @@ class BookMediaHandler(BaseHandler):
         return MEDIA_BASE + media.file.url
 
 
-class BookDetailHandler(BaseHandler):
-    """ Main handler for Book objects.
+class BookDetails(object):
+    """Custom fields used for representing Books."""
+
+    @classmethod
+    def author(cls, book):
+        return ", ".join(t.name for t in book.tags.filter(category='author'))
+
+    @classmethod
+    def href(cls, book):
+        """ Returns an URI for a Book in the API. """
+        return API_BASE + reverse("api_book", args=[book.slug])
+
+    @classmethod
+    def url(cls, book):
+        """ Returns Book's URL on the site. """
+
+        return WL_BASE + book.get_absolute_url()
+
+    @classmethod
+    def children(cls, book):
+        """ Returns all media for a book. """
+
+        return book.children.all()
+
+    @classmethod
+    def media(cls, book):
+        """ Returns all media for a book. """
+
+        return book.media.all()
+
 
-    Responsible for lists of Book objects
-    and fields used for representing Books.
 
+class BookDetailHandler(BaseHandler, BookDetails):
+    """ Main handler for Book objects.
+
+    Responsible for single Book details.
     """
     allowed_methods = ['GET']
-    fields = ['title', 'parent'] + Book.formats + [
-        'media', 'url'] + category_singular.keys()
+    fields = ['title', 'parent', 'children'] + Book.formats + [
+        'media', 'url'] + book_tag_categories
 
     @piwik_track
-    def read(self, request, slug):
+    def read(self, request, book):
         """ Returns details of a book, identified by a slug and lang. """
         try:
-            return Book.objects.get(slug=slug)
+            return Book.objects.get(slug=book)
         except Book.DoesNotExist:
             return rc.NOT_FOUND
 
 
-class AnonymousBooksHandler(AnonymousBaseHandler):
+class AnonymousBooksHandler(AnonymousBaseHandler, BookDetails):
     """ Main handler for Book objects.
 
-    Responsible for lists of Book objects
-    and fields used for representing Books.
-
+    Responsible for lists of Book objects.
     """
     allowed_methods = ('GET',)
     model = Book
-    fields = ['href', 'title']
-
-    categories = set(['author', 'epoch', 'kind', 'genre'])
-
-    @classmethod
-    def href(cls, book):
-        """ Returns an URI for a Book in the API. """
-        return API_BASE + reverse("api_book", args=[book.slug])
-
-    @classmethod
-    def url(cls, book):
-        """ Returns Book's URL on the site. """
-
-        return WL_BASE + book.get_absolute_url()
+    fields = ['author', 'href', 'title', 'url']
 
     @piwik_track
     def read(self, request, tags, top_level=False):
@@ -142,13 +160,19 @@ class AnonymousBooksHandler(AnonymousBaseHandler):
              it's children are aren't. By default all books matching the tags
              are returned.
         """
-        tags = read_tags(tags, allowed=self.categories)
+        try:
+            tags = read_tags(tags, allowed=book_tag_categories)
+        except ValueError:
+            return rc.NOT_FOUND
+
         if tags:
             if top_level:
                 books = Book.tagged_top_level(tags)
                 return books if books else rc.NOT_FOUND
             else:
                 books = Book.tagged.with_all(tags)
+        elif top_level:
+            books = Book.objects.filter(parent=None)
         else:
             books = Book.objects.all()
 
@@ -158,18 +182,12 @@ class AnonymousBooksHandler(AnonymousBaseHandler):
             return rc.NOT_FOUND
 
     def create(self, request, tags, top_level=False):
-        return 'aaa'
+        return rc.FORBIDDEN
 
-    @classmethod
-    def media(self, book):
-        """ Returns all media for a book. """
 
-        return book.media.all()
-
-
-class BooksHandler(BaseHandler):
+class BooksHandler(BookDetailHandler):
     model = Book
-    fields = ('slug', 'title')
+    fields = ['author', 'href', 'title', 'url']
     anonymous = AnonymousBooksHandler
 
     def create(self, request, tags, top_level=False):
@@ -184,6 +202,7 @@ class BooksHandler(BaseHandler):
         else:
             return rc.NOT_FOUND
 
+
 # add categorized tags fields for Book
 def _tags_getter(category):
     @classmethod
@@ -191,7 +210,7 @@ def _tags_getter(category):
         return book.tags.filter(category=category)
     return get_tags
 for plural, singular in category_singular.items():
-    setattr(BooksHandler, plural, _tags_getter(singular))
+    setattr(BookDetails, plural, _tags_getter(singular))
 
 # add fields for files in Book
 def _file_getter(format):
@@ -205,13 +224,29 @@ def _file_getter(format):
             return ''
     return get_file
 for format in Book.formats:
-    setattr(BooksHandler, format, _file_getter(format))
+    setattr(BookDetails, format, _file_getter(format))
+
 
+class TagDetails(object):
+    """Custom Tag fields."""
 
-class TagDetailHandler(BaseHandler):
+    @classmethod
+    def href(cls, tag):
+        """ Returns URI in the API for the tag. """
+
+        return API_BASE + reverse("api_tag", args=[category_plural[tag.category], tag.slug])
+
+    @classmethod
+    def url(cls, tag):
+        """ Returns URL on the site. """
+
+        return WL_BASE + tag.get_absolute_url()
+
+
+class TagDetailHandler(BaseHandler, TagDetails):
     """ Responsible for details of a single Tag object. """
 
-    fields = ['name', 'sort_key', 'description']
+    fields = ['name', 'url', 'sort_key', 'description']
 
     @piwik_track
     def read(self, request, category, slug):
@@ -228,7 +263,7 @@ class TagDetailHandler(BaseHandler):
             return rc.NOT_FOUND
 
 
-class TagsHandler(BaseHandler):
+class TagsHandler(BaseHandler, TagDetails):
     """ Main handler for Tag objects.
 
     Responsible for lists of Tag objects
@@ -237,7 +272,7 @@ class TagsHandler(BaseHandler):
     """
     allowed_methods = ('GET',)
     model = Tag
-    fields = ['name', 'href']
+    fields = ['name', 'href', 'url']
 
     @piwik_track
     def read(self, request, category):
@@ -255,26 +290,42 @@ class TagsHandler(BaseHandler):
             return rc.NOT_FOUND
 
 
+class FragmentDetails(object):
+    """Custom Fragment fields."""
+
     @classmethod
-    def href(cls, tag):
-        """ Returns URI in the API for the tag. """
+    def href(cls, fragment):
+        """ Returns URI in the API for the fragment. """
 
-        return API_BASE + reverse("api_tag", args=[category_plural[tag.category], tag.slug])
+        return API_BASE + reverse("api_fragment", 
+            args=[fragment.book.slug, fragment.anchor])
+
+    @classmethod
+    def url(cls, fragment):
+        """ Returns URL on the site for the fragment. """
+
+        return WL_BASE + fragment.get_absolute_url()
+
+    @classmethod
+    def themes(cls, fragment):
+        """ Returns a list of theme tags for the fragment. """
+
+        return fragment.tags.filter(category='theme')
 
 
-class FragmentDetailHandler(BaseHandler):
+class FragmentDetailHandler(BaseHandler, FragmentDetails):
     fields = ['book', 'anchor', 'text', 'url', 'themes']
 
     @piwik_track
-    def read(self, request, slug, anchor):
+    def read(self, request, book, anchor):
         """ Returns details of a fragment, identified by book slug and anchor. """
         try:
-            return Fragment.objects.get(book__slug=slug, anchor=anchor)
+            return Fragment.objects.get(book__slug=book, anchor=anchor)
         except Fragment.DoesNotExist:
             return rc.NOT_FOUND
 
 
-class FragmentsHandler(BaseHandler):
+class FragmentsHandler(BaseHandler, FragmentDetails):
     """ Main handler for Fragments.
 
     Responsible for lists of Fragment objects
@@ -282,7 +333,7 @@ class FragmentsHandler(BaseHandler):
 
     """
     model = Fragment
-    fields = ['book', 'anchor', 'href']
+    fields = ['book', 'url', 'anchor', 'href']
     allowed_methods = ('GET',)
 
     categories = set(['author', 'epoch', 'kind', 'genre', 'book', 'theme'])
@@ -295,33 +346,16 @@ class FragmentsHandler(BaseHandler):
              books/book-slug/authors/an-author/themes/a-theme/
 
         """
-        tags = read_tags(tags, allowed=self.categories)
+        try:
+            tags = read_tags(tags, allowed=self.categories)
+        except ValueError:
+            return rc.NOT_FOUND
         fragments = Fragment.tagged.with_all(tags).select_related('book')
         if fragments.exists():
             return fragments
         else:
             return rc.NOT_FOUND
 
-    @classmethod
-    def href(cls, fragment):
-        """ Returns URI in the API for the fragment. """
-
-        return API_BASE + reverse("api_fragment", 
-            args=[fragment.book.slug, fragment.anchor])
-
-    @classmethod
-    def url(cls, fragment):
-        """ Returns URL on the site for the fragment. """
-
-        return WL_BASE + fragment.get_absolute_url()
-
-    @classmethod
-    def themes(cls, fragment):
-        """ Returns a list of theme tags for the fragment. """
-
-        return fragment.tags.filter(category='theme')
-
-
 
 
 # Changes handlers
diff --git a/apps/catalogue/migrations/0026_set_names.py b/apps/catalogue/migrations/0026_set_names.py
new file mode 100644 (file)
index 0000000..837e4d0
--- /dev/null
@@ -0,0 +1,132 @@
+# encoding: utf-8
+import datetime
+from south.db import db
+from south.v2 import DataMigration
+from django.db import models
+
+class Migration(DataMigration):
+
+    def forwards(self, orm):
+        "Write your forwards methods here."
+        for tag in orm.Tag.objects.filter(category='set', name__contains=','):
+            tag.name = tag.name.replace(', ', ' ').replace(',', ' ')
+            tag.save()
+
+
+    def backwards(self, orm):
+        "Write your backwards methods here."
+
+
+    models = {
+        'auth.group': {
+            'Meta': {'object_name': 'Group'},
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+        },
+        'auth.permission': {
+            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+        },
+        'auth.user': {
+            'Meta': {'object_name': 'User'},
+            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+        },
+        'catalogue.book': {
+            'Meta': {'ordering': "('sort_key',)", 'object_name': 'Book'},
+            '_related_info': ('jsonfield.fields.JSONField', [], {'null': 'True', 'blank': 'True'}),
+            'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'common_slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
+            'cover': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
+            'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'epub_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+            'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
+            'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
+            'html_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'language': ('django.db.models.fields.CharField', [], {'default': "'pol'", 'max_length': '3', 'db_index': 'True'}),
+            'mobi_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+            'parent': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'children'", 'null': 'True', 'to': "orm['catalogue.Book']"}),
+            'parent_number': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
+            'pdf_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '120', 'db_index': 'True'}),
+            'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
+            'txt_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'}),
+            'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
+            'xml_file': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'blank': 'True'})
+        },
+        'catalogue.bookmedia': {
+            'Meta': {'ordering': "('type', 'name')", 'object_name': 'BookMedia'},
+            'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'media'", 'to': "orm['catalogue.Book']"}),
+            'extra_info': ('catalogue.fields.JSONField', [], {'default': "'{}'"}),
+            'file': ('catalogue.fields.OverwritingFileField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
+            'source_sha1': ('django.db.models.fields.CharField', [], {'max_length': '40', 'null': 'True', 'blank': 'True'}),
+            'type': ('django.db.models.fields.CharField', [], {'max_length': "'100'"}),
+            'uploaded_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'})
+        },
+        'catalogue.collection': {
+            'Meta': {'ordering': "('title',)", 'object_name': 'Collection'},
+            'book_slugs': ('django.db.models.fields.TextField', [], {}),
+            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'primary_key': 'True', 'db_index': 'True'}),
+            'title': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'})
+        },
+        'catalogue.fragment': {
+            'Meta': {'ordering': "('book', 'anchor')", 'object_name': 'Fragment'},
+            'anchor': ('django.db.models.fields.CharField', [], {'max_length': '120'}),
+            'book': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'fragments'", 'to': "orm['catalogue.Book']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'short_text': ('django.db.models.fields.TextField', [], {}),
+            'text': ('django.db.models.fields.TextField', [], {})
+        },
+        'catalogue.tag': {
+            'Meta': {'ordering': "('sort_key',)", 'unique_together': "(('slug', 'category'),)", 'object_name': 'Tag'},
+            'book_count': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
+            'category': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
+            'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+            'gazeta_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '50', 'db_index': 'True'}),
+            'slug': ('django.db.models.fields.SlugField', [], {'max_length': '120', 'db_index': 'True'}),
+            'sort_key': ('django.db.models.fields.CharField', [], {'max_length': '120', 'db_index': 'True'}),
+            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
+            'wiki_link': ('django.db.models.fields.CharField', [], {'max_length': '240', 'blank': 'True'})
+        },
+        'catalogue.tagrelation': {
+            'Meta': {'unique_together': "(('tag', 'content_type', 'object_id'),)", 'object_name': 'TagRelation', 'db_table': "'catalogue_tag_relation'"},
+            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {'db_index': 'True'}),
+            'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'items'", 'to': "orm['catalogue.Tag']"})
+        },
+        'contenttypes.contenttype': {
+            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
+            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
+        }
+    }
+
+    complete_apps = ['catalogue']
index 14ed64d..e9b1610 100644 (file)
@@ -45,6 +45,10 @@ def capfirst(text):
     except IndexError:
         return ''
 
+@register.filter
+def build_absolute_uri(uri, request):
+    return request.build_absolute_uri(uri)
+
 
 @register.simple_tag
 def html_title_from_tags(tags):
index a961c4d..ecb07cc 100644 (file)
@@ -8,6 +8,7 @@ django-rosetta>=0.5.3
 django-maintenancemode>=0.9
 django-piston
 django-jsonfield
+django-allauth
 
 python-memcached
 piwik
index 0cbf605..fa8515e 100644 (file)
@@ -1,6 +1,6 @@
+from django.conf import settings
 
 def extra_settings(request):
-    from django.conf import settings
     return {
         'STATIC_URL': settings.STATIC_URL,
     }
index a1ad878..7f22b0c 100644 (file)
@@ -92,6 +92,8 @@ TEMPLATE_CONTEXT_PROCESSORS = (
     'django.core.context_processors.request',
     'wolnelektury.context_processors.extra_settings',
     'search.context_processors.search_form',
+    "allauth.context_processors.allauth",
+    "allauth.account.context_processors.account",
 )
 
 MIDDLEWARE_CLASSES = [
@@ -114,6 +116,12 @@ TEMPLATE_DIRS = [
     path.join(PROJECT_DIR, 'templates'),
 ]
 
+
+AUTHENTICATION_BACKENDS = [
+    'django.contrib.auth.backends.ModelBackend',
+    'allauth.account.auth_backends.AuthenticationBackend',
+]
+EMAIL_CONFIRMATION_DAYS = 2
 LOGIN_URL = '/uzytkownicy/zaloguj/'
 
 LOGIN_REDIRECT_URL = '/'
@@ -136,6 +144,16 @@ INSTALLED_APPS = [
     'djkombu',
     #    'django_nose',
 
+    #allauth stuff
+    'emailconfirmation',
+    'uni_form',
+    'allauth',
+    'allauth.account',
+    'allauth.socialaccount',
+    'allauth.openid',
+    #'allauth.facebook',
+    #'allauth.twitter',
+
     # included
     'compress',
     'modeltranslation',
@@ -207,6 +225,13 @@ COMPRESS_CSS = {
         ],
         'output_filename': 'css/all.min?.css',
     },
+    'screen': {
+        'source_filenames': ['css/screen.css'],
+        'output_filename': ['css/screen.min?.css'],
+        'extra_context': {
+            'media': 'screen and (min-width: 800px)',
+        },
+    },
     'ie': {
         'source_filenames': [
             'css/ie.css',
@@ -279,17 +304,6 @@ COMPRESS_VERSION = True
 COMPRESS_CSS_FILTERS = None
 
 THUMBNAIL_QUALITY = 95
-THUMBNAIL_EXTENSION = 'png'
-
-THUMBNAIL_PROCESSORS = (
-    # Default processors
-    'sorl.thumbnail.processors.colorspace',
-    'sorl.thumbnail.processors.autocrop',
-    'sorl.thumbnail.processors.scale_and_crop',
-    'sorl.thumbnail.processors.filters',
-    # Custom processors
-    'sponsors.processors.add_padding',
-)
 
 TRANSLATION_REGISTRY = "wolnelektury.translation"
 
index 70aa172..3160611 100755 (executable)
@@ -64,14 +64,6 @@ ul.plain {
     padding: 0;
 }
 
-.left-column {
-    width: 47em;
-    float: left;
-}
-.right-column {
-    float:right;
-    width: 47em;
-}
 .normal-text {
     font-size: 1.3em;
     line-height: 1.3em;
@@ -125,13 +117,6 @@ h2 {
     box-shadow: 2px 2px 2px #ddd;
 }
 
-
-#header-content, div#main-content, div#half-header-content, #footer-content {
-    width: 97.5em;
-    margin: auto;
-}
-
-
 .page-desc {
     margin-left: 1.5em;
 }
@@ -175,7 +160,6 @@ h2 {
     column-width: 12em;
     -moz-column-width: 12em;
     -webkit-column-width: 12em;
-    width: 48em;
 }
 .hidden-box li {
        margin-bottom: .5em;
index 876bf06..6b28068 100755 (executable)
@@ -17,8 +17,6 @@
 }
 
 .book-wide-box {
-    width: 97.5em;
-
     /** This is a fullpage box, it must be aligned with the top menu. 
         This corresponds to a .1em margin below **/
     margin-left: -0.1em;
    min-height: 24.4em;
 }
 
-.search-result {
-    width: 97.5em;
-}
-
 .search-result .book-box-body {
     width: 31em;
 }
 
 .book-list-header {
-    width: 97.5em;
     padding: 0em;
     margin-left: -0.1em;
 }
     font-size: 1.1em;
 }
 
+.book-wide-box {
+       min-width: 48.75em;
+}
 .book-wide-box .book-box-tools {
     margin-left: 14em;
     width: 32em;
 
 .book-wide-box #theme-list-wrapper {
     margin-left: 15.4em;
+       margin-bottom: 3em;
        width: 30em;
 }
 
@@ -260,11 +257,6 @@ ul.book-box-tools {
     width: 7em;
 }
 
-.book-wide-box .right-column {
-    float: right;
-    width: 41.5em;
-}
-
 ul.inline-items, ul.inline-items li {
     margin: 0;
     padding: 0;
@@ -329,11 +321,6 @@ ul.inline-items li {
     display: none;
 }
 
-.snippets {
-    width: 44em;
-    float: right;
-}
-
 .snippets .snippet-text {
     background: #f7f7f7;
     font-size: 1.2em;
index 74338f8..0e952ba 100755 (executable)
 }
 
 
-#tagged-object-list .left-column, #tagged-object-list .right-column {
-    width: 48em;
-}
-
-
 /* listing of all books */
 #book-list {
    padding-left: 50px;
 }
+/* FIXME: MEDIA?
+ * 
 #book-list-nav {
     position: absolute;
     right: 50px;
@@ -31,6 +28,7 @@
     padding: 10px;
     font-size: 1.2em;
 }
+ */
 
 #book-list-nav ul {
     list-style-type: none;
        width: 7em;
 }
 .inline-body {
-       width: 35em;
        display: inline-block;
        vertical-align: top;
        margin-bottom: .5em;
index 91c6851..69c28a7 100755 (executable)
 
 
 #big-cite {
-    background-color: #bd9a89; /* average image color */
-    color: white;
+    background-color: white; /* #bd9a89; /* average image color */
+    color: black;
     padding: 0;
     margin: 0;
     background-image: url(/static/img/backdrop/horiavarlan-4268896468.jpg);
     background-size: 100%;
     background-position: 50% 70%;
+    background-repeat: no-repeat;
 }
 
 #big-cite .cite {
@@ -49,7 +50,7 @@
 
 
 #big-cite .cite-body {
-    margin: .05em .05em .05em 17.5em;
+    margin: .05em .05em .05em 1em;
 }
 #big-cite .cite-body span {
     font-size: 3em;
@@ -57,9 +58,7 @@
 }
 
 #big-cite .vip {
-       float:left;
-       text-align:right;
-       width: 14.7em;
+       margin-left: 1em;
        margin-top: .25em;
 }
 
@@ -86,7 +85,7 @@
 
 
 #big-cite .source {
-    margin: 1.6em 0.2em 1.6em 17.5em;
+    margin: 1.6em 0.2em 1.6em 1em;
 }
 #big-cite .source span {
     font-size: 1.2em;
index d83116b..803c14d 100755 (executable)
 #custom-pdf-window label {
     display: inline;
 }
+
+
+.socialauth {
+       margin: 1em 0;
+       padding: 0;
+}
+.socialauth li {
+       display: inline;
+       list-style: none;
+       margin-right: 1em;
+}
index 547e114..39d4160 100755 (executable)
@@ -7,7 +7,6 @@
 }
 
 #header {
-    height: 3em;
     padding-top: 1.9em;
     padding-bottom: 0;
     color: #989898;
 }
 
 
-#user-info {
-    float: right;
-    margin: 0;
-}
-
-#logo {
-    position: absolute;
-    top: -1.6em;
-    margin-left: 1.5em;
-}
-
 #logo a {
     color:#f7f7f7;
     font-size: 2.05em;
 }
 
 #tagline {
-    display: inline-block;
-    margin-left: 25.5em;
+       margin-left: 1.5em;
 }
+
 #tagline span {
     font-size: 1.3em;
     color: #bbb;
 }
 
+#user-info {
+    margin: 0;
+    padding: 1em 0;
+    margin-left: 1.5em;
+}
+
 #search-area {
     margin: 0;
     background: #444;
     color: white;
-    margin-left: 24em;
-    width: 73.5em;
 }
 
 #search-field {
     display: inline-block;
-    width: 63.1em;
     padding-left: .5em;
-    padding-right: 0;
+    padding-right: .5em;
     padding-top: 0.5em;
     padding-bottom: 0;
 }
@@ -84,7 +75,6 @@
     -moz-box-shadow:0 0 .5em #444 inset;
     box-shadow: 0 0 .5em #444 inset;*/
     height: 2.54em;
-    width: 47.47em;
     padding-left: 1em;
     -webkit-border-radius: .38em;
     -moz-border-radius: .38em;
     padding: 0;
     margin: 0;
     width: 9.4em;
-    float: right;
 }
 #search-button button {
     font-size: 1em;
index c7e7882..611b4ba 100644 (file)
@@ -9,7 +9,9 @@
   src: url(/static/fonts/WL.ttf) format("truetype");
 }
 
+#logo {
+       margin-left: 1.5em;
+}
 #logo a {
     font-family: WL-Logo;
-    line-height: 7em;
 }
index bc8e68f..b564e82 100755 (executable)
@@ -1,8 +1,6 @@
 
 #promo-box {
-    float: right;
     width: 32em;
-    margin-top: -5.1em;
 }
 #promo-box-header {
     padding-top: 2em;
@@ -19,7 +17,6 @@
 #promo-box-body {
     border-bottom: 2px solid #efefef;
     padding: 2em 2.8em;
-    height: 30em;
     background: #efefef;
 }
 #promo-box-title {
@@ -89,7 +86,7 @@
 }
 
 .infopages-box .social-links a {
-    font-family: WL-Nav;
+    font-family: WL-Nav, courier;
     font-size: 3em;
     color: #281d1c;
     margin-right: .2em;
diff --git a/wolnelektury/static/css/screen.css b/wolnelektury/static/css/screen.css
new file mode 100644 (file)
index 0000000..3a344dc
--- /dev/null
@@ -0,0 +1,132 @@
+.left-column {
+    width: 47em;
+    float: left;
+}
+.right-column {
+    float:right;
+    width: 47em;
+}
+
+.hidden-box ul {
+       width: 48em;
+}
+
+#header-content, div#main-content, div#half-header-content, #footer-content {
+    width: 97.5em;
+    margin: auto;
+}
+
+#promo-box {
+    float: right;
+    margin-top: -5.1em;
+}
+
+#promo-box-body {
+       height: 30em;
+}
+
+#big-cite .vip {
+       float:left;
+       text-align:right;
+       width: 14.7em;
+}
+
+#big-cite .cite-body {
+    margin-left: 17.5em;
+}
+
+#big-cite .source {
+    margin-left: 17.5em;
+}
+
+
+.book-wide-box {
+    width: 97.5em;
+}
+.book-wide-box .book-box-body {
+       width: 38.2em;
+}
+
+
+#tagged-object-list .left-column, #tagged-object-list .right-column {
+    width: 48em;
+}
+
+
+
+
+.inline-body {
+       width: 35em;
+}
+
+
+.search-result {
+    width: 97.5em;
+}
+
+
+.book-list-header {
+    width: 97.5em;
+}
+
+.book-wide-box .right-column {
+    width: 41.5em;
+    margin-top: -23em;
+}
+
+.book-wide-box #theme-list-wrapper {
+       margin-bottom: 0;
+}
+
+.snippets {
+    width: 44em;
+    float: right;
+    margin-top: -20em;
+}
+
+/* LOGO */
+
+#logo a {
+       line-height: 7em;
+}
+
+
+/* HEADER */
+
+#header {
+    height: 3em;
+}
+
+#logo {
+    position: absolute;
+    top: -1.6em;
+}
+
+#user-info {
+    float: right;
+    padding: 0 !important;
+    margin-left: 0;
+}
+
+#tagline {
+    display: inline-block;
+    margin-left: 25.5em;
+}
+
+#search-area {
+    margin-left: 24em;
+    width: 73.5em;
+}
+
+#search-field {
+    width: 63.1em;
+    padding-right: 0 !important;
+}
+
+#search {
+    width: 47.47em;
+}
+
+#search-button {
+       float: right;
+}
diff --git a/wolnelektury/static/img/auth/google-icon.png b/wolnelektury/static/img/auth/google-icon.png
new file mode 100644 (file)
index 0000000..d16d531
Binary files /dev/null and b/wolnelektury/static/img/auth/google-icon.png differ
diff --git a/wolnelektury/static/img/auth/google.png b/wolnelektury/static/img/auth/google.png
new file mode 100644 (file)
index 0000000..bf7d112
Binary files /dev/null and b/wolnelektury/static/img/auth/google.png differ
diff --git a/wolnelektury/static/img/auth/openid-large.png?1237615666 b/wolnelektury/static/img/auth/openid-large.png?1237615666
new file mode 100644 (file)
index 0000000..6094fff
Binary files /dev/null and b/wolnelektury/static/img/auth/openid-large.png?1237615666 differ
diff --git a/wolnelektury/static/img/auth/openid.png b/wolnelektury/static/img/auth/openid.png
new file mode 100644 (file)
index 0000000..83e9769
Binary files /dev/null and b/wolnelektury/static/img/auth/openid.png differ
diff --git a/wolnelektury/templates/auth/login.html b/wolnelektury/templates/auth/login.html
new file mode 100644 (file)
index 0000000..553e873
--- /dev/null
@@ -0,0 +1,14 @@
+{% extends "ajaxable/form.html" %}
+{% load i18n %}
+
+{% block extra %}
+
+<h2>{% trans "or join accounts:" %}</h2>
+
+<ul class="socialauth">
+{% include "socialaccount/snippets/provider_list.html" %}
+</ul>
+
+{% endblock %}
+
+
index ecaeaf4..394902a 100755 (executable)
@@ -3,6 +3,12 @@
 
 {% block extra %}
 
+<h2>{% trans "or join accounts:" %}</h2>
+
+<ul class="socialauth">
+{% include "socialaccount/snippets/provider_list.html" %}
+</ul>
+
 
 <h1>{% trans "or register" %}:</h1>
 
index 554e6d3..fac9319 100644 (file)
@@ -1,192 +1,4 @@
-<!DOCTYPE html>
-<html class="no-js">
-       {% load cache compressed i18n %}
-    {% load catalogue_tags reporting_stats sponsor_tags %}
-    <head>
-        <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
-        <meta name="description" 
-            content="{% block metadescription %}Darmowe opracowane, pełne teksty lektur, e-booki, audiobooki i pliki DAISY na wolnej licencji.{% endblock %}" />
-        <title>{% block title %}{% trans "Wolne Lektury" %} :: 
-            {% block titleextra %}{% endblock %}{% endblock %}</title>
-        <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/png" />
-        <link rel="search" type="application/opensearchdescription+xml" title="Wolne Lektury" href="{{ STATIC_URL }}opensearch.xml" />
-        {% compressed_css "all" %}
-        <!--[if IE]>
-               {% compressed_css "ie" %}
-        <![endif]-->
-        <!--script src="{{ STATIC_URL }}js/modernizr.custom.13352.js"></script-->
-        <script src="{{ STATIC_URL }}js/modernizr-latest.js"></script>
+{% extends "superbase.html" %}
 
-        {% block extrahead %}
-        {% endblock %}
-    </head>
-    <body id="{% block bodyid %}base{% endblock %}">
 
-        {% block bodycontent %}
-
-               <div id="header-bg"></div>
-
-        <div id="header">
-
-        <div id="header-content">
-            <div id="logo">
-                <a class="logo" href="/">
-                Wolne Lektury</a>
-            </div>
-
-            <div id="tagline">
-                <span>
-                {% cache 60 tagline LANGUAGE_CODE %}
-                    {% url book_list as b %}
-                    {% url infopage 'o-projekcie' as r %}
-                        {% count_books book_count %}
-                    {% blocktrans count book_count as c %}
-                    <a href='{{b}}'>{{c}}</a> free reading you have <a href='{{r}}'>right to</a>
-                    {% plural %}
-                    <a href='{{b}}'>{{c}}</a> free readings you have <a href='{{r}}'>right to</a>
-                    {% endblocktrans %}
-                {% endcache %}
-                </span>
-            </div>
-
-            <p id="user-info" class="mono">
-                {% if user.is_authenticated %}
-                    {% trans "Welcome" %}, <strong>{{ user.username }}</strong>
-                    | <a href="{% url social_my_shelf %}" id="user-shelves-link">{% trans "My shelf" %}</a>
-                    {% if user.is_staff %}
-                    | <a href="/admin/">{% trans "Administration" %}</a>
-                    {% endif %}
-                    | <a href="{% url logout %}?next={% block logout %}{{ request.get_full_path }}{% endblock %}">{% trans "Logout" %}</a>
-                {% else %}
-                    <a href="{% url login %}?next={{ request.path }}"
-                        id="login" class="ajaxable">
-                            {% trans "Sign in" %}</a>
-                    /
-                    <a href="{% url register %}?next={{ request.path }}"
-                        id="register" class="ajaxable">
-                            {% trans "Register" %}</a>
-                {% endif %}
-            </p>
-
-
-            <div class="clearboth"></div>
-
-        </div>
-        </div>
-
-        <div id="half-header">
-        <div id="half-header-content">
-
-
-
-            <form id="search-area" action="/fullsearch/" class="hidelabels">
-                
-                <div id="search-field" class="grid-line">
-                       <label for="search">{{search_form.q.label}}</label>
-                 {{search_form.q}}
-<!--                    <input title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">-->
-                </div><div id="search-button">
-                    <button type='submit'><span class="mono">{% trans "Search" %}</span></button>
-                </div>
-                
-                <div class="clearboth"></div>
-            </form>
-
-
-
-        </div>
-        </div>
-
-
-
-        <div id="main-content">
-
-            <div id="nav-line">
-               {% cache 60 catalogue-menu LANGUAGE_CODE %}
-                       {% catalogue_menu %}
-               {% endcache %}
-
-            <form action="{% url django.views.i18n.set_language %}" method="post">
-            <div id="lang-menu">
-                <span id='lang-button' class='mono'>
-                    {% trans "Language versions" %}</span>
-                <div id="lang-menu-items">
-                {% for lang in LANGUAGES %}
-                    <button type="submit" name="language"
-                        class="{% ifequal lang.0 LANGUAGE_CODE %}active{% endifequal %} mono"
-                        value="{{ lang.0 }}">{{ lang.1 }}</button>
-                {% endfor %}
-                </div>
-            </div>
-            </form>
-            </div>
-
-            <div class="clearboth"></div>
-
-
-
-            {% block body %}
-            {% endblock %}
-
-
-
-
-        <div class="clearboth"></div>
-
-        </div>{# end main-content #}
-
-
-        <div id="footer">
-        <div id="footer-content">
-            <p>
-               {% blocktrans %}
-                               Wolne Lektury is a project lead by <a href="http://nowoczesnapolska.org.pl/">Modern Poland Foundation</a>.
-                               Digital reproductions are made by <a href="http://www.bn.org.pl/">The National Library</a>, <a href="http://www.bs.katowice.pl/">Biblioteka Śląska</a> and <a href="http://www.bibliotekaelblaska.pl/">Biblioteka Elbląska</a>, based on TNL, BŚ and BE resources.
-                               Hosting: <a href="http://www.icm.edu.pl/">ICM</a>.
-                               {% endblocktrans %}
-            </p>
-            <p>
-               {% blocktrans %}
-                               Modern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17
-                e-mail: <a href="mailto:fundacja@nowoczesnapolska.org.pl">fundacja@nowoczesnapolska.org.pl</a>
-                               {% endblocktrans %}
-            </p>
-
-            {% block add_footer %}{% endblock %}
-
-                       {% sponsor_page "footer" %}
-        </div>
-        </div>
-
-
-
-        {# template #}
-        <div id="ajaxable-window" class='dialog-window'>
-            <div class="header mono"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
-            <div class="target">
-                <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
-            </div>
-        </div>
-
-
-        {% endblock bodycontent %}
-
-
-        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
-        <script type="text/javascript">
-            var LANGUAGE_CODE = "{{ LANGUAGE_CODE }}";
-            var STATIC_URL = "{{ STATIC_URL }}";
-        </script>
-        {% compressed_js "base" %}
-
-        <!--{{ piwik_tag|safe }}
-        <script type="text/javascript">
-        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
-        </script>
-        <script type="text/javascript">
-        var pageTracker = _gat._getTracker("UA-2576694-1");
-        pageTracker._trackPageview();
-        </script>-->
-    </body>
-</html>
+{% block ogtitle %}{% block titleextra %}{% endblock %}{% endblock %}
index dd4d907..a996d66 100644 (file)
@@ -1,8 +1,10 @@
 {% extends "base.html" %}
 {% load cache i18n %}
+{% load thumbnail %}
 {% load catalogue_tags pagination_tags %}
 
 {% block titleextra %}{{ book.pretty_title }}{% endblock %}
+{% block ogimage %}{{ book.cover.url|build_absolute_uri:request }}{% endblock %}
 
 {% block metadescription %}{% book_title book %}. {{ block.super }}{% endblock %}
 
index 77e775e..3541d0f 100644 (file)
@@ -16,8 +16,6 @@
             " alt="Cover" />
         {% endif %}
     </a>
-    {% block right-column %}
-    {% endblock %}
     <div class="book-box-body">
 
 
     {% block book-box-extra-info %}{% endblock %}
     {% block box-append %}
     {% endblock %}
+    {% block right-column %}
+    {% endblock %}
     <div class="clearboth"></div>
 </div>
 </div>
index 78c5d5f..5d44a26 100644 (file)
@@ -20,9 +20,7 @@
             <span style='float: right'>Wolne Lektury przepuszczone przez mikser.</a>
         </div>
         <div id="header">
-            <div id="logo">
-                <a href="/">Wolne Lektury</a>
-            </div>
+            <a href="/"><img src="{{ STATIC_URL }}img/logo-220.png" alt="Wolne Lektury" /></a>
         </div>
         <div id="book-text">
             <h1>
index 77dff58..f92028f 100755 (executable)
@@ -3,6 +3,7 @@
 
 
 {% block title %}{% trans "Wolne Lektury internet library" %}{% endblock %}
+{% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %}
 
 {% block body %}
 
@@ -57,9 +58,9 @@
 
         <div class="social-links">
             <a href="http://pl-pl.facebook.com/pages/Wolne-Lektury/203084073268"
-                title='Wolne Lektury @ Facebook'>[f]</a>
+                title='Wolne Lektury @ Facebook'>f</a>
             <a href="http://nk.pl/profile/30441509"
-                title='Wolne Lektury @ NK'>[nk]</a>
+                title='Wolne Lektury @ NK'>nk</a>
         </div>
     </div>
 
diff --git a/wolnelektury/templates/socialaccount/snippets/provider_list.html b/wolnelektury/templates/socialaccount/snippets/provider_list.html
new file mode 100644 (file)
index 0000000..99e30a5
--- /dev/null
@@ -0,0 +1,21 @@
+{% load allauth_tags %}
+
+{% if allauth.openid_enabled %}
+<li><a title="Google" class="socialaccount_provider google" href="{% openid_login_url openid="https://www.google.com/accounts/o8/id" %}">
+       <img alt="Google" src="{{ STATIC_URL }}img/auth/google.png" /></a></li>
+{% endif %}
+{% if allauth.twitter_enabled %}
+<li><a title="Twitter" class="socialaccount_provider twitter" href="{% twitter_login_url %}">
+       <img alt="Twitter" src="{{ STATIC_URL }}img/auth/twitter.png" /></a></li>
+{% endif %}
+{% if allauth.facebook_enabled %}
+<li><a title="Facebook" class="socialaccount_provider facebook" href="{% facebook_login_url %}">
+       <img alt="Facebook" src="{{ STATIC_URL }}img/auth/facebook.png" /></a></li>
+{% endif %}
+{% if allauth.openid_enabled %}
+<!--li><a title="Yahoo" class="socialaccount_provider yahoo" href="{% openid_login_url openid="http://me.yahoo.com" %}">
+       <img alt="Yahoo" src="{{ STATIC_URL }}img/auth/yahoo.png" /></a></li-->
+<!--li><a title="OpenID" class="socialaccount_provider openid" href="{% openid_login_url %}">
+       <img alt="OpenID" src="{{ STATIC_URL }}img/auth/openid.png" /></a></li-->
+<!--li><a title="Hyves" class="socialaccount_provider hyves" href="{% openid_login_url openid="http://hyves.nl" %}">Hyves</a></li-->
+{% endif %}
diff --git a/wolnelektury/templates/superbase.html b/wolnelektury/templates/superbase.html
new file mode 100644 (file)
index 0000000..5813a2b
--- /dev/null
@@ -0,0 +1,201 @@
+<!DOCTYPE html>
+<html class="no-js" xmlns:og="http://opengraphprotocol.org/schema/">
+       {% load cache compressed i18n %}
+    {% load catalogue_tags reporting_stats sponsor_tags %}
+    <head>
+        <meta charset="utf-8">
+        <meta name="application-name" content="Wolne Lektury" />
+        <meta property="og:site_name" content="Wolne Lektury" />
+        <meta property="og:title" content="{% block ogtitle %}{% endblock %}" />
+        <meta property="og:type" content="{% block ogtype %}website{% endblock %}" />
+        <meta property="og:image" content="{% block ogimage %}http://static.wolnelektury.pl/img/logo-bez.png{% endblock %}" />
+        <meta name="description" 
+            content="{% block metadescription %}Darmowe opracowane, pełne teksty lektur, e-booki, audiobooki i pliki DAISY na wolnej licencji.{% endblock %}" />
+        {% block ogextra %}{% endblock %}
+        
+
+        <title>{% block title %}{% trans "Wolne Lektury" %} :: 
+            {% block titleextra %}{% endblock %}{% endblock %}</title>
+        <link rel="icon" href="{{ STATIC_URL }}img/favicon.png" type="image/png" />
+        <link rel="search" type="application/opensearchdescription+xml" title="Wolne Lektury" href="{{ STATIC_URL }}opensearch.xml" />
+        {% compressed_css "all" %}
+        {% compressed_css "screen" %}
+        <!--[if IE]>
+               {% compressed_css "ie" %}
+        <![endif]-->
+        <!--script src="{{ STATIC_URL }}js/modernizr.custom.13352.js"></script-->
+        <script src="{{ STATIC_URL }}js/modernizr-latest.js"></script>
+
+        {% block extrahead %}
+        {% endblock %}
+    </head>
+    <body id="{% block bodyid %}base{% endblock %}">
+
+        {% block bodycontent %}
+
+               <div id="header-bg"></div>
+
+        <div id="header">
+
+        <div id="header-content">
+            <div id="logo">
+                <a class="logo" href="/">
+                Wolne Lektury</a>
+            </div>
+
+            <div id="tagline">
+                <span>
+                {% cache 60 tagline LANGUAGE_CODE %}
+                    {% url book_list as b %}
+                    {% url infopage 'o-projekcie' as r %}
+                        {% count_books book_count %}
+                    {% blocktrans count book_count as c %}
+                    <a href='{{b}}'>{{c}}</a> free reading you have <a href='{{r}}'>right to</a>
+                    {% plural %}
+                    <a href='{{b}}'>{{c}}</a> free readings you have <a href='{{r}}'>right to</a>
+                    {% endblocktrans %}
+                {% endcache %}
+                </span>
+            </div>
+
+            <p id="user-info" class="mono">
+                {% if user.is_authenticated %}
+                    {% trans "Welcome" %}, <strong>{{ user.username }}</strong>
+                    | <a href="{% url social_my_shelf %}" id="user-shelves-link">{% trans "My shelf" %}</a>
+                    {% if user.is_staff %}
+                    | <a href="/admin/">{% trans "Administration" %}</a>
+                    {% endif %}
+                    | <a href="{% url logout %}?next={% block logout %}{{ request.get_full_path }}{% endblock %}">{% trans "Logout" %}</a>
+                {% else %}
+                    <a href="{% url login %}?next={{ request.path }}"
+                        id="login" class="ajaxable">
+                            {% trans "Sign in" %}</a>
+                    /
+                    <a href="{% url register %}?next={{ request.path }}"
+                        id="register" class="ajaxable">
+                            {% trans "Register" %}</a>
+                {% endif %}
+            </p>
+
+
+            <div class="clearboth"></div>
+
+        </div>
+        </div>
+
+        <div id="half-header">
+        <div id="half-header-content">
+
+
+
+            <form id="search-area" action="/fullsearch/" class="hidelabels">
+                
+                <div id="search-field" class="grid-line">
+                       <label for="search">{{search_form.q.label}}</label>
+                 {{search_form.q}}
+<!--                    <input title="np. Leśmian" name="q" autocomplete="off" data-source="/fullsearch/hint/">-->
+                </div><div id="search-button">
+                    <button type='submit'><span class="mono">{% trans "Search" %}</span></button>
+                </div>
+                
+                <div class="clearboth"></div>
+            </form>
+
+
+
+        </div>
+        </div>
+
+
+
+        <div id="main-content">
+
+            <div id="nav-line">
+               {% cache 60 catalogue-menu LANGUAGE_CODE %}
+                       {% catalogue_menu %}
+               {% endcache %}
+
+            <form action="{% url django.views.i18n.set_language %}" method="post">
+            <div id="lang-menu">
+                <span id='lang-button' class='mono'>
+                    {% trans "Language versions" %}</span>
+                <div id="lang-menu-items">
+                {% for lang in LANGUAGES %}
+                    <button type="submit" name="language"
+                        class="{% ifequal lang.0 LANGUAGE_CODE %}active{% endifequal %} mono"
+                        value="{{ lang.0 }}">{{ lang.1 }}</button>
+                {% endfor %}
+                </div>
+            </div>
+            </form>
+            </div>
+
+            <div class="clearboth"></div>
+
+
+
+            {% block body %}
+            {% endblock %}
+
+
+
+
+        <div class="clearboth"></div>
+
+        </div>{# end main-content #}
+
+
+        <div id="footer">
+        <div id="footer-content">
+            <p>
+               {% blocktrans %}
+                               Wolne Lektury is a project lead by <a href="http://nowoczesnapolska.org.pl/">Modern Poland Foundation</a>.
+                               Digital reproductions are made by <a href="http://www.bn.org.pl/">The National Library</a>, <a href="http://www.bs.katowice.pl/">Biblioteka Śląska</a> and <a href="http://www.bibliotekaelblaska.pl/">Biblioteka Elbląska</a>, based on TNL, BŚ and BE resources.
+                               Hosting: <a href="http://www.icm.edu.pl/">ICM</a>.
+                               {% endblocktrans %}
+            </p>
+            <p>
+               {% blocktrans %}
+                               Modern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 lok. 125, tel/fax: (22) 621-30-17
+                e-mail: <a href="mailto:fundacja@nowoczesnapolska.org.pl">fundacja@nowoczesnapolska.org.pl</a>
+                               {% endblocktrans %}
+            </p>
+
+            {% block add_footer %}{% endblock %}
+
+                       {% sponsor_page "footer" %}
+        </div>
+        </div>
+
+
+
+        {# template #}
+        <div id="ajaxable-window" class='dialog-window'>
+            <div class="header mono"><a href="#" class="jqmClose">{% trans "Close" %}</a></div>
+            <div class="target">
+                <p><img src="{{ STATIC_URL }}img/indicator.gif" alt="*"/> {% trans "Loading" %}</p>
+            </div>
+        </div>
+
+
+        {% endblock bodycontent %}
+
+
+        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
+        <script type="text/javascript">
+            var LANGUAGE_CODE = "{{ LANGUAGE_CODE }}";
+            var STATIC_URL = "{{ STATIC_URL }}";
+        </script>
+        {% compressed_js "base" %}
+
+        <!--{{ piwik_tag|safe }}
+        <script type="text/javascript">
+        var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
+        document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+        </script>
+        <script type="text/javascript">
+        var pageTracker = _gat._getTracker("UA-2576694-1");
+        pageTracker._trackPageview();
+        </script>-->
+    </body>
+</html>
index f6cd8d9..3695990 100644 (file)
@@ -32,6 +32,7 @@ urlpatterns += patterns('',
     url(r'^raporty/', include('reporting.urls')),
     url(r'^info/', include('infopages.urls')),
     url(r'^ludzie/', include('social.urls')),
+    url(r'^uzytkownicy/', include('allauth.urls')),
 
     # Admin panel
     url(r'^admin/catalogue/book/import$', 'catalogue.views.import_book', name='import_book'),
index c262479..bcead03 100755 (executable)
@@ -27,6 +27,7 @@ def main_page(request):
 
 class LoginFormView(AjaxableFormView):
     form_class = AuthenticationForm
+    template = "auth/login.html"
     placeholdize = True
     title = _('Sign in')
     submit = _('Sign in')