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.
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):
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()
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):
else:
return rc.NOT_FOUND
+
# add categorized tags fields for Book
def _tags_getter(category):
@classmethod
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):
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):
return rc.NOT_FOUND
-class TagsHandler(BaseHandler):
+class TagsHandler(BaseHandler, TagDetails):
""" Main handler for Tag objects.
Responsible for lists of Tag objects
"""
allowed_methods = ('GET',)
model = Tag
- fields = ['name', 'href']
+ fields = ['name', 'href', 'url']
@piwik_track
def read(self, request, category):
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
"""
model = Fragment
- fields = ['book', 'anchor', 'href']
+ fields = ['book', 'url', 'anchor', 'href']
allowed_methods = ('GET',)
categories = set(['author', 'epoch', 'kind', 'genre', 'book', 'theme'])
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
--- /dev/null
+# 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']
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):
django-maintenancemode>=0.9
django-piston
django-jsonfield
+django-allauth
python-memcached
piwik
+from django.conf import settings
def extra_settings(request):
- from django.conf import settings
return {
'STATIC_URL': settings.STATIC_URL,
}
'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 = [
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 = '/'
'djkombu',
# 'django_nose',
+ #allauth stuff
+ 'emailconfirmation',
+ 'uni_form',
+ 'allauth',
+ 'allauth.account',
+ 'allauth.socialaccount',
+ 'allauth.openid',
+ #'allauth.facebook',
+ #'allauth.twitter',
+
# included
'compress',
'modeltranslation',
],
'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',
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"
padding: 0;
}
-.left-column {
- width: 47em;
- float: left;
-}
-.right-column {
- float:right;
- width: 47em;
-}
.normal-text {
font-size: 1.3em;
line-height: 1.3em;
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;
}
column-width: 12em;
-moz-column-width: 12em;
-webkit-column-width: 12em;
- width: 48em;
}
.hidden-box li {
margin-bottom: .5em;
}
.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;
}
width: 7em;
}
-.book-wide-box .right-column {
- float: right;
- width: 41.5em;
-}
-
ul.inline-items, ul.inline-items li {
margin: 0;
padding: 0;
display: none;
}
-.snippets {
- width: 44em;
- float: right;
-}
-
.snippets .snippet-text {
background: #f7f7f7;
font-size: 1.2em;
}
-#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;
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;
#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 {
#big-cite .cite-body {
- margin: .05em .05em .05em 17.5em;
+ margin: .05em .05em .05em 1em;
}
#big-cite .cite-body span {
font-size: 3em;
}
#big-cite .vip {
- float:left;
- text-align:right;
- width: 14.7em;
+ margin-left: 1em;
margin-top: .25em;
}
#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;
#custom-pdf-window label {
display: inline;
}
+
+
+.socialauth {
+ margin: 1em 0;
+ padding: 0;
+}
+.socialauth li {
+ display: inline;
+ list-style: none;
+ margin-right: 1em;
+}
}
#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;
}
-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;
src: url(/static/fonts/WL.ttf) format("truetype");
}
+#logo {
+ margin-left: 1.5em;
+}
#logo a {
font-family: WL-Logo;
- line-height: 7em;
}
#promo-box {
- float: right;
width: 32em;
- margin-top: -5.1em;
}
#promo-box-header {
padding-top: 2em;
#promo-box-body {
border-bottom: 2px solid #efefef;
padding: 2em 2.8em;
- height: 30em;
background: #efefef;
}
#promo-box-title {
}
.infopages-box .social-links a {
- font-family: WL-Nav;
+ font-family: WL-Nav, courier;
font-size: 3em;
color: #281d1c;
margin-right: .2em;
--- /dev/null
+.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;
+}
--- /dev/null
+{% 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 %}
+
+
{% block extra %}
+<h2>{% trans "or join accounts:" %}</h2>
+
+<ul class="socialauth">
+{% include "socialaccount/snippets/provider_list.html" %}
+</ul>
+
<h1>{% trans "or register" %}:</h1>
-<!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 %}
{% 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 %}
" 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>
<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>
{% block title %}{% trans "Wolne Lektury internet library" %}{% endblock %}
+{% block ogtitle %}{% trans "Wolne Lektury internet library" %}{% endblock %}
{% block body %}
<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>
--- /dev/null
+{% 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 %}
--- /dev/null
+<!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>
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'),
class LoginFormView(AjaxableFormView):
form_class = AuthenticationForm
+ template = "auth/login.html"
placeholdize = True
title = _('Sign in')
submit = _('Sign in')