From: Marcin Koziej Date: Mon, 27 Aug 2012 12:20:35 +0000 (+0200) Subject: Merge branch 'master' into search X-Git-Url: https://git.mdrn.pl/prawokultury.git/commitdiff_plain/b1fb752ca1abb051a63da4729e34a80affc25c76?hp=9c8f0adb8bb6c8b86517798d70c2c8dcd198e721 Merge branch 'master' into search Conflicts: prawokultury/settings.d/30-apps.conf requirements.txt --- diff --git a/.gitignore b/.gitignore index fa1b927..5818dca 100644 --- a/.gitignore +++ b/.gitignore @@ -32,3 +32,5 @@ TAGS media search_index +.sass-cache + diff --git a/events/templates/events/snippets/events_box.html b/events/templates/events/snippets/events_box.html index 09e0c85..fc15f6c 100755 --- a/events/templates/events/snippets/events_box.html +++ b/events/templates/events/snippets/events_box.html @@ -9,9 +9,11 @@
{{ event.date|date:"j" }}
{{ event.date|date:"b" }}
- {{ event.place }} - {{ event.title }} - {{ event.organizer }} +
+ {{ event.place }} + {{ event.title }} + {{ event.organizer }} +
diff --git a/migdal/admin.py b/migdal/admin.py index d7a7224..ac0e640 100644 --- a/migdal/admin.py +++ b/migdal/admin.py @@ -22,7 +22,7 @@ class AttachmentInline(admin.TabularInline): class EntryAdmin(admin.ModelAdmin): fieldsets = ( - (None, {'fields': ('type', 'author', 'author_email', 'image')}), + (None, {'fields': (('type', 'promo'), 'author', 'author_email', 'image')}), ) + tuple( (ln, {'fields': ( ('published_%s' % lc), @@ -59,7 +59,7 @@ class EntryAdmin(admin.ModelAdmin): class CategoryAdmin(admin.ModelAdmin): - list_display = translated_fields(('title', 'slug')) + list_display = translated_fields(('title', 'slug')) + ('taxonomy',) prepopulated_fields = dict([ ("slug_%s" % lang_code, ("title_%s" % lang_code,)) for lang_code, lang_name in settings.LANGUAGES diff --git a/migdal/api.py b/migdal/api.py index 7ed17ec..7fd6fe3 100755 --- a/migdal/api.py +++ b/migdal/api.py @@ -2,12 +2,13 @@ # This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +from itertools import chain from migdal.models import Entry from migdal.settings import TYPES from django.utils.translation import get_language -def entry_list(entry_type=None, category=None): +def entry_list(entry_type=None, category=None, promobox=False): lang = get_language() object_list = Entry.objects.filter(**{"published_%s" % lang: True}) if entry_type: @@ -16,4 +17,10 @@ def entry_list(entry_type=None, category=None): object_list = object_list.filter(type__in=[t.db for t in TYPES if t.on_main]) if category: object_list = object_list.filter(categories=category) + + if promobox: + promo = list(object_list.filter(promo=True)[:promobox]) + #object_list = object_list.exclude(pk__in=[p.pk for p in promo]) + object_list.promobox = promo + return object_list diff --git a/migdal/templates/migdal/entry/entry_begin.html b/migdal/templates/migdal/entry/entry_begin.html index 351148e..1c47e89 100755 --- a/migdal/templates/migdal/entry/entry_begin.html +++ b/migdal/templates/migdal/entry/entry_begin.html @@ -1,12 +1,12 @@ {% load i18n %} -{% load gravatar %} +{% load gravatar thumbnail %}

{{ object.title }}

-{{ object.date }} -{{ object.author }} +
{{ object.date }}
+
{{ object.author }}
{% if request.LANGUAGE_CODE == 'pl' %} {% if object.published_en %} @@ -20,13 +20,23 @@ {% endlanguage %} {% endif %} - +
{% for category in object.categories.all %} {{ category }} {% endfor %}
+
+ {% if object.image %} - + {% endif %} +
{{ object.lead }} +
+
+ diff --git a/migdal/templates/migdal/entry/entry_detail.html b/migdal/templates/migdal/entry/entry_detail.html index c101e51..573e139 100755 --- a/migdal/templates/migdal/entry/entry_detail.html +++ b/migdal/templates/migdal/entry/entry_detail.html @@ -4,25 +4,25 @@ {% block "main_menu" %} - {% if entry.categories %} - {% main_menu 'objects' entry.categories.all %} - {% else %} - {% main_menu 'entry_type' entry.type %} - {% endif %} + {% main_menu 'object' entry %} {% endblock "main_menu" %} {% block "body" %}
+
{% entry_begin entry %} +
{{ entry.body }} +
{% if entry.get_type.commentable %} {% render_comment_list for entry %} {% entry_comment_form entry %} {% endif %}
+
{% endblock %} \ No newline at end of file diff --git a/migdal/templates/migdal/entry/entry_list.html b/migdal/templates/migdal/entry/entry_list.html index 0675363..e7dd057 100755 --- a/migdal/templates/migdal/entry/entry_list.html +++ b/migdal/templates/migdal/entry/entry_list.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% load url from future %} {% load i18n %} +{% load pagination_tags %} {% load migdal_tags %} @@ -17,24 +18,47 @@ {% block "body" %} -

{% if category %} {% trans "Category" %}: {{ category }} - RSS +

RSS

{% elif entry_type %} {{ entry_type|capfirst }} - RSS -{% else %} - {% trans "Latest news" %} +

RSS

+{% endif %} + +{% if object_list.promobox and request.page == 1 %} +
+ + +
+
    +{% for object in object_list.promobox %} + {% entry_promobox object forloop.counter %} +{% endfor %} +
+
+ +
{% endif %} - {% if submit %} + {% endif %} + +{% autopaginate object_list 10 %} {% for object in object_list %} {% entry_short object %} {% endfor %} +{% paginate %} {% endblock %} \ No newline at end of file diff --git a/migdal/templates/migdal/entry/entry_promobox.html b/migdal/templates/migdal/entry/entry_promobox.html new file mode 100755 index 0000000..0eb9fac --- /dev/null +++ b/migdal/templates/migdal/entry/entry_promobox.html @@ -0,0 +1,30 @@ +{% load i18n %} + + +
  • + + + + +
    +
    +

    {{ object.title }}

    + +
    +{{ object.lead }} +
    +
    +
    + +
    +
  • diff --git a/migdal/templates/migdal/entry/entry_short.html b/migdal/templates/migdal/entry/entry_short.html index 432f4c4..5dbef6f 100755 --- a/migdal/templates/migdal/entry/entry_short.html +++ b/migdal/templates/migdal/entry/entry_short.html @@ -4,16 +4,30 @@
    +
    + {% entry_begin object %} -{% if object.has_body %} - {% trans "read more" %} -{% endif %} +
    {% if object.get_type.commentable %} {% get_comment_count for object as comment_count %} - + {% blocktrans count comment_count as c %}{{c}} comment{% plural %}{{c}} comments{% endblocktrans %} {% endif %} -
    \ No newline at end of file + +{% if object.body.raw %} + {% trans "read more" %} +{% endif %} + +
    + + + + + +
    +
    + diff --git a/migdal/templates/migdal/entry/info/entry_begin.html b/migdal/templates/migdal/entry/info/entry_begin.html index 256a38d..70d34bd 100755 --- a/migdal/templates/migdal/entry/info/entry_begin.html +++ b/migdal/templates/migdal/entry/info/entry_begin.html @@ -1,3 +1,4 @@ +{% load i18n %}

    {{ object.title }}

    diff --git a/migdal/templatetags/migdal_tags.py b/migdal/templatetags/migdal_tags.py index f56322e..8b20f83 100644 --- a/migdal/templatetags/migdal_tags.py +++ b/migdal/templatetags/migdal_tags.py @@ -39,6 +39,20 @@ def entry_short(context, entry): return t.render(template.Context(context)) +@register.simple_tag(takes_context=True) +def entry_promobox(context, entry, counter): + t = template.loader.select_template(( + 'migdal/entry/%s/entry_promobox.html' % entry.type, + 'migdal/entry/entry_promobox.html', + )) + context = { + 'request': context['request'], + 'object': entry, + 'counter': counter, + } + return t.render(template.Context(context)) + + @register.inclusion_tag('migdal/categories.html', takes_context=True) def categories(context, taxonomy): context = { @@ -75,9 +89,9 @@ class MenuItem(object): class ModelMenuItem(object): - def __init__(self, obj, html_id=None): + def __init__(self, obj, title=None, html_id=None): self.obj = obj - self.title = unicode(obj) + self.title = title or unicode(obj) self.url = obj.get_absolute_url() self.html_id = html_id @@ -85,6 +99,13 @@ class ModelMenuItem(object): self.active = (chooser == 'object' and value == self.obj or chooser == 'objects' and self.obj in value) +class CategoryMenuItem(ModelMenuItem): + def check_active(self, chooser, value): + super(CategoryMenuItem, self).check_active(chooser, value) + self.active = (self.active or + (chooser == 'object' and isinstance(value, Entry) and + self.obj in value.categories.all())) + class EntryTypeMenuItem(object): def __init__(self, title, type_, html_id=None): @@ -104,8 +125,8 @@ def main_menu(context, chooser=None, value=None): ModelMenuItem(Entry.objects.get(slug_pl='o-nas')), EntryTypeMenuItem(_(u'Publications'), u'publications'), MenuItem(_(u'Events'), reverse('events')), - ModelMenuItem(Category.objects.get(slug_pl='stanowisko')), - ModelMenuItem(Category.objects.get(slug_pl='pierwsza-pomoc')), + CategoryMenuItem(Category.objects.get(slug_pl='stanowisko'), title=_('Positions')), + CategoryMenuItem(Category.objects.get(slug_pl='pierwsza-pomoc')), ] if context['request'].LANGUAGE_CODE == 'pl': items.append(MenuItem(u'en', '/en/', html_id='item-lang')) diff --git a/migdal/views.py b/migdal/views.py index 42a2a39..07eeb50 100644 --- a/migdal/views.py +++ b/migdal/views.py @@ -28,7 +28,10 @@ def entry_list(request, type_db=None, category_slug=None): else: category = None - object_list = api.entry_list(entry_type=entry_type, category=category) + promobox = 5 if entry_type is None and category is None else None + + object_list = api.entry_list(entry_type=entry_type, category=category, + promobox=promobox) return render(request, templates, { 'object_list': object_list, diff --git a/prawokultury/settings.d/30-apps.conf b/prawokultury/settings.d/30-apps.conf index 3824631..c950a4e 100755 --- a/prawokultury/settings.d/30-apps.conf +++ b/prawokultury/settings.d/30-apps.conf @@ -9,6 +9,8 @@ INSTALLED_APPS = ( 'django_comments_xtd', 'pipeline', 'haystack', + 'pagination', + 'sorl.thumbnail', 'django.contrib.auth', 'django.contrib.contenttypes', diff --git a/prawokultury/settings.d/40-middleware.conf b/prawokultury/settings.d/40-middleware.conf index 72f7e14..3d9f0ea 100755 --- a/prawokultury/settings.d/40-middleware.conf +++ b/prawokultury/settings.d/40-middleware.conf @@ -9,4 +9,5 @@ MIDDLEWARE_CLASSES = ( 'django.contrib.messages.middleware.MessageMiddleware', # Uncomment the next line for simple clickjacking protection: # 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'pagination.middleware.PaginationMiddleware', ) diff --git a/prawokultury/settings.d/50-contrib.conf b/prawokultury/settings.d/50-contrib.conf index b1874d4..ba1ebd1 100755 --- a/prawokultury/settings.d/50-contrib.conf +++ b/prawokultury/settings.d/50-contrib.conf @@ -8,3 +8,5 @@ MARKUP_FIELD_TYPES = ( ) COMMENTS_XTD_LIST_URL_ACTIVE = True #COMMENTS_XTD_LIST_PAGINATE_BY = 10 + +THUMBNAIL_QUALITY = 95 diff --git a/prawokultury/settings.d/50-static.conf b/prawokultury/settings.d/50-static.conf index 9eac192..2c42405 100755 --- a/prawokultury/settings.d/50-static.conf +++ b/prawokultury/settings.d/50-static.conf @@ -15,8 +15,30 @@ PIPELINE_JS_COMPRESSOR = None PIPELINE_CSS = { 'base': { 'source_filenames': ( - 'css/base.css', + 'css/base.scss', + 'css/layout.scss', + 'css/header.scss', + 'css/menu.scss', + 'css/search.scss', + 'css/sidebar.scss', + 'css/promobox.scss', + 'css/entry.scss', + 'css/footer.scss', ), 'output_filename': 'compressed/base.css', }, } +PIPELINE_JS = { + 'base': { + 'source_filenames': ( + 'js/promobox.js', + ), + 'output_filename': 'compressed/base.js', + }, +} + +PIPELINE_COMPILERS = ( + 'pipeline.compilers.sass.SASSCompiler', +) + +PIPELINE_STORAGE = 'pipeline.storage.PipelineFinderStorage' diff --git a/prawokultury/static/css/base.css b/prawokultury/static/css/base.css old mode 100755 new mode 100644 index 82be08d..f2d3236 --- a/prawokultury/static/css/base.css +++ b/prawokultury/static/css/base.css @@ -1,171 +1,15 @@ +@import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic); body { - font-family: sans-serif; - font-size: .625em; - background: #edece7; -} + font-family: 'Lato', sans-serif; + font-size: .625em; + background: #edece7; + background-image: url("/static/img/bg.png"); + background-repeat: no-repeat; + margin-top: 0; + background-position: 50% 0; } a { - text-decoration: none; -} -a:hover { - text-decoration: underline; -} - -#menu { - list-style: none; - padding-left: 0; - margin-left: 0; - text-transform: uppercase; - margin: 0; -} -#menu #item-lang a { - color: #0050a2; -} -#menu li { - display: inline-block; - position: relative; - list-style: none; - padding-left: 0; - margin-right: 5em; -} -#menu li a { - color: black; -} -#menu li.active { - font-weight: bold; -} -#menu li.active:before { - color: #004e98; - content: "("; - position: absolute; - left: -.7em; - font-size: 2em; - top: -.25em; -} -#menu li.active:after { - color: #004e98; - content: ")"; - position: absolute; - right: -.7em; - font-size: 2em; - top: -.25em; -} - -.avatar { - float: left; - margin-left: -60px; -} -.entry { - margin-left: 60px; -} -.entry h2 { - margin: 0; -} -.entry-data { - font-size: .8em; -} - - - -.bar-right { - width: 25em; - float: right; -} -.bar-left { - width: 70em; - float: left; -} -#body { - width: 96em; - margin: auto; - padding: 1em; -} -#footer-bar { - color: #4b4c47; - border-top: 1px solid #acacaa; - padding-top: 1.5em; - margin-top: 4em; -} -.footer-item { - width: 24em; - float: left; -} -#search-form input { - font-size: 1.1em; - width: 18em; - border: none; - border-radius: 1.5em 0 0 1.5em; - background: white; - color: black; - height: 2em; -} -#search-form button { - font-size: 1.1em; - width: 3em; - height: 2em; - border: none; - background: #3bb0a8; - color: white; - border-radius: 0 1em 1em 0; -} - -.sidebar-box { - border-top: 1px solid #8a8b85; - padding-top: 1.5em; - padding-bottom: 1.5em; - clear: both; -} + text-decoration: none; } -.sidebar-box .event-list { - list-style: none; - padding-left: 0; -} -.sidebar-box .more { - text-align: right; -} -.sidebar-box .event-list li { - margin-top: .8em; -} - -.sidebar-box .event-list .date { - clear: both; - float: left; - background: #494949; - color: #69efe6; - width: 4em; - height: 3.8em; - border-radius: .5em; - padding: .5em; - text-align: center; - margin-right: 1em; -} -.sidebar-box .event-list a { - display: block; -} -.sidebar-box .event-list .date .day { - font-size: 1.8em; - font-style: italic; -} -.sidebar-box .event-list .date .mon { - text-transform: uppercase; -} - -#sidebar-box-categories ul { - width: 50%; - display: table-cell; - list-style: none; - padding-left: 0; - padding-right: 4em; -} -#sidebar-box-categories .category-taxonomy-topics a { - color: #31ada3; -} - -#sidebar-box-categories .category-taxonomy-types a { - color: #ff6100; -} - - -sdiv { - border: #ddd 1px solid; -} \ No newline at end of file +a:hover { + text-decoration: underline; } diff --git a/prawokultury/static/css/base.scss b/prawokultury/static/css/base.scss new file mode 100755 index 0000000..cbe589b --- /dev/null +++ b/prawokultury/static/css/base.scss @@ -0,0 +1,18 @@ +@import url(http://fonts.googleapis.com/css?family=Lato:400,700,400italic); + +body { + font-family: 'Lato', sans-serif; + font-size: .625em; + background: #edece7; + background-image: url('/static/img/bg.png'); + background-repeat: no-repeat; + margin-top: 0; + background-position: 50% 0; +} + +a { + text-decoration: none; +} +a:hover { + text-decoration: underline; +} diff --git a/prawokultury/static/css/entry.css b/prawokultury/static/css/entry.css new file mode 100644 index 0000000..cf23152 --- /dev/null +++ b/prawokultury/static/css/entry.css @@ -0,0 +1,63 @@ +.avatar { + float: left; + margin-left: -7.5em; + margin-top: .8em; } + +.entry-short { + border-top: 1px solid #8b8b87; } + +.entry-wrapped { + margin-left: 8em; + padding-top: .7em; } + .entry-wrapped h2 { + margin: 0; + font-size: 1.2em; + color: #01519a; } + .entry-wrapped .entry-data { + font-size: 1.1em; + margin-top: 1.4em; + margin-bottom: 1.4em; } + .entry-wrapped .entry-data .date { + color: #acacac; } + .entry-wrapped .entry-data .author { + font-weight: bold; } + .entry-wrapped .entry-data .categories { + font-style: italic; } + .entry-wrapped .entry-data .categories a { + color: black; } + .entry-wrapped .lead { + font-size: 1.1em; } + .entry-wrapped .body { + font-size: 1.1em; } + .entry-wrapped .more { + float: right; + font-size: 1.1em; + font-style: italic; + margin-top: .6em; + margin-bottom: 1.8em; } + .entry-wrapped .more a { + color: #acacac; } + .entry-wrapped .more .read-more { + margin-left: 1.5em; } + .entry-wrapped .more .comments:after { + content: url("/static/img/comments.png"); + margin-left: .7em; } + .entry-wrapped .more .read-more:after { + content: url("/static/img/read-more.png"); + margin-left: .7em; } + +.entry-picture { + float: left; + margin-right: 1.5em; } + +.submit-link { + margin-top: 1em; + margin-bottom: 1em; + height: 1.7em; } + .submit-link a { + color: black; + font-size: 1.1em; } + .submit-link a:before { + content: url("/static/img/plus.png"); + vertical-align: top; + margin-right: 1em; } diff --git a/prawokultury/static/css/entry.scss b/prawokultury/static/css/entry.scss new file mode 100755 index 0000000..4c54530 --- /dev/null +++ b/prawokultury/static/css/entry.scss @@ -0,0 +1,91 @@ +.avatar { + float: left; + margin-left: -7.5em; + margin-top: .8em; +} + +.entry-short { + border-top: 1px solid #8b8b87; +} + +.entry-wrapped { + margin-left: 8em; + padding-top: .7em; + + h2 { + margin: 0; + font-size: 1.2em; + color: #01519a; + } + + .entry-data { + font-size: 1.1em; + margin-top: 1.4em; + margin-bottom: 1.4em; + .date { + color: #acacac; + } + .author { + font-weight: bold; + } + .categories { + font-style: italic; + a { + color: black; + } + } + } + + .lead { + font-size: 1.1em; + } + + .body { + font-size: 1.1em; + } + + .more { + float: right; + font-size: 1.1em; + font-style: italic; + margin-top: .6em; + margin-bottom: 1.8em; + + a { + color: #acacac; + } + .read-more { + margin-left: 1.5em; + } + .comments:after { + content: url('/static/img/comments.png'); + margin-left: .7em; + } + .read-more:after { + content: url('/static/img/read-more.png'); + margin-left: .7em; + } + } +} + + +.entry-picture { + float: left; + margin-right: 1.5em; +} + +.submit-link { + margin-top: 1em; + margin-bottom: 1em; + height: 1.7em; + + a { + color: black; + font-size: 1.1em; + } + a:before { + content: url("/static/img/plus.png"); + vertical-align: top; + margin-right: 1em; + } +} \ No newline at end of file diff --git a/prawokultury/static/css/footer.css b/prawokultury/static/css/footer.css new file mode 100644 index 0000000..cafef05 --- /dev/null +++ b/prawokultury/static/css/footer.css @@ -0,0 +1,11 @@ +#footer-bar { + color: #4b4c47; + border-top: 1px solid #acacaa; + padding-top: 1.5em; + margin-top: 4em; + margin-left: 1em; + margin-right: 1em; } + +.footer-item { + width: 24em; + float: left; } diff --git a/prawokultury/static/css/footer.scss b/prawokultury/static/css/footer.scss new file mode 100755 index 0000000..0e9f54b --- /dev/null +++ b/prawokultury/static/css/footer.scss @@ -0,0 +1,13 @@ +#footer-bar { + color: #4b4c47; + border-top: 1px solid #acacaa; + padding-top: 1.5em; + margin-top: 4em; + margin-left: 1em; + margin-right: 1em; +} + +.footer-item { + width: 24em; + float: left; +} diff --git a/prawokultury/static/css/header.css b/prawokultury/static/css/header.css new file mode 100644 index 0000000..0020c13 --- /dev/null +++ b/prawokultury/static/css/header.css @@ -0,0 +1,17 @@ +#header-bar { + height: 9em; + padding-top: 3em; } + #header-bar .bar-left { + margin-left: -1.1em; } + +.org-fnp, .org-trust { + display: inline-block; + width: 8em; } + .org-fnp span, .org-trust span { + color: #888; } + .org-fnp img, .org-trust img { + margin-left: -0.3em; + margin-top: 1em; } + +.org-fnp { + margin-right: 4em; } diff --git a/prawokultury/static/css/header.scss b/prawokultury/static/css/header.scss new file mode 100755 index 0000000..aae0e73 --- /dev/null +++ b/prawokultury/static/css/header.scss @@ -0,0 +1,27 @@ +#header-bar { + height: 9em; + padding-top: 3em; + + .bar-left { + margin-left: -1.1em; + } + +} + + +.org-fnp, .org-trust { + display: inline-block; + width: 8em; + + span { + color: #888; + } + + img { + margin-left: -.3em; + margin-top: 1em; + } +} +.org-fnp { + margin-right: 4em; +} diff --git a/prawokultury/static/css/layout.css b/prawokultury/static/css/layout.css new file mode 100644 index 0000000..7a14806 --- /dev/null +++ b/prawokultury/static/css/layout.css @@ -0,0 +1,13 @@ +.bar-right { + width: 22em; + padding: 0 1em; + float: right; } + +.bar-left { + width: 70em; + padding: 0 1em; + float: left; } + +#body { + width: 96em; + margin: auto; } diff --git a/prawokultury/static/css/layout.scss b/prawokultury/static/css/layout.scss new file mode 100755 index 0000000..56a1aab --- /dev/null +++ b/prawokultury/static/css/layout.scss @@ -0,0 +1,17 @@ +.bar-right { + width: 22em; + padding: 0 1em; + float: right; +} + +.bar-left { + width: 70em; + padding: 0 1em; + float: left; +} + +#body { + width: 96em; + margin: auto; +} + diff --git a/prawokultury/static/css/menu.css b/prawokultury/static/css/menu.css new file mode 100644 index 0000000..d9b2f4a --- /dev/null +++ b/prawokultury/static/css/menu.css @@ -0,0 +1,37 @@ +#menu-bar { + height: 4em; } + +#menu { + list-style: none; + margin-left: 0; + text-transform: uppercase; + margin: .7em 0 0 0; } + #menu li { + display: inline-block; + position: relative; + list-style: none; + padding-left: 0; + margin-right: 3em; } + #menu li a { + color: black; + font-size: 1.1em; } + #menu li:last { + margin-right: 0; } + #menu li.active { + font-weight: bold; } + #menu li.active:before { + color: #004e98; + content: "("; + position: absolute; + left: -0.7em; + font-size: 2em; + top: -0.25em; } + #menu li.active:after { + color: #004e98; + content: ")"; + position: absolute; + right: -0.7em; + font-size: 2em; + top: -0.25em; } + #menu #item-lang a { + color: #0050a2; } diff --git a/prawokultury/static/css/menu.scss b/prawokultury/static/css/menu.scss new file mode 100755 index 0000000..2509d6f --- /dev/null +++ b/prawokultury/static/css/menu.scss @@ -0,0 +1,49 @@ +#menu-bar { + height: 4em; +} + +#menu { + list-style: none; + margin-left: 0; + text-transform: uppercase; + margin: .7em 0 0 0; + + li { + display: inline-block; + position: relative; + list-style: none; + padding-left: 0; + margin-right: 3em; + + a { + color: black; + font-size: 1.1em; + } + } + li:last { + margin-right: 0; + } + li.active { + font-weight: bold; + } + li.active:before { + color: #004e98; + content: "("; + position: absolute; + left: -.7em; + font-size: 2em; + top: -.25em; + } + li.active:after { + color: #004e98; + content: ")"; + position: absolute; + right: -.7em; + font-size: 2em; + top: -.25em; + } + + #item-lang a { + color: #0050a2; + } +} \ No newline at end of file diff --git a/prawokultury/static/css/promobox.css b/prawokultury/static/css/promobox.css new file mode 100644 index 0000000..58c4cfe --- /dev/null +++ b/prawokultury/static/css/promobox.css @@ -0,0 +1,64 @@ +#promobox { + position: relative; } + #promobox a:hover { + text-decoration: none; } + +ul.promobox { + list-style: none; + padding: 0; + margin: 0; + height: 32.3em; + overflow: hidden; + position: relative; } + +.promobox-item { + border-radius: 0 0 2em 0; + list-style: none; + padding: 0; + margin: 0; + position: absolute; + width: 100%; } + +.promobox-link { + background-image: url("/static/img/rog.png"); + display: block; + position: relative; + height: 32.3em; + background-position: 100% 100%; + background-repeat: no-repeat; } + +#promobox-switcher { + position: absolute; + top: 1.6em; + list-style: none; + margin: 0; + padding: 0; + z-index: 100; } + #promobox-switcher a { + display: block; + background: black; + font-size: 1.1em; + width: 1.1em; + padding: .45em .5em; + border-radius: 0 1em 1em 0; + color: white; } + #promobox-switcher .active a { + background: #02529b; } + +.promobox-info { + position: absolute; + top: 15.4em; + background-color: #64c0bd; + color: white; + width: 20em; + padding: 1.5em 4.8em 1.2em 2em; + border-radius: 0 6em 6em 0; } + .promobox-info .clip { + height: 9.7em; + overflow: hidden; } + .promobox-info h2 { + margin-top: 0; + font-size: 1.5em; } + .promobox-info .lead { + font-size: 1.2em; + line-height: 1.1em; } diff --git a/prawokultury/static/css/promobox.scss b/prawokultury/static/css/promobox.scss new file mode 100755 index 0000000..cf209c5 --- /dev/null +++ b/prawokultury/static/css/promobox.scss @@ -0,0 +1,77 @@ +#promobox { + position: relative; + a:hover { + text-decoration: none; + } +} +ul.promobox { + list-style: none; + padding: 0; + margin: 0; + height: 32.3em; + overflow: hidden; + position: relative; +} +.promobox-item { + border-radius: 0 0 2em 0; + list-style:none; + padding:0; + margin: 0; + position:absolute; + width: 100%; +} +.promobox-link { + background-image: url('/static/img/rog.png'); + display:block; + position: relative; + height: 32.3em; + background-position: 100% 100%; + background-repeat: no-repeat; +} + +#promobox-switcher { + position: absolute; + top: 1.6em; + list-style: none; + margin: 0; + padding: 0; + z-index: 100; + + a { + display: block; + background:black; + font-size: 1.1em; + width: 1.1em; + padding: .45em .5em; + border-radius: 0 1em 1em 0; + color: white; + } + .active a { + background: #02529b; + } +} + +.promobox-info { + position: absolute; + top: 15.4em; + background-color: #64c0bd; + color: white; + width: 20em; + padding: 1.5em 4.8em 1.2em 2em; + border-radius: 0 6em 6em 0; + + .clip { + height: 9.7em; + overflow:hidden; + } + + h2 { + margin-top: 0; + font-size: 1.5em; + } + .lead { + font-size: 1.2em; + line-height: 1.1em; + } + +} diff --git a/prawokultury/static/css/search.css b/prawokultury/static/css/search.css new file mode 100644 index 0000000..61e75d5 --- /dev/null +++ b/prawokultury/static/css/search.css @@ -0,0 +1,24 @@ +#search-form { + margin-top: .4em; } + #search-form input { + font-size: 1.1em; + width: 17.1em; + padding-left: 1em; + border: none; + border-radius: 1.5em 0 0 1.5em; + background: white; + color: black; + height: 2em; } + #search-form button { + font-size: 1.1em; + width: 2.7em; + height: 2em; + border: none; + background: #3bb0a8; + background-image: url("/static/img/search-bg.png"); + background-repeat: no-repeat; + color: white; + border-radius: 0 1em 1em 0; + padding-right: 1em; } + #search-form button img { + vertical-align: middle; } diff --git a/prawokultury/static/css/search.scss b/prawokultury/static/css/search.scss new file mode 100755 index 0000000..7b73859 --- /dev/null +++ b/prawokultury/static/css/search.scss @@ -0,0 +1,31 @@ +#search-form { + margin-top: .4em; + + input { + font-size: 1.1em; + width: 17.1em; + padding-left: 1em; + border: none; + border-radius: 1.5em 0 0 1.5em; + background: white; + color: black; + height: 2em; + } + + button { + font-size: 1.1em; + width: 2.7em; + height: 2em; + border: none; + background: #3bb0a8; + background-image: url('/static/img/search-bg.png'); + background-repeat: no-repeat; + color: white; + border-radius: 0 1em 1em 0; + padding-right: 1em; + + img { + vertical-align: middle; + } + } +} diff --git a/prawokultury/static/css/sidebar.css b/prawokultury/static/css/sidebar.css new file mode 100644 index 0000000..9c245f5 --- /dev/null +++ b/prawokultury/static/css/sidebar.css @@ -0,0 +1,56 @@ +.sidebar-box { + border-top: 1px solid #8a8b85; + padding-top: 1.5em; + padding-bottom: .9em; + clear: both; } + .sidebar-box h3 { + font-size: 1.3em; + font-weight: normal; + margin-top: 0; + margin-bottom: 1.2em; } + .sidebar-box .more { + text-align: right; } + .sidebar-box .event-list { + list-style: none; + padding-left: 0; } + .sidebar-box .event-list li { + margin-top: 1em; } + .sidebar-box .event-list a { + display: block; } + .sidebar-box .event-list .date { + clear: both; + float: left; + background: #e63612; + background-image: url("/static/img/calendar.png"); + background-repeat: no-repeat; + color: #71ece6; + width: 5em; + height: 4.8em; + border-radius: .5em; + text-align: center; + margin-right: 1em; } + .sidebar-box .event-list .date .day { + font-size: 2.4em; + font-style: italic; } + .sidebar-box .event-list .date .mon { + font-size: 1.1em; + text-transform: uppercase; + margin-top: -0.3em; } + .sidebar-box .event-list .date:hover { + text-decoration: none; } + .sidebar-box .event-list .description { + color: black; + font-size: 1.1em; } + +#sidebar-box-categories ul { + width: 50%; + display: table-cell; + list-style: none; + padding-left: 0; + padding-right: 4em; + font-size: 1.4em; + padding-right: 3.4em; } +#sidebar-box-categories .category-taxonomy-topics a { + color: #31ada3; } +#sidebar-box-categories .category-taxonomy-types a { + color: #ff6100; } diff --git a/prawokultury/static/css/sidebar.scss b/prawokultury/static/css/sidebar.scss new file mode 100755 index 0000000..bac9f31 --- /dev/null +++ b/prawokultury/static/css/sidebar.scss @@ -0,0 +1,82 @@ +.sidebar-box { + border-top: 1px solid #8a8b85; + padding-top: 1.5em; + padding-bottom: .9em; + clear: both; + + h3 { + font-size: 1.3em; + font-weight: normal; + margin-top: 0; + margin-bottom: 1.2em; + } + + .more { + text-align: right; + } + + .event-list { + list-style: none; + padding-left: 0; + + li { + margin-top: 1em; + } + + a { + display: block; + } + + .date { + clear: both; + float: left; + background: #e63612; + background-image: url('/static/img/calendar.png'); + background-repeat: no-repeat; + color: #71ece6; + width: 5em; + height: 4.8em; + border-radius: .5em; + text-align: center; + margin-right: 1em; + + .day { + font-size: 2.4em; + font-style: italic; + } + .mon { + font-size: 1.1em; + text-transform: uppercase; + margin-top: -.3em; + } + } + + .date:hover { + text-decoration: none; + } + + .description { + color: black; + font-size: 1.1em; + } + } +} + +#sidebar-box-categories { + ul { + width: 50%; + display: table-cell; + list-style: none; + padding-left: 0; + padding-right: 4em; + font-size: 1.4em; + padding-right: 3.4em; + } + .category-taxonomy-topics a { + color: #31ada3; + } + + .category-taxonomy-types a { + color: #ff6100; + } +} diff --git a/prawokultury/static/img/bg.png b/prawokultury/static/img/bg.png new file mode 100644 index 0000000..e1f2aa9 Binary files /dev/null and b/prawokultury/static/img/bg.png differ diff --git a/prawokultury/static/img/calendar.png b/prawokultury/static/img/calendar.png new file mode 100644 index 0000000..891a585 Binary files /dev/null and b/prawokultury/static/img/calendar.png differ diff --git a/prawokultury/static/img/comments.png b/prawokultury/static/img/comments.png new file mode 100644 index 0000000..cfea4d9 Binary files /dev/null and b/prawokultury/static/img/comments.png differ diff --git a/prawokultury/static/img/logo-fnp.png b/prawokultury/static/img/logo-fnp.png new file mode 100644 index 0000000..46881e4 Binary files /dev/null and b/prawokultury/static/img/logo-fnp.png differ diff --git a/prawokultury/static/img/logo-trust.png b/prawokultury/static/img/logo-trust.png new file mode 100644 index 0000000..b3d4eed Binary files /dev/null and b/prawokultury/static/img/logo-trust.png differ diff --git a/prawokultury/static/img/logo.png b/prawokultury/static/img/logo.png new file mode 100644 index 0000000..cc650f1 Binary files /dev/null and b/prawokultury/static/img/logo.png differ diff --git a/prawokultury/static/img/plus.png b/prawokultury/static/img/plus.png new file mode 100644 index 0000000..3a47b3c Binary files /dev/null and b/prawokultury/static/img/plus.png differ diff --git a/prawokultury/static/img/read-more.png b/prawokultury/static/img/read-more.png new file mode 100644 index 0000000..1793af4 Binary files /dev/null and b/prawokultury/static/img/read-more.png differ diff --git a/prawokultury/static/img/rog.png b/prawokultury/static/img/rog.png new file mode 100644 index 0000000..5c9a55b Binary files /dev/null and b/prawokultury/static/img/rog.png differ diff --git a/prawokultury/static/img/search-bg.png b/prawokultury/static/img/search-bg.png new file mode 100644 index 0000000..46a5a06 Binary files /dev/null and b/prawokultury/static/img/search-bg.png differ diff --git a/prawokultury/static/img/search.png b/prawokultury/static/img/search.png new file mode 100644 index 0000000..d6679ce Binary files /dev/null and b/prawokultury/static/img/search.png differ diff --git a/prawokultury/static/js/promobox.js b/prawokultury/static/js/promobox.js new file mode 100644 index 0000000..91128ca --- /dev/null +++ b/prawokultury/static/js/promobox.js @@ -0,0 +1,40 @@ +$(document).ready(function(){ + +var $slides = $("ul.promobox li"); +var $switchers = $("ul#promobox-switcher li"); + +var change_slide = function(slide_no) { + var $slide = $($slides.get(slide_no)); + var $switcher = $($switchers.get(slide_no)); + + $slides.filter('.active').fadeOut(); + $slides.filter('.active').removeClass('active'); + $switchers.filter('.active').removeClass('active'); + $slide.fadeIn(); + $slide.addClass('active'); + $switcher.addClass('active'); + reset_timeout(); +}; + + +$switchers.each(function(i, e) { + $(e).click(function(e) { + e.preventDefault(); + change_slide(i); + }); +}); + + +var timeout = null; +var cycle_slide = function() { + var current = $slides.filter('.active').index(); + change_slide((current + 1) % $slides.length); +} +var reset_timeout = function() { + clearTimeout(timeout); + timeout = setTimeout(cycle_slide, 5000); +}; +timeout = setTimeout(cycle_slide, 3000); + + +}); \ No newline at end of file diff --git a/prawokultury/templates/base.html b/prawokultury/templates/base.html index a5d0325..452e3f0 100755 --- a/prawokultury/templates/base.html +++ b/prawokultury/templates/base.html @@ -1,8 +1,7 @@ {% load url from future %} -{% load i18n %} +{% load i18n static %} {% load migdal_tags events_tags %} {% load compressed %} - {% trans "Culture's right" %} @@ -10,21 +9,35 @@
    +
    - [Logo FNP] - [Logo OSI] +
    + {% trans "Organizer" %}
    + + {% trans +
    + {% trans "Sponsor" %}
    + + {% trans +
    + + {% compressed_js 'base' %} \ No newline at end of file diff --git a/prawokultury/urls.py b/prawokultury/urls.py index 6da0510..436cb0e 100644 --- a/prawokultury/urls.py +++ b/prawokultury/urls.py @@ -25,5 +25,11 @@ urlpatterns = patterns('', url(r'^comments/', include('django_comments_xtd.urls')), ) + migdal_urlpatterns +if settings.DEBUG: + urlpatterns += patterns('', + url(r'^media/(?P.*)$', 'django.views.static.serve', { + 'document_root': settings.MEDIA_ROOT, + }), + ) urlpatterns += staticfiles_urlpatterns() diff --git a/requirements.txt b/requirements.txt index 7efd852..145192a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,12 +2,17 @@ Django>=1.4,<1.5 South>=0.7.4 PIL sorl-thumbnail>=11.09,<12 +django-pagination textile django-markupfield django-gravatar django_comments_xtd -django-pipeline +django-pipeline>=1.2,<1.3 + +#pyScss +#git+git://github.com/Kronuz/pyScss.git@d8f4da23a3c87696a75b3830ed4ab49b75550a93#egg=pyScss +#TODO: pyScss support, for now just install sass -e git+https://github.com/toastdriven/django-haystack.git@master#egg=django-haystack pysolr