+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-10 14:32+0200\n"
-"PO-Revision-Date: 2012-10-10 14:33+0100\n"
-"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
-"Language-Team: LANGUAGE <LL@li.org>\n"
-"Language: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
-
-#: templates/fnpdjango/share.html:5
-#: templates/fnpdjango/share.html.py:7
-msgid "Share on Facebook"
-msgstr "Podziel się na Facebooku"
-
-#: templates/fnpdjango/share.html:10
-#: templates/fnpdjango/share.html.py:12
-msgid "Share on Google+"
-msgstr "Podziel się na Google+"
-
-#: templates/fnpdjango/share.html:15
-#: templates/fnpdjango/share.html.py:17
-msgid "Share on Twitter"
-msgstr "Podziel się na Twitterze"
-
-#: templates/fnpdjango/share.html:20
-#: templates/fnpdjango/share.html.py:22
-msgid "Share on NK.pl"
-msgstr "Podziel się na NK.pl"
-
-#: templates/fnpdjango/prevnext/next.html:13
-msgid "next"
-msgstr "następne"
-
-#: templates/fnpdjango/prevnext/previous.html:13
-msgid "previous"
-msgstr "poprzednie"
-
+++ /dev/null
-from django.utils import translation
-from django.conf import settings
-from django.http import Http404
-
-
-class SetRemoteAddrFromXRealIP(object):
- """Sets REMOTE_ADDR from the X-Real-IP header, as set by Nginx."""
- def process_request(self, request):
- try:
- request.META['REMOTE_ADDR'] = request.META['HTTP_X_REAL_IP']
- except KeyError:
- return None
-
-
-class URLLocaleMiddleware(object):
- """Decides which translation to use, based on path only."""
-
- def process_request(self, request):
- language = translation.get_language_from_path(request.path_info)
- if language == settings.LANGUAGE_CODE:
- raise Http404
- if language:
- translation.activate(language)
- request.LANGUAGE_CODE = translation.get_language()
-
- def process_response(self, request, response):
- language = translation.get_language()
- translation.deactivate()
- if 'Content-Language' not in response:
- response['Content-Language'] = language
- return response
+++ /dev/null
-{% load i18n fnp_lang %}
-{% for lc, ln in languages %}
- {% if lc != request.LANGUAGE_CODE %}
- <a href="{{ request|get_here_url:lc }}">{{ lc }}</a>
- {% endif %}
-{% endfor %}
\ No newline at end of file
+++ /dev/null
-{% if number or url %}
- {% load i18n %}
- <a class="next_page"
- {% if number %}
- href="?page={{ number }}"
- {% else %}
- href="{{ url }}"
- {% endif %}
- >
- {% if title %}
- {{ title }}
- {% else %}
- {% trans "next" %}
- {% endif %}
- </a>
-{% endif %}
\ No newline at end of file
+++ /dev/null
-{% if number or url %}
- {% load i18n %}
- <a class="previous_page"
- {% if number %}
- href="?page={{ number }}"
- {% else %}
- href="{{ url }}"
- {% endif %}
- >
- {% if title %}
- {{ title }}
- {% else %}
- {% trans "previous" %}
- {% endif %}
- </a>
-{% endif %}
\ No newline at end of file
+++ /dev/null
-{% load fnp_prevnext %}
-<p class="prevnext">
-{% next_page %}
-{% previous_page %}
-</p>
\ No newline at end of file
+++ /dev/null
-{% load i18n fnp_common static %}
-{% with encoded_url=url|build_absolute_uri:request|urlencode encoded_desc=description|urlencode %}
-<a rel="nofollow" target="_blank" class="facebook"
- href="https://www.facebook.com/sharer.php?u={{ encoded_url }}"
- title="{% trans 'Share on Facebook' %}">
- <img src="{% static "img/social/"|add:iconset|add:"facebook.png" %}"
- alt="{% trans 'Share on Facebook' %}"></a>
-<a rel="nofollow" target="_blank" class="google"
- href="https://plus.google.com/share?url={{ encoded_url }}"
- title="{% trans 'Share on Google+' %}">
- <img src="{% static "img/social/"|add:iconset|add:"google.png" %}"
- alt="{% trans 'Share on Google+' %}"></a>
-<a rel="nofollow" target="_blank" class="twitter"
- href="https://twitter.com/intent/tweet?url={{ encoded_url }}&text={{ encoded_desc }}"
- title="{% trans 'Share on Twitter' %}">
- <img src="{% static "img/social/"|add:iconset|add:"twitter.png" %}"
- alt="{% trans 'Share on Twitter' %}"></a>
-<a rel="nofollow" target="_blank" class="nk"
- href="http://nk.pl/#sledzik?shout={{ encoded_desc }}%20{{ encoded_url }}"
- title="{% trans 'Share on NK.pl' %}">
- <img src="{% static "img/social/"|add:iconset|add:"nk.png" %}"
- alt="{% trans 'Share on NK.pl' %}"></a>
-{% comment %}
-<a rel="nofollow" target="_blank" class="diaspora"
- href="http://sharetodiaspora.github.com/?title={{ encoded_desc }}&url={{ encoded_url }}"
- title="{% trans 'Share on Diaspora' %}">
- <img src="{% static "img/social/"|add:iconset|add:"diaspora.png" %}"
- alt="{% trans 'Share on Diaspora' %}"></a>
-<a rel="nofollow" target="_blank" class="blip"
- href="http://blip.pl/dashboard?body={{ encoded_desc }}%20{{ encoded_url }}"
- title="{% trans 'Share on Blip.pl' %}">
- <img src="{% static "img/social/"|add:iconset|add:"blip.png" %}"
- alt="{% trans 'Share on Blip.pl' %}"></a>
-{% endcomment %}
-{% endwith %}
\ No newline at end of file
+++ /dev/null
-from django import template
-register = template.Library()
-
-
-@register.filter
-def build_absolute_uri(uri, request):
- return request.build_absolute_uri(uri)
+++ /dev/null
-from django.conf import settings
-from django.core.urlresolvers import resolve, reverse, Resolver404
-from django import template
-from django.utils import translation
-from ..utils.views import get_current_object
-
-register = template.Library()
-
-
-@register.inclusion_tag('fnpdjango/lang_switcher.html', takes_context=True)
-def lang_switcher(context):
- """Context-aware language switcher.
-
- Use ..utils.views.set_current_object to provide the context.
- """
- request = context['request']
- obj = get_current_object(request)
- languages = settings.LANGUAGES
- if hasattr(obj, 'get_available_languages'):
- available_languages = set(obj.get_available_languages())
- languages = [lang for lang in languages if lang[0] in available_languages]
- return {
- 'request': request,
- 'languages': languages,
- }
-
-
-@register.filter
-def get_here_url(request, lang):
- obj = get_current_object(request, for_url=True)
- if hasattr(obj, 'get_absolute_url'):
- with translation.override(lang):
- url = obj.get_absolute_url()
- else:
- try:
- match = resolve(request.get_full_path())
- except Resolver404:
- match = resolve('/')
- view = match.url_name
- if view is None:
- view = match.func
- if lang is None:
- lang = translation.get_language()
- with translation.override(lang):
- url = reverse(view, args=match.args, kwargs=match.kwargs)
- return url
-
-
+++ /dev/null
-from django import template
-from django.utils.safestring import mark_safe
-from ..utils.text import textilepl
-
-register = template.Library()
-
-
-@register.filter
-def textile_pl(node):
- return mark_safe(textile.textile_pl(node))
-
-@register.filter
-def textile_restricted_pl(node):
- return mark_safe(textile.textile_restricted_pl(node))
+++ /dev/null
-from django.template import Library
-
-register = Library()
-
-
-@register.inclusion_tag('fnpdjango/prevnext/previous.html', takes_context=True)
-def previous_page(context, fallback=None, fallback_title=None):
- current = context['page_obj'].number
- if current > 1:
- return {'number': current - 1, 'title': None, 'url': None}
- else:
- return {'number': None, 'title': fallback_title, 'url': fallback}
-
-
-@register.inclusion_tag('fnpdjango/prevnext/next.html', takes_context=True)
-def next_page(context, fallback=None, fallback_title=None):
- current = context['page_obj'].number
- page_range = context['paginator'].page_range
- if current < page_range[-1]:
- return {'number': current + 1, 'title': None, 'url': None}
- else:
- return {'number': None, 'title': fallback_title, 'url': fallback}
-
-
-@register.inclusion_tag('fnpdjango/prevnext/prevnext.html', takes_context=True)
-def prevnext(context):
- return context
+++ /dev/null
-from django.template import Library
-
-register = Library()
-
-
-@register.inclusion_tag('fnpdjango/share.html', takes_context=True)
-def share(context, url, description, iconset=""):
- return {
- 'url': url,
- 'description': description,
- 'iconset': iconset,
- 'request': context['request'],
- }
+++ /dev/null
-"""
-Basic utilities for applications.
-"""
-
-
-from django.conf import settings
-
-
-class AppSettings(object):
- """Allows specyfying custom settings for an app, with default values.
-
- Just subclass, set some properties and instantiate with a prefix.
- Getting a SETTING from an instance will check for prefix_SETTING
- in project settings if set, else take the default. The value will be
- then filtered through _more_SETTING method, if there is one.
-
- """
- def __init__(self, prefix):
- self._prefix = prefix
-
- def __getattribute__(self, name):
- if name.startswith('_'):
- return object.__getattribute__(self, name)
- value = getattr(settings,
- "%s_%s" % (self._prefix, name),
- object.__getattribute__(self, name))
- more = "_more_%s" % name
- if hasattr(self, more):
- value = getattr(self, more)(value)
- return value
+++ /dev/null
-"""
-Utilities for Django models.
-"""
-
-from django.utils.translation import string_concat
-
-
-def filtered_model(name, model, field, value, verbose_extra=None):
- """Creates a proxy model filtering objects by a field."""
- verbose_extra = verbose_extra or value
- class Meta:
- proxy = True
- app_label = model._meta.app_label
- verbose_name = string_concat(model._meta.verbose_name,
- ': ', verbose_extra)
- verbose_name_plural = string_concat(model._meta.verbose_name_plural,
- ': ', verbose_extra)
-
- def save(self, *args, **kwargs):
- if not getattr(self, field):
- setattr(self, field, value)
- return model.save(self, *args, **kwargs)
-
- attrs = {'__module__': '', 'Meta': Meta, 'save': save}
- return type(name, (model,), attrs)
+++ /dev/null
-"""
-Utilities for creating multilingual fields in your apps.
-"""
-
-from copy import copy
-from django.conf import settings
-from django.utils.translation import get_language, string_concat
-
-
-def field_getter(name):
- @property
- def getter(self):
- val = getattr(self, "%s_%s" % (name, get_language()), None)
- if not val:
- val = getattr(self, "%s_%s" % (name, settings.LANGUAGE_CODE))
- return val
- return getter
-
-
-def add_translatable(model, fields, languages=None):
- """Adds some translatable fields to a model, and a getter."""
- if languages is None:
- languages = settings.LANGUAGES
- for name, field in fields.items():
- for lang_code, lang_name in languages:
- new_field = copy(field)
- if field.verbose_name:
- new_field.verbose_name = string_concat(field.verbose_name, ' [%s]' % lang_code)
- new_field.contribute_to_class(model, "%s_%s" % (name, lang_code))
- setattr(model, name, field_getter(name))
- # add setter?
-
-
-def add_translatable_index(index_class, fields, languages=None):
- """Adds some translatable fields to a search index."""
- if languages is None:
- languages = settings.LANGUAGES
- for name, field in fields.items():
- for lang_code, lang_name in languages:
- new_field = copy(field)
- fname = "%s_%s" % (name, lang_code)
- new_field.index_fieldname = new_field.index_fieldname \
- and "%s_%s" % (new_field.index_fieldname, lang_code) \
- or fname
- new_field.model_attr = new_field.model_attr \
- and "%s_%s" % (new_field.model_attr, lang_code) \
- or fname
- setattr(index_class, fname, new_field)
- index_class.fields[fname] = new_field
-
-
-def translated_fields(field_names, languages=settings.LANGUAGES):
- """Generate a tuple of field names in translated versions."""
- return tuple("%s_%s" % (field_name, lang_code)
- for field_name in field_names
- for lang_code, lang_name in languages
- )
+++ /dev/null
-"""
-Utilities for global settings.
-"""
-
-
-class LazyUGettextLazy(object):
- """You can use it to internationalize strings in settings.
-
- Just import this class as gettext.
- """
- _ = lambda s: s
- real = False
-
- def __init__(self, text):
- self.text = text
-
- def __unicode__(self):
- if not self.real:
- from django.utils.translation import ugettext_lazy
- LazyUGettextLazy._ = staticmethod(ugettext_lazy)
- LazyUGettextLazy.real = True
- return unicode(self._(self.text))
-
-
+++ /dev/null
-"""
-Text utilities.
-"""
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-import re
-from types import UnicodeType
-
-from django.template.defaultfilters import slugify
-
-# default unicode character mapping ( you may not see some chars, leave as is )
-char_map = {u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'Ae', u'Å': 'A', u'Æ': 'A', u'Ā': 'A', u'Ą': 'A', u'Ă': 'A', u'Ç': 'C', u'Ć': 'C', u'Č': 'C', u'Ĉ': 'C', u'Ċ': 'C', u'Ď': 'D', u'Đ': 'D', u'È': 'E', u'É': 'E', u'Ê': 'E', u'Ë': 'E', u'Ē': 'E', u'Ę': 'E', u'Ě': 'E', u'Ĕ': 'E', u'Ė': 'E', u'Ĝ': 'G', u'Ğ': 'G', u'Ġ': 'G', u'Ģ': 'G', u'Ĥ': 'H', u'Ħ': 'H', u'Ì': 'I', u'Í': 'I', u'Î': 'I', u'Ï': 'I', u'Ī': 'I', u'Ĩ': 'I', u'Ĭ': 'I', u'Į': 'I', u'İ': 'I', u'IJ': 'IJ', u'Ĵ': 'J', u'Ķ': 'K', u'Ľ': 'K', u'Ĺ': 'K', u'Ļ': 'K', u'Ŀ': 'K', u'Ł': 'L', u'Ñ': 'N', u'Ń': 'N', u'Ň': 'N', u'Ņ': 'N', u'Ŋ': 'N', u'Ò': 'O', u'Ó': 'O', u'Ô': 'O', u'Õ': 'O', u'Ö': 'Oe', u'Ø': 'O', u'Ō': 'O', u'Ő': 'O', u'Ŏ': 'O', u'Œ': 'OE', u'Ŕ': 'R', u'Ř': 'R', u'Ŗ': 'R', u'Ś': 'S', u'Ş': 'S', u'Ŝ': 'S', u'Ș': 'S', u'Š': 'S', u'Ť': 'T', u'Ţ': 'T', u'Ŧ': 'T', u'Ț': 'T', u'Ù': 'U', u'Ú': 'U', u'Û': 'U', u'Ü': 'Ue', u'Ū': 'U', u'Ů': 'U', u'Ű': 'U', u'Ŭ': 'U', u'Ũ': 'U', u'Ų': 'U', u'Ŵ': 'W', u'Ŷ': 'Y', u'Ÿ': 'Y', u'Ý': 'Y', u'Ź': 'Z', u'Ż': 'Z', u'Ž': 'Z', u'à': 'a', u'á': 'a', u'â': 'a', u'ã': 'a', u'ä': 'ae', u'ā': 'a', u'ą': 'a', u'ă': 'a', u'å': 'a', u'æ': 'ae', u'ç': 'c', u'ć': 'c', u'č': 'c', u'ĉ': 'c', u'ċ': 'c', u'ď': 'd', u'đ': 'd', u'è': 'e', u'é': 'e', u'ê': 'e', u'ë': 'e', u'ē': 'e', u'ę': 'e', u'ě': 'e', u'ĕ': 'e', u'ė': 'e', u'ƒ': 'f', u'ĝ': 'g', u'ğ': 'g', u'ġ': 'g', u'ģ': 'g', u'ĥ': 'h', u'ħ': 'h', u'ì': 'i', u'í': 'i', u'î': 'i', u'ï': 'i', u'ī': 'i', u'ĩ': 'i', u'ĭ': 'i', u'į': 'i', u'ı': 'i', u'ij': 'ij', u'ĵ': 'j', u'ķ': 'k', u'ĸ': 'k', u'ł': 'l', u'ľ': 'l', u'ĺ': 'l', u'ļ': 'l', u'ŀ': 'l', u'ñ': 'n', u'ń': 'n', u'ň': 'n', u'ņ': 'n', u'ʼn': 'n', u'ŋ': 'n', u'ò': 'o', u'ó': 'o', u'ô': 'o', u'õ': 'o', u'ö': 'oe', u'ø': 'o', u'ō': 'o', u'ő': 'o', u'ŏ': 'o', u'œ': 'oe', u'ŕ': 'r', u'ř': 'r', u'ŗ': 'r', u'ś': 's', u'š': 's', u'ť': 't', u'ù': 'u', u'ú': 'u', u'û': 'u', u'ü': 'ue', u'ū': 'u', u'ů': 'u', u'ű': 'u', u'ŭ': 'u', u'ũ': 'u', u'ų': 'u', u'ŵ': 'w', u'ÿ': 'y', u'ý': 'y', u'ŷ': 'y', u'ż': 'z', u'ź': 'z', u'ž': 'z', u'ß': 'ss', u'ſ': 'ss', u'Α': 'A', u'Ά': 'A', u'Ἀ': 'A', u'Ἁ': 'A', u'Ἂ': 'A', u'Ἃ': 'A', u'Ἄ': 'A', u'Ἅ': 'A', u'Ἆ': 'A', u'Ἇ': 'A', u'ᾈ': 'A', u'ᾉ': 'A', u'ᾊ': 'A', u'ᾋ': 'A', u'ᾌ': 'A', u'ᾍ': 'A', u'ᾎ': 'A', u'ᾏ': 'A', u'Ᾰ': 'A', u'Ᾱ': 'A', u'Ὰ': 'A', u'Ά': 'A', u'ᾼ': 'A', u'Β': 'B', u'Γ': 'G', u'Δ': 'D', u'Ε': 'E', u'Έ': 'E', u'Ἐ': 'E', u'Ἑ': 'E', u'Ἒ': 'E', u'Ἓ': 'E', u'Ἔ': 'E', u'Ἕ': 'E', u'Έ': 'E', u'Ὲ': 'E', u'Ζ': 'Z', u'Η': 'I', u'Ή': 'I', u'Ἠ': 'I', u'Ἡ': 'I', u'Ἢ': 'I', u'Ἣ': 'I', u'Ἤ': 'I', u'Ἥ': 'I', u'Ἦ': 'I', u'Ἧ': 'I', u'ᾘ': 'I', u'ᾙ': 'I', u'ᾚ': 'I', u'ᾛ': 'I', u'ᾜ': 'I', u'ᾝ': 'I', u'ᾞ': 'I', u'ᾟ': 'I', u'Ὴ': 'I', u'Ή': 'I', u'ῌ': 'I', u'Θ': 'TH', u'Ι': 'I', u'Ί': 'I', u'Ϊ': 'I', u'Ἰ': 'I', u'Ἱ': 'I', u'Ἲ': 'I', u'Ἳ': 'I', u'Ἴ': 'I', u'Ἵ': 'I', u'Ἶ': 'I', u'Ἷ': 'I', u'Ῐ': 'I', u'Ῑ': 'I', u'Ὶ': 'I', u'Ί': 'I', u'Κ': 'K', u'Λ': 'L', u'Μ': 'M', u'Ν': 'N', u'Ξ': 'KS', u'Ο': 'O', u'Ό': 'O', u'Ὀ': 'O', u'Ὁ': 'O', u'Ὂ': 'O', u'Ὃ': 'O', u'Ὄ': 'O', u'Ὅ': 'O', u'Ὸ': 'O', u'Ό': 'O', u'Π': 'P', u'Ρ': 'R', u'Ῥ': 'R', u'Σ': 'S', u'Τ': 'T', u'Υ': 'Y', u'Ύ': 'Y', u'Ϋ': 'Y', u'Ὑ': 'Y', u'Ὓ': 'Y', u'Ὕ': 'Y', u'Ὗ': 'Y', u'Ῠ': 'Y', u'Ῡ': 'Y', u'Ὺ': 'Y', u'Ύ': 'Y', u'Φ': 'F', u'Χ': 'X', u'Ψ': 'PS', u'Ω': 'O', u'Ώ': 'O', u'Ὠ': 'O', u'Ὡ': 'O', u'Ὢ': 'O', u'Ὣ': 'O', u'Ὤ': 'O', u'Ὥ': 'O', u'Ὦ': 'O', u'Ὧ': 'O', u'ᾨ': 'O', u'ᾩ': 'O', u'ᾪ': 'O', u'ᾫ': 'O', u'ᾬ': 'O', u'ᾭ': 'O', u'ᾮ': 'O', u'ᾯ': 'O', u'Ὼ': 'O', u'Ώ': 'O', u'ῼ': 'O', u'α': 'a', u'ά': 'a', u'ἀ': 'a', u'ἁ': 'a', u'ἂ': 'a', u'ἃ': 'a', u'ἄ': 'a', u'ἅ': 'a', u'ἆ': 'a', u'ἇ': 'a', u'ᾀ': 'a', u'ᾁ': 'a', u'ᾂ': 'a', u'ᾃ': 'a', u'ᾄ': 'a', u'ᾅ': 'a', u'ᾆ': 'a', u'ᾇ': 'a', u'ὰ': 'a', u'ά': 'a', u'ᾰ': 'a', u'ᾱ': 'a', u'ᾲ': 'a', u'ᾳ': 'a', u'ᾴ': 'a', u'ᾶ': 'a', u'ᾷ': 'a', u'β': 'b', u'γ': 'g', u'δ': 'd', u'ε': 'e', u'έ': 'e', u'ἐ': 'e', u'ἑ': 'e', u'ἒ': 'e', u'ἓ': 'e', u'ἔ': 'e', u'ἕ': 'e', u'ὲ': 'e', u'έ': 'e', u'ζ': 'z', u'η': 'i', u'ή': 'i', u'ἠ': 'i', u'ἡ': 'i', u'ἢ': 'i', u'ἣ': 'i', u'ἤ': 'i', u'ἥ': 'i', u'ἦ': 'i', u'ἧ': 'i', u'ᾐ': 'i', u'ᾑ': 'i', u'ᾒ': 'i', u'ᾓ': 'i', u'ᾔ': 'i', u'ᾕ': 'i', u'ᾖ': 'i', u'ᾗ': 'i', u'ὴ': 'i', u'ή': 'i', u'ῂ': 'i', u'ῃ': 'i', u'ῄ': 'i', u'ῆ': 'i', u'ῇ': 'i', u'θ': 'th', u'ι': 'i', u'ί': 'i', u'ϊ': 'i', u'ΐ': 'i', u'ἰ': 'i', u'ἱ': 'i', u'ἲ': 'i', u'ἳ': 'i', u'ἴ': 'i', u'ἵ': 'i', u'ἶ': 'i', u'ἷ': 'i', u'ὶ': 'i', u'ί': 'i', u'ῐ': 'i', u'ῑ': 'i', u'ῒ': 'i', u'ΐ': 'i', u'ῖ': 'i', u'ῗ': 'i', u'κ': 'k', u'λ': 'l', u'μ': 'm', u'ν': 'n', u'ξ': 'ks', u'ο': 'o', u'ό': 'o', u'ὀ': 'o', u'ὁ': 'o', u'ὂ': 'o', u'ὃ': 'o', u'ὄ': 'o', u'ὅ': 'o', u'ὸ': 'o', u'ό': 'o', u'π': 'p', u'ρ': 'r', u'ῤ': 'r', u'ῥ': 'r', u'σ': 's', u'ς': 's', u'τ': 't', u'υ': 'y', u'ύ': 'y', u'ϋ': 'y', u'ΰ': 'y', u'ὐ': 'y', u'ὑ': 'y', u'ὒ': 'y', u'ὓ': 'y', u'ὔ': 'y', u'ὕ': 'y', u'ὖ': 'y', u'ὗ': 'y', u'ὺ': 'y', u'ύ': 'y', u'ῠ': 'y', u'ῡ': 'y', u'ῢ': 'y', u'ΰ': 'y', u'ῦ': 'y', u'ῧ': 'y', u'φ': 'f', u'χ': 'x', u'ψ': 'ps', u'ω': 'o', u'ώ': 'o', u'ὠ': 'o', u'ὡ': 'o', u'ὢ': 'o', u'ὣ': 'o', u'ὤ': 'o', u'ὥ': 'o', u'ὦ': 'o', u'ὧ': 'o', u'ᾠ': 'o', u'ᾡ': 'o', u'ᾢ': 'o', u'ᾣ': 'o', u'ᾤ': 'o', u'ᾥ': 'o', u'ᾦ': 'o', u'ᾧ': 'o', u'ὼ': 'o', u'ώ': 'o', u'ῲ': 'o', u'ῳ': 'o', u'ῴ': 'o', u'ῶ': 'o', u'ῷ': 'o', u'¨': '', u'΅': '', u'᾿': '', u'῾': '', u'῍': '', u'῝': '', u'῎': '', u'῞': '', u'῏': '', u'῟': '', u'῀': '', u'῁': '', u'΄': '', u'΅': '', u'`': '', u'῭': '', u'ͺ': '', u'᾽': '', u'А': 'A', u'Б': 'B', u'В': 'V', u'Г': 'G', u'Д': 'D', u'Е': 'E', u'Ё': 'E', u'Ж': 'ZH', u'З': 'Z', u'И': 'I', u'Й': 'I', u'К': 'K', u'Л': 'L', u'М': 'M', u'Н': 'N', u'О': 'O', u'П': 'P', u'Р': 'R', u'С': 'S', u'Т': 'T', u'У': 'U', u'Ф': 'F', u'Х': 'KH', u'Ц': 'TS', u'Ч': 'CH', u'Ш': 'SH', u'Щ': 'SHCH', u'Ы': 'Y', u'Э': 'E', u'Ю': 'YU', u'Я': 'YA', u'а': 'A', u'б': 'B', u'в': 'V', u'г': 'G', u'д': 'D', u'е': 'E', u'ё': 'E', u'ж': 'ZH', u'з': 'Z', u'и': 'I', u'й': 'I', u'к': 'K', u'л': 'L', u'м': 'M', u'н': 'N', u'о': 'O', u'п': 'P', u'р': 'R', u'с': 'S', u'т': 'T', u'у': 'U', u'ф': 'F', u'х': 'KH', u'ц': 'TS', u'ч': 'CH', u'ш': 'SH', u'щ': 'SHCH', u'ы': 'Y', u'э': 'E', u'ю': 'YU', u'я': 'YA', u'Ъ': '', u'ъ': '', u'Ь': '', u'ь': '', u'ð': 'd', u'Ð': 'D', u'þ': 'th', u'Þ': 'TH',
- u'ა': 'a', u'ბ': 'b', u'გ': 'g', u'დ': 'd', u'ე': 'e', u'ვ': 'v', u'ზ': 'z', u'თ': 't', u'ი': 'i', u'კ': 'k', u'ლ': 'l', u'მ': 'm', u'ნ': 'n', u'ო': 'o', u'პ': 'p', u'ჟ': 'zh', u'რ': 'r', u'ს': 's', u'ტ': 't', u'უ': 'u', u'ფ': 'p', u'ქ': 'k', u'ღ': 'gh', u'ყ': 'q', u'შ': 'sh', u'ჩ': 'ch', u'ც': 'ts', u'ძ': 'dz', u'წ': 'ts', u'ჭ': 'ch', u'ხ': 'kh', u'ჯ': 'j', u'ჰ': 'h' }
-
-def replace_char(m):
- char = m.group()
- if char_map.has_key(char):
- return char_map[char]
- else:
- return char
-
-def slughifi(value, do_slugify=True, overwrite_char_map={}):
- """
- High Fidelity slugify - slughifi.py, v 0.1
-
- Examples :
-
- >>> text = 'C\'est déjà l\'été.'
-
- >>> slughifi(text)
- 'cest-deja-lete'
-
- >>> slughifi(text, overwrite_char_map={u'\'': '-',})
- 'c-est-deja-l-ete'
-
- >>> slughifi(text, do_slugify=False)
- "C'est deja l'ete."
-
- # Normal slugify removes accented characters
- >>> slugify(text)
- 'cest-dj-lt'
-
- """
-
- # unicodification
- if type(value) != UnicodeType:
- value = unicode(value, 'utf-8', 'ignore')
-
- # overwrite chararcter mapping
- char_map.update(overwrite_char_map)
-
- # try to replace chars
- value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value)
-
- # apply django default slugify
- if do_slugify:
- value = slugify(value)
-
- return value.encode('ascii', 'ignore')
-
+++ /dev/null
-from textile import Textile
-
-
-class TextilePL(Textile):
- """Polish version of Textile.
-
- Changes opening quote to Polish lower-double.
- """
- glyph_defaults = [(name, repl)
- for (name, repl) in Textile.glyph_defaults
- if name != 'txt_quote_double_open']
- glyph_defaults.append(('txt_quote_double_open', '„'))
-
-
-def textile_pl(text):
- return TextilePL().textile(text)
-
-
-def textile_restricted_pl(text):
- return TextilePL(restricted=True, lite=True,
- noimage=True, auto_link=False).textile(
- text, rel='nofollow')
+++ /dev/null
-"""
-Utilities for urlconfs.
-"""
-
-import re
-from django.conf import settings
-from django.conf.urls import patterns
-from django.core.urlresolvers import LocaleRegexURLResolver
-from django.utils.translation import get_language, string_concat
-
-
-class MyLocaleRegexURLResolver(LocaleRegexURLResolver):
- """
- A URL resolver that always matches the active language code as URL prefix.
-
- Rather than taking a regex argument, we just override the ``regex``
- function to always return the active language-code as regex.
- """
- @property
- def regex(self):
- language_code = get_language()
- if language_code == settings.LANGUAGE_CODE:
- return re.compile('')
- if language_code not in self._regex_dict:
- regex_compiled = re.compile('^%s/' % language_code, re.UNICODE)
- self._regex_dict[language_code] = regex_compiled
- return self._regex_dict[language_code]
-
-
-def i18n_patterns(prefix, *args):
- """
- Adds the language code prefix to every URL pattern within this
- function. This may only be used in the root URLconf, not in an included
- URLconf.
-
- """
- pattern_list = patterns(prefix, *args)
- if not settings.USE_I18N:
- return pattern_list
- return pattern_list + [MyLocaleRegexURLResolver(pattern_list)]
+++ /dev/null
-"""
-View-specific utilities.
-"""
-
-from django.conf import settings
-from django.http import HttpResponse, HttpResponseRedirect
-
-
-def serve_file(url):
- """Serves an URL either though Nginx's X-accel, or by redirection."""
- if settings.X_ACCEL_REDIRECT:
- response = HttpResponse()
- response['Content-Type'] = ""
- response['X-Accel-Redirect'] = url
- return response
- else:
- return HttpResponseRedirect(url)
-
-
-def set_current_object(request, obj, in_url=True):
- request.CURRENT_OBJECT = obj
- request.CURRENT_OBJECT_IN_URL = in_url
-
-
-def get_current_object(request, for_url=False):
- if for_url and not getattr(request, 'CURRENT_OBJECT_IN_URL', True):
- return None
- return getattr(request, 'CURRENT_OBJECT', None)
+++ /dev/null
-# -*- coding: utf-8 -*-
-"""
-Migdal (מִגְדָּל) is a multilingual blog Django app.
-
-Author: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
-"""
-from django.conf import settings
-from fnpdjango.utils.app import AppSettings
-from django.utils.translation import ugettext_lazy as _
-from migdal.helpers import EntryType
-
-
-class Settings(AppSettings):
- # Types of entries:
- # (slug, commentable, on main)
- TYPES = (
- EntryType('news', _('news'), commentable=True, on_main=True, promotable=True),
- EntryType('publications', _('publications')),
- EntryType('info', _('info')),
- )
- TYPE_SUBMIT = 'news'
- TAXONOMIES = (
- ('topics', _('topics')),
- ('types', _('types')),
- )
- LAST_COMMENTS = 5
-
- MAIN_PAGE_ENTRY = None
-
- TYPES_DICT = None
- def _more_TYPES_DICT(self, value):
- return dict((t.db, t) for t in self.TYPES)
-
- TYPES_ON_MAIN = None
- def _more_TYPES_ON_MAIN(self, value):
- return tuple(t.db for t in self.TYPES if t.on_main)
-
- TYPES_PROMOTABLE = None
- def _more_TYPES_PROMOTABLE(self, value):
- return tuple(t.db for t in self.TYPES if t.promotable)
-
- OBLIGATORY_LANGUAGES = None
- def _more_OBLIGATORY_LANGUAGES(self, value):
- return value or tuple(lang for lang in settings.LANGUAGES
- if lang[0] == settings.LANGUAGE_CODE)
-
- OPTIONAL_LANGUAGES = None
- def _more_OPTIONAL_LANGUAGES(self, value):
- return tuple(lang for lang in settings.LANGUAGES
- if lang not in self.OBLIGATORY_LANGUAGES)
-
-app_settings = Settings('MIGDAL')
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.conf import settings
-from django.contrib import admin
-from django.utils.translation import ugettext_lazy as _
-from migdal.models import Entry, Attachment
-from migdal import app_settings
-from fnpdjango.utils.models import filtered_model
-from fnpdjango.utils.models.translation import translated_fields
-
-
-class AttachmentInline(admin.TabularInline):
- model = Attachment
- readonly_fields = ['url']
-
-
-def filtered_entry_admin(typ):
- class EntryAdmin(admin.ModelAdmin):
- def queryset(self, request):
- return self.model.objects.filter(type=typ)
-
- def has_add_permission(self, request):
- return request.user.has_perm('migdal.add_entry')
-
- def has_change_permission(self, request, obj=None):
- return request.user.has_perm('migdal.change_entry')
-
- def has_delete_permission(self, request, obj=None):
- return request.user.has_perm('migdal.delete_entry')
-
- date_hierarchy = 'date'
- readonly_fields = ('date', 'changed_at') + \
- translated_fields(('published_at',))
- _promo_if_necessary = ('promo',) if typ.promotable else ()
-
- fieldsets = (
- (None, {
- 'fields': _promo_if_necessary + (
- 'author', 'author_email', 'image', 'date', 'changed_at')
- }),
- ) + tuple(
- (ln, {'fields': (
- ('published_%s' % lc),
- 'published_at_%s' % lc,
- 'title_%s' % lc,
- 'slug_%s' % lc,
- 'lead_%s' % lc,
- 'body_%s' % lc,
- )})
- for lc, ln in app_settings.OBLIGATORY_LANGUAGES
- ) + tuple(
- (ln, {'fields': (
- ('needed_%s' % lc, 'published_%s' % lc),
- 'published_at_%s' % lc,
- 'title_%s' % lc,
- 'slug_%s' % lc,
- 'lead_%s' % lc,
- 'body_%s' % lc,
- )})
- for lc, ln in app_settings.OPTIONAL_LANGUAGES
- )
-
- if typ.categorized:
- fieldsets += (
- (_('Categories'), {'fields': ('categories',)}),
- )
- prepopulated_fields = dict([
- ("slug_%s" % lang_code, ("title_%s" % lang_code,))
- for lang_code, lang_name in settings.LANGUAGES
- ])
-
- list_display = translated_fields(('title',),
- app_settings.OBLIGATORY_LANGUAGES) + \
- ('date', 'author') + \
- _promo_if_necessary + \
- translated_fields(('published_at',)) + \
- translated_fields(('needed',), app_settings.OPTIONAL_LANGUAGES)
- list_filter = _promo_if_necessary + \
- translated_fields(('published',)) + \
- translated_fields(('needed',), app_settings.OPTIONAL_LANGUAGES)
- inlines = (AttachmentInline,)
- search_fields = ('title_pl', 'title_en')
- return EntryAdmin
-
-
-for typ in app_settings.TYPES:
- newmodel = filtered_model("Entry_%s" % typ.db, Entry, 'type', typ.db, typ.slug)
- admin.site.register(newmodel, filtered_entry_admin(typ))
-
-
-if app_settings.TAXONOMIES:
- from migdal.models import Category
-
- class CategoryAdmin(admin.ModelAdmin):
- 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
- ])
- admin.site.register(Category, CategoryAdmin)
+++ /dev/null
-# -*- coding: utf-8 -*-
-# 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 import app_settings
-from django.utils.translation import get_language
-
-
-def entry_list(entry_type=None, category=None, promobox=False):
- lang = get_language()
- object_list = Entry.objects.filter(**{"published_%s" % lang: True}
- ).order_by('-published_at_%s' % lang)
- if entry_type:
- object_list = object_list.filter(type=entry_type.db)
- else:
- object_list = object_list.filter(
- type__in=[t.db for t in app_settings.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
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.contrib.syndication.views import Feed
-from django.core.urlresolvers import reverse
-from django.shortcuts import get_object_or_404
-from django.utils.translation import ugettext as _, string_concat
-from migdal import api
-from migdal.models import Category
-from migdal import app_settings
-
-
-class EntriesFeed(Feed):
- def get_object(self, request, type_db=None, category_slug=None):
- lang = request.LANGUAGE_CODE
- if category_slug:
- category = get_object_or_404(Category, **{'slug_%s' % lang: category_slug})
- else:
- category = None
- if type_db:
- entry_type = app_settings.TYPES_DICT[type_db]
- else:
- entry_type = None
- return {'entry_type': entry_type, 'category': category}
-
- def title(self, obj):
- t = "Prawo kultury, " + _("latest") + " "
- if obj['entry_type']:
- t += unicode(obj['entry_type'].slug)
- else:
- t += _("entries")
- if obj['category']:
- t += " " + _("in category") + " " + obj['category'].title
- return t
-
- def link(self, obj):
- if obj['category']:
- return reverse('migdal_category', args=[obj['category'].slug])
- if obj['entry_type']:
- return reverse('migdal_entry_list_%s' % obj['entry_type'].db)
- return reverse('migdal_main')
-
- def items(self, obj):
- return api.entry_list(**obj)
-
- def item_title(self, item):
- return item.title
-
- def item_description(self, item):
- return item.lead
- image = item.image.url if item.image else "/static/img/square-logo.png"
- return string_concat("<img src='%s'/>" % image, item.lead)
-
- def item_pubdate(self, item):
- return item.published_at
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.db import models
-
-class SlugNullField(models.SlugField):
- description = "SlugField that stores NULL instead of blank value."
-
- def to_python(self, value, **kwargs):
- value = super(SlugNullField, self).to_python(value, **kwargs)
- return value if value is not None else u""
-
- def get_prep_value(self, value, **kwargs):
- value = super(SlugNullField, self).get_prep_value(value, **kwargs)
- return value or None
-
-
-try:
- # check for south
- from south.modelsinspector import add_introspection_rules
-except ImportError:
- pass
-else:
- add_introspection_rules([], ["^migdal\.fields\.SlugNullField"])
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django import forms
-from django.utils.translation import ugettext_lazy as _, get_language
-from migdal.models import Entry
-from migdal import app_settings
-from fnpdjango.utils.text import slughifi
-from django.core.mail import mail_managers
-from django import template
-
-
-def get_submit_form(*args, **kwargs):
- lang = get_language()
-
- class SubmitForm(forms.ModelForm):
- class Meta:
- model = Entry
- fields = ['title_%s' % lang, 'lead_%s' % lang,
- 'author', 'author_email', 'categories']
- required = ['title_%s' % lang]
-
- def __init__(self, *args, **kwargs):
- super(SubmitForm, self).__init__(*args, **kwargs)
- title = self.fields['title_%s' % lang]
- title.required = True
- title.label = _('Title')
- lead = self.fields['lead_%s' % lang]
- lead.required = True
- lead.label = _('Content')
-
- def clean(self):
- data = super(SubmitForm, self).clean()
- data['type'] = app_settings.TYPE_SUBMIT
- orig_slug = slughifi(data.get('title_%s' % lang, ''))
- slug = orig_slug
- number = 2
- while Entry.objects.filter(**{'slug_%s' % lang: slug}).exists():
- slug = "%s-%s" % (orig_slug, number)
- number += 1
- data['slug_%s' % lang] = slug
- self.cleaned_data = data
- return data
-
- def save(self, *args, **kwargs):
- entry = super(SubmitForm, self).save(commit=False)
- # Something's wrong with markup fields, they choke on None here.
- for f in 'lead_en', 'lead_pl', 'body_en', 'body_pl':
- if getattr(entry, f) is None:
- setattr(entry, f, '')
- for f in 'slug_%s' % lang, 'type':
- setattr(entry, f, self.cleaned_data[f])
- entry.save()
- entry = super(SubmitForm, self).save(*args, **kwargs)
- mail_managers(u"Nowy wpis",
- template.loader.get_template(
- 'migdal/mail/manager_new_entry.txt').render(
- template.Context({'object': entry})))
-
- return SubmitForm(*args, **kwargs)
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-class EntryType(object):
- def __init__(self, db, slug, commentable=False, on_main=False,
- promotable=False, categorized=False):
- self.db = db
- self.slug = slug
- self.commentable = commentable
- self.on_main = on_main
- self.promotable = promotable
- self.categorized = categorized
-
- def __unicode__(self):
- return unicode(self.slug)
+++ /dev/null
-# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
-# This file is distributed under the same license as the PACKAGE package.
-# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: django-migdal 0.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-04 12:58+0200\n"
-"PO-Revision-Date: 2012-10-04 12:58+0100\n"
-"Last-Translator: Radek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>\n"
-"Language-Team: FNP <fundacja@nowoczesnapolska.org.pl>\n"
-"Language: Polish\n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: 8bit\n"
-"Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)\n"
-"X-Poedit-Language: Polish\n"
-
-#: __init__.py:17
-msgid "news"
-msgstr "newsy"
-
-#: __init__.py:18
-msgid "publications"
-msgstr "publikacje"
-
-#: __init__.py:19
-msgid "info"
-msgstr "info"
-
-#: __init__.py:23
-msgid "topics"
-msgstr "tematy"
-
-#: __init__.py:24
-msgid "types"
-msgstr "rodzaje"
-
-#: admin.py:44
-msgid "Categories"
-msgstr "Kategorie"
-
-#: feeds.py:28
-msgid "latest"
-msgstr "ostatnie"
-
-#: feeds.py:32
-#: models.py:56
-msgid "entries"
-msgstr "wpisy"
-
-#: feeds.py:34
-msgid "in category"
-msgstr "w kategorii"
-
-#: forms.py:28
-msgid "Title"
-msgstr "Tytuł"
-
-#: forms.py:31
-msgid "Content"
-msgstr "Treść"
-
-#: models.py:20
-msgid "taxonomy"
-msgstr "taksonomia"
-
-#: models.py:24
-msgid "category"
-msgstr "kategoria"
-
-#: models.py:25
-#: models.py:52
-#: urls.py:41
-#: urls.py:43
-msgid "categories"
-msgstr "kategorie"
-
-#: models.py:45
-msgid "created at"
-msgstr "data utworzenia"
-
-#: models.py:46
-msgid "changed at"
-msgstr "data ostatniej zmiany"
-
-#: models.py:47
-msgid "author"
-msgstr "autor"
-
-#: models.py:48
-msgid "author email"
-msgstr "e-mail autora"
-
-#: models.py:49
-msgid "Used only to display gravatar and send notifications."
-msgstr "Używany tylko do wyświetlenia gravatara i wysyłania powiadomień."
-
-#: models.py:50
-msgid "image"
-msgstr "obrazek"
-
-#: models.py:51
-msgid "promoted"
-msgstr "promowane"
-
-#: models.py:55
-msgid "entry"
-msgstr "wpis"
-
-#: models.py:80
-#, python-format
-msgid "Published entry should have a slug in relevant language (%s)."
-msgstr "Opublikowany wpis powinien mieć slug w odpowiednim języku (%s)."
-
-#: models.py:99
-#, python-format
-msgid "Your story has been published at %s."
-msgstr "Twój wpis został opublikowany na stronie %s."
-
-#: models.py:105
-msgid "needed"
-msgstr "potrzebne"
-
-#: models.py:106
-msgid "Unneeded"
-msgstr "Niepotrzebne"
-
-#: models.py:106
-msgid "Needed"
-msgstr "Potrzebne"
-
-#: models.py:106
-msgid "Done"
-msgstr "Ukończone"
-
-#: models.py:112
-msgid "title"
-msgstr "tytuł"
-
-#: models.py:113
-msgid "lead"
-msgstr "lead"
-
-#: models.py:114
-#: models.py:116
-msgid "Use <a href=\"http://textile.thresholdstate.com/\">Textile</a> syntax."
-msgstr "Włączona składnia <a href=\"http://textile.thresholdstate.com/\">Textile</a>."
-
-#: models.py:115
-msgid "body"
-msgstr "treść"
-
-#: models.py:117
-msgid "published"
-msgstr "opublikowane"
-
-#: models.py:118
-msgid "published at"
-msgstr "data publikacji"
-
-#: models.py:123
-msgid "file"
-msgstr "plik"
-
-#: models.py:141
-#, python-format
-msgid "New comment under your story at %s."
-msgstr "Nowy komentarz pod Twoim wpisem na stronie %s."
-
-#: urls.py:38
-#: urls.py:39
-msgid "submit"
-msgstr "wyslij"
-
-#: urls.py:39
-msgid "thanks"
-msgstr "dzieki"
-
-#: urls.py:45
-msgid "search"
-msgstr "szukaj"
-
-#: templates/comments/form.html:3
-msgid "Add comment"
-msgstr "Dodaj komentarz"
-
-#: templates/comments/form.html:24
-msgid "Post"
-msgstr "Wyślij"
-
-#: templates/comments/form.html:25
-msgid "Preview"
-msgstr "Podgląd"
-
-#: templates/comments/migdal/entry/list.html:5
-msgid "Comments"
-msgstr "Komentarze"
-
-#: templates/comments/migdal/entry/preview.html:26
-msgid "Preview your comment"
-msgstr "Podgląd komentarza"
-
-#: templates/migdal/entry/entry_detail.html:27
-msgid "This entry hasn't been published yet."
-msgstr "Ten wpis nie został jeszcze opublikowany."
-
-#: templates/migdal/entry/entry_list.html:22
-msgid "Category"
-msgstr "Kategoria"
-
-#: templates/migdal/entry/entry_list.html:55
-msgid "Submit a new story, create Culture's Right with us!"
-msgstr "Dodaj nowy wpis, twórz Prawo Kultury razem z nami!"
-
-#: templates/migdal/entry/entry_short.html:19
-#, python-format
-msgid "%(c)s comment"
-msgid_plural "%(c)s comments"
-msgstr[0] "%(c)s komentarz"
-msgstr[1] "%(c)s komentarze"
-msgstr[2] "%(c)s komentarzy"
-
-#: templates/migdal/entry/entry_short.html:24
-msgid "read more"
-msgstr "czytaj więcej"
-
-#: templates/migdal/entry/submit.html:7
-msgid "Submit new story"
-msgstr "Dodaj nowy wpis"
-
-#: templates/migdal/entry/submit.html:9
-msgid ""
-"\n"
-"By submitting a story here, you agree to publish it under the terms of the\n"
-"<a href='http://creativecommons.org/licenses/by-sa/3.0/'>Creative Commons Attribution-Share Alike</a>\n"
-"free license."
-msgstr ""
-"\n"
-"Dodając wpis, zgadzasz się najego publikację na warunkach wolnej licencji\n"
-"<a href='http://creativecommons.org/licenses/by-sa/3.0/deed.pl'>Creative Commons Uznanie autorstwa – Na tych samych warunkach</a>."
-
-#: templates/migdal/entry/submit.html:14
-msgid ""
-"Stories are moderated, so please be\n"
-"patient, you'll be notified when it's published."
-msgstr "Wpisy są moderowane. Bądź cierpliwy, otrzymasz powiadomienie o publikacji."
-
-#: templates/migdal/entry/submit.html:21
-msgid "Submit"
-msgstr "Wyślij"
-
-#: templates/migdal/entry/submit_thanks.html:6
-msgid "Thanks for submitting"
-msgstr "Dziękujemy za zgłoszenie"
-
-#: templates/migdal/entry/submit_thanks.html:9
-msgid ""
-"\n"
-"Thank you for submitting this new story, it's waiting for moderation.\n"
-"If you provided an email, we'll inform you about changes in it's status\n"
-"and comments.\n"
-msgstr ""
-"\n"
-"Dziękujemy za dodanie nowego wpisu, teraz czeka on na moderację. Jeśli podano adres e-mail, będziemy Cię informowali o zmianach statusu i komentarzach\n"
-
-#: templates/search/search.html:9
-msgid "Search results"
-msgstr "Wyniki wyszukiwania"
-
-#: templates/search/search.html:18
-msgid "No results found."
-msgstr "Brak wyników."
-
-#: templates/search/search.html:25
-msgid "previous"
-msgstr "poprzednie"
-
-#: templates/search/search.html:28
-msgid "next"
-msgstr "następne"
-
-#: templatetags/migdal_tags.py:128
-msgid "Publications"
-msgstr "Publikacje"
-
-#: templatetags/migdal_tags.py:129
-msgid "Events"
-msgstr "Wydarzenia"
-
-#: templatetags/migdal_tags.py:131
-msgid "Positions"
-msgstr "Stanowiska"
-
-#~ msgid "Please correct the error below"
-
-#~ msgid_plural "Please correct the errors below"
-#~ msgstr[0] "Proszę poprawić poniższy błąd"
-#~ msgstr[1] "Proszę poprawić poniższe błędy"
-#~ msgstr[2] "Proszę poprawić poniższe błędy"
-
-#~ msgid "and"
-#~ msgstr "i"
-
-#~ msgid "Post your comment"
-#~ msgstr "Wyślij komentarz"
-
-#~ msgid "or make changes"
-#~ msgstr "lub zmień"
-
-#~ msgid "Latest news"
-#~ msgstr "Ostatnie newsy"
-
-#~ msgid "Submit a new story."
-#~ msgstr "Przyślij nowego newsa."
+++ /dev/null
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding model 'Category'
- db.create_table('migdal_category', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('slug_pl', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('slug_en', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('title_pl', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64, db_index=True)),
- ('title_en', self.gf('django.db.models.fields.CharField')(unique=True, max_length=64, db_index=True)),
- ))
- db.send_create_signal('migdal', ['Category'])
-
- # Adding model 'Entry'
- db.create_table('migdal_entry', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('type', self.gf('django.db.models.fields.CharField')(max_length=16, db_index=True)),
- ('date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, db_index=True, blank=True)),
- ('author', self.gf('django.db.models.fields.CharField')(max_length=128)),
- ('author_email', self.gf('django.db.models.fields.EmailField')(max_length=128, null=True, blank=True)),
- ('image', self.gf('django.db.models.fields.files.ImageField')(max_length=100, null=True, blank=True)),
- ('promo', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('slug_pl', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50)),
- ('title_pl', self.gf('django.db.models.fields.CharField')(max_length=255)),
- ('lead_pl', self.gf('markupfield.fields.MarkupField')(rendered_field=True)),
- ('lead_pl_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30)),
- ('_lead_pl_rendered', self.gf('django.db.models.fields.TextField')()),
- ('slug_en', self.gf('django.db.models.fields.SlugField')(max_length=50, unique=True, null=True, blank=True)),
- ('title_en', self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True)),
- ('lead_en', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('needed_en', self.gf('django.db.models.fields.CharField')(default='n', max_length=1, db_index=True)),
- ('lead_en_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('_lead_en_rendered', self.gf('django.db.models.fields.TextField')()),
- ('body_pl', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('body_en', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True, blank=True)),
- ('body_pl_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('body_en_markup_type', self.gf('django.db.models.fields.CharField')(default='textile_pl', max_length=30, blank=True)),
- ('published_pl', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('published_en', self.gf('django.db.models.fields.BooleanField')(default=False)),
- ('_body_pl_rendered', self.gf('django.db.models.fields.TextField')()),
- ('_body_en_rendered', self.gf('django.db.models.fields.TextField')()),
- ))
- db.send_create_signal('migdal', ['Entry'])
-
- # Adding M2M table for field categories on 'Entry'
- db.create_table('migdal_entry_categories', (
- ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
- ('entry', models.ForeignKey(orm['migdal.entry'], null=False)),
- ('category', models.ForeignKey(orm['migdal.category'], null=False))
- ))
- db.create_unique('migdal_entry_categories', ['entry_id', 'category_id'])
-
- # Adding model 'Attachment'
- db.create_table('migdal_attachment', (
- ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('file', self.gf('django.db.models.fields.files.FileField')(max_length=100)),
- ('entry', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['migdal.Entry'])),
- ))
- db.send_create_signal('migdal', ['Attachment'])
-
-
- def backwards(self, orm):
- # Deleting model 'Category'
- db.delete_table('migdal_category')
-
- # Deleting model 'Entry'
- db.delete_table('migdal_entry')
-
- # Removing M2M table for field categories on 'Entry'
- db.delete_table('migdal_entry_categories')
-
- # Deleting model 'Attachment'
- db.delete_table('migdal_attachment')
-
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
-
- # Changing field 'Entry.slug_pl'
- db.alter_column('migdal_entry', 'slug_pl', self.gf('django.db.models.fields.SlugField')(max_length=50, unique=True, null=True))
-
- # Changing field 'Entry.title_pl'
- db.alter_column('migdal_entry', 'title_pl', self.gf('django.db.models.fields.CharField')(max_length=255, null=True))
-
- # Changing field 'Entry.lead_pl'
- db.alter_column('migdal_entry', 'lead_pl', self.gf('markupfield.fields.MarkupField')(null=True, rendered_field=True))
-
- def backwards(self, orm):
-
- # Changing field 'Entry.slug_pl'
- db.alter_column('migdal_entry', 'slug_pl', self.gf('django.db.models.fields.SlugField')(default='', max_length=50, unique=True))
-
- # Changing field 'Entry.title_pl'
- db.alter_column('migdal_entry', 'title_pl', self.gf('django.db.models.fields.CharField')(default='', max_length=255))
-
- # Changing field 'Entry.lead_pl'
- db.alter_column('migdal_entry', 'lead_pl', self.gf('markupfield.fields.MarkupField')(default='', rendered_field=True))
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding field 'Category.taxonomy'
- db.add_column('migdal_category', 'taxonomy',
- self.gf('django.db.models.fields.CharField')(default='topics', max_length=32),
- keep_default=False)
-
-
- def backwards(self, orm):
- # Deleting field 'Category.taxonomy'
- db.delete_column('migdal_category', 'taxonomy')
-
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'taxonomy': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
-
- # Changing field 'Entry.slug_pl'
- db.alter_column('migdal_entry', 'slug_pl', self.gf('migdal.fields.SlugNullField')(max_length=50, unique=True, null=True))
-
- # Changing field 'Entry.slug_en'
- db.alter_column('migdal_entry', 'slug_en', self.gf('migdal.fields.SlugNullField')(max_length=50, unique=True, null=True))
-
- def backwards(self, orm):
-
- # Changing field 'Entry.slug_pl'
- db.alter_column('migdal_entry', 'slug_pl', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, null=True))
-
- # Changing field 'Entry.slug_en'
- db.alter_column('migdal_entry', 'slug_en', self.gf('django.db.models.fields.SlugField')(unique=True, max_length=50, null=True))
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'taxonomy': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('migdal.fields.SlugNullField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('migdal.fields.SlugNullField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-import datetime
-from south.db import db
-from south.v2 import SchemaMigration
-from django.db import models
-
-
-class Migration(SchemaMigration):
-
- def forwards(self, orm):
- # Adding field 'Entry.changed_at'
- db.add_column('migdal_entry', 'changed_at',
- self.gf('django.db.models.fields.DateTimeField')(auto_now=True, default=datetime.datetime(2000, 1, 1, 0, 0), db_index=True, blank=True),
- keep_default=False)
-
- # Adding field 'Entry.published_at_pl'
- db.add_column('migdal_entry', 'published_at_pl',
- self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True),
- keep_default=False)
-
- # Adding field 'Entry.published_at_en'
- db.add_column('migdal_entry', 'published_at_en',
- self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True),
- keep_default=False)
-
- if not db.dry_run:
- for entry in orm['migdal.Entry'].objects.all():
- update_info = {}
- if entry.published_pl:
- update_info['published_at_pl'] = entry.date
- if entry.published_en:
- update_info['published_at_en'] = entry.date
- update_info['changed_at'] = entry.date
- orm['migdal.Entry'].objects.filter(pk=entry.pk).update(**update_info)
-
-
- def backwards(self, orm):
- # Deleting field 'Entry.changed_at'
- db.delete_column('migdal_entry', 'changed_at')
-
- # Deleting field 'Entry.published_at_pl'
- db.delete_column('migdal_entry', 'published_at_pl')
-
- # Deleting field 'Entry.published_at_en'
- db.delete_column('migdal_entry', 'published_at_en')
-
-
- models = {
- 'migdal.attachment': {
- 'Meta': {'object_name': 'Attachment'},
- 'entry': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['migdal.Entry']"}),
- 'file': ('django.db.models.fields.files.FileField', [], {'max_length': '100'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
- },
- 'migdal.category': {
- 'Meta': {'object_name': 'Category'},
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'slug_en': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'slug_pl': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50'}),
- 'taxonomy': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64', 'db_index': 'True'})
- },
- 'migdal.entry': {
- 'Meta': {'ordering': "['-date']", 'object_name': 'Entry'},
- '_body_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_body_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_en_rendered': ('django.db.models.fields.TextField', [], {}),
- '_lead_pl_rendered': ('django.db.models.fields.TextField', [], {}),
- 'author': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
- 'author_email': ('django.db.models.fields.EmailField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
- 'body_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'body_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'body_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'categories': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['migdal.Category']", 'null': 'True', 'blank': 'True'}),
- 'changed_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
- 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'image': ('django.db.models.fields.files.ImageField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),
- 'lead_en': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_en_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'lead_pl': ('markupfield.fields.MarkupField', [], {'null': 'True', 'rendered_field': 'True', 'blank': 'True'}),
- 'lead_pl_markup_type': ('django.db.models.fields.CharField', [], {'default': "'textile_pl'", 'max_length': '30', 'blank': 'True'}),
- 'needed_en': ('django.db.models.fields.CharField', [], {'default': "'n'", 'max_length': '1', 'db_index': 'True'}),
- 'promo': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_at_en': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'published_at_pl': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
- 'published_en': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'published_pl': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
- 'slug_en': ('migdal.fields.SlugNullField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'slug_pl': ('migdal.fields.SlugNullField', [], {'max_length': '50', 'unique': 'True', 'null': 'True', 'blank': 'True'}),
- 'title_en': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'title_pl': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
- 'type': ('django.db.models.fields.CharField', [], {'max_length': '16', 'db_index': 'True'})
- }
- }
-
- complete_apps = ['migdal']
\ No newline at end of file
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from datetime import datetime
-from django.conf import settings
-from django.contrib.sites.models import Site
-from django.core.exceptions import ValidationError
-from django.core.mail import send_mail
-from django.db import models
-from django.template import loader, Context
-from django.utils.translation import get_language, ugettext_lazy as _, ugettext
-from django_comments_xtd.models import XtdComment
-from markupfield.fields import MarkupField
-from migdal import app_settings
-from fnpdjango.utils.models.translation import add_translatable
-from migdal.fields import SlugNullField
-
-class Category(models.Model):
- taxonomy = models.CharField(_('taxonomy'), max_length=32,
- choices=app_settings.TAXONOMIES)
-
- class Meta:
- verbose_name = _('category')
- verbose_name_plural = _('categories')
-
- def __unicode__(self):
- return self.title
-
- @models.permalink
- def get_absolute_url(self):
- return ('migdal_category', [self.slug])
-
-
-add_translatable(Category, {
- 'title': models.CharField(max_length=64, unique=True, db_index=True),
- 'slug': models.SlugField(unique=True, db_index=True),
-})
-
-
-class Entry(models.Model):
- type = models.CharField(max_length=16,
- choices=((t.db, t.slug) for t in app_settings.TYPES),
- db_index=True)
- date = models.DateTimeField(_('created at'), auto_now_add=True, db_index=True)
- changed_at = models.DateTimeField(_('changed at'), auto_now=True, db_index=True)
- author = models.CharField(_('author'), max_length=128)
- author_email = models.EmailField(_('author email'), max_length=128, null=True, blank=True,
- help_text=_('Used only to display gravatar and send notifications.'))
- image = models.ImageField(_('image'), upload_to='entry/image/', null=True, blank=True)
- promo = models.BooleanField(_('promoted'), default=False)
- categories = models.ManyToManyField(Category, null=True, blank=True, verbose_name=_('categories'))
-
- class Meta:
- verbose_name = _('entry')
- verbose_name_plural = _('entries')
- ordering = ['-date']
-
- def __unicode__(self):
- return self.title
-
- def save(self, *args, **kwargs):
- if self.pk is not None:
- orig = type(self).objects.get(pk=self.pk)
- published_now = False
- for lc, ln in settings.LANGUAGES:
- if (getattr(self, "published_%s" % lc)
- and getattr(self, "published_at_%s" % lc) is None):
- setattr(self, "published_at_%s" % lc, datetime.now())
- published_now = True
- if published_now:
- self.notify_author_published()
- super(Entry, self).save(*args, **kwargs)
-
- def clean(self):
- for lc, ln in settings.LANGUAGES:
- if (getattr(self, "published_%s" % lc) and
- not getattr(self, "slug_%s" % lc)):
- raise ValidationError(
- ugettext("Published entry should have a slug in relevant language (%s).") % lc)
-
- @models.permalink
- def get_absolute_url(self):
- return ('migdal_entry_%s' % self.type, [self.slug])
-
- def get_type(self):
- return dict(app_settings.TYPES_DICT)[self.type]
-
- def notify_author_published(self):
- if not self.author_email:
- return
- site = Site.objects.get_current()
- mail_text = loader.get_template('migdal/mail/published.txt').render(
- Context({
- 'entry': self,
- 'site': site,
- }))
- send_mail(
- ugettext(u'Your story has been published at %s.') % site.domain,
- mail_text, settings.SERVER_EMAIL, [self.author_email]
- )
-
-
-add_translatable(Entry, languages=app_settings.OPTIONAL_LANGUAGES, fields={
- 'needed': models.CharField(_('needed'), max_length=1, db_index=True, choices=(
- ('n', _('Unneeded')), ('w', _('Needed')), ('y', _('Done'))),
- default='n'),
-})
-
-add_translatable(Entry, {
- 'slug': SlugNullField(unique=True, db_index=True, null=True, blank=True),
- 'title': models.CharField(_('title'), max_length=255, null=True, blank=True),
- 'lead': MarkupField(_('lead'), markup_type='textile_pl', null=True, blank=True,
- help_text=_('Use <a href="http://textile.thresholdstate.com/">Textile</a> syntax.')),
- 'body': MarkupField(_('body'), markup_type='textile_pl', null=True, blank=True,
- help_text=_('Use <a href="http://textile.thresholdstate.com/">Textile</a> syntax.')),
- 'published': models.BooleanField(_('published'), default=False),
- 'published_at': models.DateTimeField(_('published at'), null=True, blank=True),
-})
-
-
-class Attachment(models.Model):
- file = models.FileField(_('file'), upload_to='entry/attach/')
- entry = models.ForeignKey(Entry)
-
- def url(self):
- return self.file.url if self.file else ''
-
-
-
-def notify_new_comment(sender, instance, created, **kwargs):
- if (created and isinstance(instance.content_object, Entry) and
- instance.content_object.author_email):
- site = Site.objects.get_current()
- mail_text = loader.get_template('migdal/mail/new_comment.txt').render(
- Context({
- 'comment': instance,
- 'site': site,
- }))
- send_mail(
- ugettext(u'New comment under your story at %s.') % site.domain,
- mail_text, settings.SERVER_EMAIL,
- [instance.content_object.author_email]
- )
-models.signals.post_save.connect(notify_new_comment, sender=XtdComment)
\ No newline at end of file
+++ /dev/null
-Why not LocaleMiddleware? (consistent lang, url to lang)
+++ /dev/null
-import datetime
-from django.conf import settings
-from haystack import indexes
-from fnpdjango.utils.models.translation import add_translatable_index
-from migdal.models import Entry
-
-
-class EntryIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
- date = indexes.DateTimeField(indexed=True, model_attr="date")
- author = indexes.CharField(model_attr="author")
-
- def get_model(self):
- return Entry
-
- def index_queryset(self):
- """Used when the entire index for model is updated."""
- return self.get_model().objects.all() # filter(date__lte=datetime.datetime.now())
-
-
-add_translatable_index(EntryIndex, {
- 'title': indexes.CharField(null=True),
- 'lead': indexes.CharField(null=True),
- 'body': indexes.CharField(null=True)
- })
-
-
-getattr(EntryIndex, "body_%s" % settings.LANGUAGE_CODE).document = True
+++ /dev/null
-{% load comments i18n %}
-<div class="comment-form">
-<h2 class="section">{% trans "Add comment" %}</h2>
-<form class="submit-form" action="{% comment_form_target %}" method="post">{% csrf_token %}
- {% if next %}<input type="hidden" name="next" value="{{ next }}" />{% endif %}
- {% for field in form %}
- {% if field.is_hidden %}
- {{ field }}
- {% endif %}
- {% endfor %}
- <table>
- {% for field in form %}
- {% if not field.is_hidden %}
- <tr
- {% ifequal field.name "honeypot" %} style="display:none;"{% endifequal %}>
- <th>{{ field.label_tag }}
- </th><td>
- {% if field.errors %}<p class="error">{{ field.errors }}</p>{% endif %}
- {{ field }}
- </td></tr>
- {% endif %}
- {% endfor %}
- <tr><td></td><td>
- <button type="submit" name="post" class="submit-post">{% trans "Post" %}</button>
- <button type="submit" name="preview" class="submit-preview">{% trans "Preview" %}</button>
- </td></tr>
- </table>
-</form>
-</div>
+++ /dev/null
-{% load i18n %}
-{% load gravatar %}
-{% load fnp_markup %}
-<a name="comment"></a>
-<h2 class="section">{% trans "Comments" %}</h2>
-<div class="comments">
- {% for comment in comment_list %}
- <div class="comment" id="c{{ comment.id }}">
- <img class="avatar" src="{% gravatar_for_email comment.email 64 %}" alt="Avatar"/>
- <div class="comment-data">
- <div class="comment-author">
- {% if comment.url %}
- <a rel="nofollow" href="{{ comment.url }}">
- {% endif %}
- {{ comment.name }}
- {% if comment.url %}
- </a>
- {% endif %}
- </div>
- <div class="comment-date">{{ comment.submit_date }}</div>
- </div>
- <div class="body">{{ comment.comment|textile_restricted_pl }}</div>
- </div>
- {% endfor %}
- <div style="clear: both"></div>
-</div>
\ No newline at end of file
+++ /dev/null
-{% extends "base.html" %}
-{% load comments gravatar i18n %}
-{% load migdal_tags fnp_markup %}
-
-
-{% block "main_menu" %}
- {% main_menu 'object' entry %}
-{% endblock "main_menu" %}
-
-
-{% block "body" %}
-
-<div class="entry entry-detail entry-{{ entry.type }}">
-<div class="entry-wrapped">
-
-{% entry_begin form.target_object 1 %}
-<div class="body">
-{{ form.target_object.body }}
-</div>
-
-{% if form.target_object.get_type.commentable %}
- <div style="clear: both"></div>
-
- {% render_comment_list for form.target_object %}
-
- <h2 class="section">{% trans "Preview your comment" %}</h2>
- <div class="comments">
-
- <div class="comment preview">
- <img class="avatar" src="{% gravatar_for_email form.email.value 64 %}" alt="Avatar"/>
- <div class="comment-data">
- <div class="comment-author">{{ form.name.value }}</div>
- </div>
- <div class="body">{{ comment|textile_restricted_pl }}</div>
- <div style="clear: both"></div>
- </div>
-
- {% include "comments/form.html" %}
-
- </div>
-{% endif %}
-</div>
-</div>
-
-{% endblock %}
+++ /dev/null
-{% load i18n %}
-<p>{{ user_name }},</p>
-
-<p>Pojawił się nowy komentarz w wątku z Twoim udziałem.</p>
-
-<p>
-{% language 'pl' %}
- <a href="http://{{ site.domain }}{{ content_object.get_absolute_url }}">„{{ content_object.title }}”</a>
-{% endlanguage %}
-</p>
-
-<p>{{ comment.name }}, {{ comment.submit_date|date:"SHORT_DATE_FORMAT" }}:</p>
-<blockquote>
-{{ comment.comment }}
-</blockquote>
-
-<p>--<br/>
-{{ site }}
-</p>
+++ /dev/null
-{% load i18n %}{{ user_name }},
-
-Pojawił się nowy komentarz w wątku z Twoim udziałem.
-
-{% language 'pl' %}„{{ content_object.title }}”
-http://{{ site.domain }}{{ content_object.get_absolute_url }}{% endlanguage %}
-
-
-{{ comment.name }}, {{ comment.submit_date|date:"SHORT_DATE_FORMAT" }}:
---------
-{{ comment.comment }}
-
-
---
-{{ site }}
+++ /dev/null
-<ul class="categories">
- {% for cat in object_list %}
- <li class="category category-taxonomy-{{ cat.taxonomy }}">
- <a href="{{ cat.get_absolute_url }}">{{ cat }}</a>
- </li>
- {% endfor %}
-</ul>
\ No newline at end of file
+++ /dev/null
-{% load i18n %}
-{% load gravatar thumbnail %}
-
-<img class="avatar" src="{% gravatar_for_email object.author_email 64 %}" alt="Avatar"/>
-{% if detail %}
- <h1>{{ object.title }}</h1>
-{% else %}
- <h2><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>
-{% endif %}
-
-<div class="entry-data">
-<div class="date">{{ object.published_at }}</div>
-<div class="author">{{ object.author }}</div>
-
-<div class="categories">
-{% for category in object.categories.all %}
- {% if forloop.counter != 1 %}/{% endif %}
- <a href="{{ category.get_absolute_url }}">{{ category }}</a>
-{% endfor %}
-</div>
-
-</div>
-
-{% if object.image %}
- <img class="entry-picture" src="{% thumbnail object.image "200x150" as thumb %}
- {{ thumb.url }}
- {% empty %}
- {{ object.image.url }}
- {% endthumbnail %}" />
-{% endif %}
-<div class="lead">
-{{ object.lead }}
-</div>
+++ /dev/null
-{% extends "base.html" %}
-{% load comments i18n %}
-{% load fnp_common migdal_tags fnp_share %}
-
-
-{% block "titleextra" %}{{ entry.title }} :: {% endblock %}
-{% block "ogtitle" %}{{ entry.title }}{% endblock %}
-{% block "ogtype" %}article{% endblock %}
-{% block "ogdescription"%}{{ entry.lead|striptags|truncatewords:10 }}{% endblock %}
-{% block "ogimage" %}{% spaceless %}
-{% if entry.image %}
- {{ entry.image.url|build_absolute_uri:request }}
-{% else %}
- {{ block.super }}
-{% endif %}
-{% endspaceless %}{% endblock %}
-
-
-{% block "body" %}
-
-{% if not entry.published %}
- <p class="warning">{% trans "This entry hasn't been published yet." %}</p>
-{% endif %}
-
-<div class="entry entry-detail entry-{{ entry.type }}">
-<div class="entry-wrapped">
-
-{% entry_begin entry 1 %}
-<div class="body">
-{{ entry.body }}
-</div>
-
-<div style="clear: both;"></div>
-
-<div class="toolbar">
-<div class="social">
- {% share object.get_absolute_url object.title %}
-</div>
-</div>
-
-<div style="clear: both"></div>
-
-{% if entry.get_type.commentable %}
- {% render_comment_list for entry %}
- <div class="comments">
- {% entry_comment_form entry %}
- </div>
-{% endif %}
-</div>
-</div>
-
-{% endblock %}
\ No newline at end of file
+++ /dev/null
-{% extends "base.html" %}
-{% load url from future %}
-{% load i18n %}
-{% load pagination_tags fnp_prevnext %}
-{% load migdal_tags %}
-
-
-{% block "body" %}
-
-{% if category %}
- <h1>{% trans "Category" %}: {{ category }}
- <!--a href="{% url 'migdal_category_feed' category.slug %}">RSS</a-->
- </h1>
-{% elif entry_type %}
- <h1>{{ entry_type|capfirst }}
- <!--a href="{% url 'migdal_entry_list_'|add:entry_type.db|add:'_feed' %}">RSS</a-->
- </h1>
-{% endif %}
-
-{% if object_list.promobox and request.page == 1 %}
-<div id="promobox">
-<ul id="promobox-switcher">
-{% for object in object_list.promobox %}
- <li {% if forloop.counter == 1 %} class="active"{% endif %}>
- <a href="{{ object.get_absolute_url }}"
- >{{ forloop.counter }}</a>
- </li>
-{% endfor %}
-</ul>
-
-<div id="promobox-wrapper">
-<ul class="promobox">
-{% for object in object_list.promobox %}
- {% entry_promobox object forloop.counter %}
-{% endfor %}
-</ul>
-</div>
-
-</div>
-{% endif %}
-
-{% if submit %}
- <p class="submit-link">
- <a href="{% url 'migdal_submit' %}">{% trans "Submit a new story, create Culture's Right with us!" %}</a>
- </p>
-{% endif %}
-
-
-{% autopaginate object_list 10 %}
-{% for object in object_list %}
- {% entry_short object %}
-{% endfor %}
-{% prevnext %}
-
-{% endblock %}
\ No newline at end of file
+++ /dev/null
-{% load i18n thumbnail %}
-
-
-<li class="promobox-item{% if counter == 1 %} active{% endif %}"
- style="
- {% if counter != 1 %}display: none;{% endif %}
- {% if object.image %}
- background: url('{% thumbnail object.image "700x1000" as thumb %}{{ thumb.url }}{% empty %}{{ object.image.url }}{% endthumbnail %}');
- background-size:100%;
- background-position: 50% 50%;
- {% else %}
- background: black;
- {% endif %}
-">
-
-<a class="promobox-link" href="{{ object.get_absolute_url }}">
-
-
-<div class="promobox-info">
-<div class="clip">
-<h2>{{ object.title }}</h2>
-
-<div class="lead">
-{{ object.lead|striptags|truncatewords:8 }}
-</div>
-</div>
-</div>
-
-</a>
-</li>
+++ /dev/null
-{% load i18n %}
-{% load comments %}
-{% load migdal_tags fnp_share %}
-
-
-<div class="entry entry-short entry-{{ object.type }}">
-<div class="entry-wrapped">
-
-{% entry_begin object %}
-
-<div style="clear: both;"></div>
-
-<div class="toolbar">
-<div class="more">
-
-{% if object.get_type.commentable %}
-{% get_comment_count for object as comment_count %}
-<a class="comments" href="{{ object.get_absolute_url }}#comment">
-{% blocktrans count comment_count as c %}{{c}} comment{% plural %}{{c}} comments{% endblocktrans %}
-</a>
-{% endif %}
-
-{% if object.body.raw %}
- <a class="read-more" href="{{ object.get_absolute_url }}">{% trans "read more" %}</a>
-{% endif %}
-
-</div>
-
-<div class="social">
- {% share object.get_absolute_url object.title %}
-</div>
-</div>
-
-
-
-<div style="clear: both"></div>
-</div>
-</div>
+++ /dev/null
-{% load i18n %}
-{% load thumbnail %}
-
-{% if detail %}
- <h1>{{ object.title }}</h1>
-{% else %}
- <h2><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>
-{% endif %}
-
-
-{% if object.image %}
- <a href="{{ object.image.url }}">
- <img class="entry-picture" src="{% thumbnail object.image "250x300" as thumb %}
- {{ thumb.url }}
- {% empty %}
- {{ object.image.url }}
- {% endthumbnail %}" />
- </a>
-{% endif %}
-<div class="lead">
-{{ object.lead }}
-</div>
+++ /dev/null
-{% load i18n %}
-{% load thumbnail %}
-
-{% if detail %}
- <h1>{{ object.title }}</h1>
-{% else %}
- <h2><a href="{{ object.get_absolute_url }}">{{ object.title }}</a></h2>
-{% endif %}
-
-
-{% comment %}
-<div class="entry-data">
-{% if request.LANGUAGE_CODE == 'pl' %}
- {% if object.published_en %}
- {% language 'en' %}
- <a href="{{ object.get_absolute_url }}">English version</a>
- {% endlanguage %}
- {% endif %}
-{% elif object.published_pl %}
- {{ request.LANGUAGE_CODE }}
- {% language 'pl' %}
- <a href="{{ object.get_absolute_url }}">polska wersja</a>
- {% endlanguage %}
-{% endif %}
-</div>
-{% endcomment %}
-
-
-{% if object.image %}
- <img class="entry-picture" src="{% thumbnail object.image "250x300" as thumb %}
- {{ thumb.url }}
- {% empty %}
- {{ object.image.url }}
- {% endthumbnail %}" />
-{% endif %}
-<div class="lead">
-{{ object.lead }}
-</div>
+++ /dev/null
-{% extends "base.html" %}
-{% load url from future %}
-{% load i18n %}
-
-{% block "body" %}
-
-<h1>{% trans "Submit new story" %}</h1>
-
-<p class="form-info">{% blocktrans %}
-By submitting a story here, you agree to publish it under the terms of the
-<a href='http://creativecommons.org/licenses/by-sa/3.0/'>Creative Commons Attribution-Share Alike</a>
-free license.{% endblocktrans %}</p>
-
-<p class="form-info">{% blocktrans %}Stories are moderated, so please be
-patient, you'll be notified when it's published.{% endblocktrans %}</p>
-
-<form class="submit-form" method="post" action="{% url 'migdal_submit' %}">
-{% csrf_token %}
-<table>
- {{ submit_form.as_table }}
- <tr><td></td><td><button type="submit">{% trans "Submit" %}</button></td></tr>
-</table>
-</form>
-
-
-{% endblock %}
\ No newline at end of file
+++ /dev/null
-{% extends "base.html" %}
-{% load i18n %}
-
-{% block "body" %}
-
-<h1>{% trans "Thanks for submitting" %}</h1>
-
-<p class="notice">
-{% blocktrans %}
-Thank you for submitting this new story, it's waiting for moderation.
-If you provided an email, we'll inform you about changes in it's status
-and comments.
-{% endblocktrans %}
-</p>
-
-
-
-{% endblock %}
\ No newline at end of file
+++ /dev/null
-{% load gravatar %}
-{% load fnp_markup %}
-<ul id="latest-comments">
- {% for comment in object_list %}
- <li>
- <a href="{{ comment.get_absolute_url }}">
- <div class="title">{{ comment.content_object.title }}</div>
- <div class="author">{{ comment.name }}</div>
- <div class="body">{{ comment.comment|textile_restricted_pl|striptags|truncatewords:8 }}</div>
- </a>
- </li>
- {% endfor %}
-</ul>
\ No newline at end of file
+++ /dev/null
-{% load url from future %}W serwisie pojawił się nowy wpis.
-http://localhost:8000{% url 'admin:migdal_entry_change' object.pk %}
-
-Autor: {{ object.author|default_if_none:"" }}
-E-mail: {{ object.author_email|default_if_none:"" }}
-Tytuł [pl]: {{ object.title_pl|default_if_none:"" }}
-Tytuł [en]: {{ object.title_en|default_if_none:"" }}
-Kategorie: {{ object.categories.all|join:", " }}
-
----
-{{ object.lead_pl.raw }}
----
-{{ object.lead_en.raw }}
----
\ No newline at end of file
+++ /dev/null
-{% load i18n %}{{ comment.content_object.author }},
-
-Pod Twoim wpisem pojawił się nowy komentarz.
-
-{% language 'pl' %}{{ comment.content_object.title }}
-http://{{ site.domain }}{{ comment.get_absolute_url }}{% endlanguage %}
-
-
-Autor: {{ comment.name }}
-
-{{ comment.comment }}
-
-
---
-{{ site }}
+++ /dev/null
-{% load i18n %}{{ entry.author }},
-
-Twój wpis został opublikowany:
-
-{% language 'pl' %}{{ entry.title }}
-http://{{ site.domain }}{{ entry.get_absolute_url }}{% endlanguage %}
-
-Dziękujemy!
-
---
-{{ site }}
+++ /dev/null
-{% extends "base.html" %}
-{% load url from future %}
-{% load i18n %}
-{% load migdal_tags %}
-{#% load events_tags %#}
-
-
-{% block "body" %}
-<h1>{% trans "Search results" %}</h1>
-
-{% for result in page.object_list %}
- {% if result.model_name == "entry" %}
- {% entry_short result.object %}
- {#% elif result.model_name == "event" %#}
- {#% event_short result.object %#}
- {% endif %}
-{% empty %}
-<p>{% trans "No results found." %}</p>
-{# Show some example queries to run, maybe query syntax, something else? #}
-{% endfor %}
-
-{% if page.has_previous or page.has_next %}
-<p class="prevnext">
- {% if page.has_previous %}
- <a class="previous_page" href="?q={{ query }}&page={{ page.previous_page_number }}">{% trans "previous" %}</a>
- {% endif %}
- {% if page.has_next %}
- <a class="next_page" href="?q={{ query }}&page={{ page.next_page_number }}">{% trans "next" %}</a>
- {% endif %}
-{% endif %}
-
-{% endblock "body" %}
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django_comments_xtd.models import XtdComment
-from django.contrib import comments
-from django import template
-from migdal import app_settings
-from migdal.models import Category, Entry
-from django.utils.translation import ugettext_lazy as _
-
-register = template.Library()
-
-
-@register.simple_tag(takes_context=True)
-def entry_begin(context, entry, detail=False):
- t = template.loader.select_template((
- 'migdal/entry/%s/entry_begin.html' % entry.type,
- 'migdal/entry/entry_begin.html',
- ))
- context = {
- 'request': context['request'],
- 'object': entry,
- 'detail': detail,
- }
- return t.render(template.Context(context))
-
-
-@register.simple_tag(takes_context=True)
-def entry_short(context, entry):
- t = template.loader.select_template((
- 'migdal/entry/%s/entry_short.html' % entry.type,
- 'migdal/entry/entry_short.html',
- ))
- context = {
- 'request': context['request'],
- 'object': 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 = {
- 'request': context['request'],
- 'object_list': Category.objects.filter(taxonomy=taxonomy
- ).exclude(entry__isnull=True)
- }
- return context
-
-
-@register.inclusion_tag('migdal/last_comments.html')
-def last_comments(limit=app_settings.LAST_COMMENTS):
- return {'object_list':
- XtdComment.objects.filter(is_public=True, is_removed=False).order_by('-submit_date')[:limit]}
-
-
-@register.inclusion_tag(['comments/form.html'])
-def entry_comment_form(entry):
- return {
- 'form': comments.get_form()(entry),
- 'next': entry.get_absolute_url(),
- }
+++ /dev/null
-"""
-This file demonstrates writing tests using the unittest module. These will pass
-when you run "manage.py test".
-
-Replace this with more appropriate tests for your application.
-"""
-
-from django.test import TestCase
-
-
-class SimpleTest(TestCase):
- def test_basic_addition(self):
- """
- Tests that 1 + 1 always equals 2.
- """
- self.assertEqual(1 + 1, 2)
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.conf.urls import patterns, include, url, handler404
-from django.utils.translation import ugettext_lazy as _
-from django.utils.translation import string_concat
-from migdal import feeds, app_settings
-from migdal.views import SearchPublishedView
-from fnpdjango.utils.urls import i18n_patterns
-
-pats = []
-for t in app_settings.TYPES:
- pats += [
- # entry list
- url(string_concat(r'^', t.slug, r'/$'),
- 'migdal.views.entry_list', {'type_db': t.db},
- name='migdal_entry_list_%s' % t.db),
- url(string_concat(r'^', t.slug, r'/rss.xml$'),
- feeds.EntriesFeed(), {'type_db': t.db},
- name='migdal_entry_list_%s_feed' % t.db),
- # single entry
- url(string_concat(r'^', t.slug, r'/(?P<slug>[^/]+)/$'),
- 'migdal.views.entry', {'type_db': t.db},
- name='migdal_entry_%s' % t.db),
- ]
-
-
-urlpatterns = i18n_patterns('',
- # main page
- url(r'^$', 'migdal.views.main', name='migdal_main'),
- url(r'^rss.xml$', feeds.EntriesFeed(), name='migdal_main_feed'),
- # submit new entry
- url(string_concat(r'^', _('submit'), r'/$'), 'migdal.views.submit', name='migdal_submit'),
- url(string_concat(r'^', _('submit'), r'/', _('thanks'), r'$'), 'migdal.views.submit_thanks', name='migdal_submit_thanks'),
- # category
- url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/$'),
- 'migdal.views.entry_list', name='migdal_category'),
- url(string_concat(r'^', _('categories'), r'/(?P<category_slug>[^/]*)/rss.xml$'),
- feeds.EntriesFeed(), name='migdal_category_feed'),
- url(string_concat(r'^', _('search')), SearchPublishedView(), name='search'),
- # type-specific views
- *pats
-)
+++ /dev/null
-# -*- coding: utf-8 -*-
-# This file is part of PrawoKultury, licensed under GNU Affero GPLv3 or later.
-# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
-#
-from django.http import Http404
-from django.shortcuts import get_object_or_404, render, redirect
-from django.utils.translation import get_language
-from fnpdjango.utils.views import set_current_object
-from migdal import api
-from migdal.forms import get_submit_form
-from migdal.models import Category, Entry
-from migdal import app_settings
-from haystack.views import SearchView
-
-
-def main(request):
- if app_settings.MAIN_PAGE_ENTRY is not None:
- main_entry = Entry.objects.get(**app_settings.MAIN_PAGE_ENTRY)
- return entry(request, entry=main_entry)
- else:
- return entry_list(request)
-
-
-def entry_list(request, type_db=None, category_slug=None):
- lang = request.LANGUAGE_CODE
- templates = ["migdal/entry/entry_list.html"]
-
- if type_db:
- if app_settings.TYPES_ON_MAIN == (type_db,):
- return redirect('migdal_main')
- entry_type = app_settings.TYPES_DICT[type_db]
- templates = ["migdal/entry/%s/entry_list.html" % type_db] + templates
- submit = type_db == app_settings.TYPE_SUBMIT
- else:
- submit = app_settings.TYPES_ON_MAIN == (app_settings.TYPE_SUBMIT,)
- entry_type = None
-
- if category_slug:
- category = get_object_or_404(Category, **{'slug_%s' % lang: category_slug})
- else:
- category = None
-
- if category:
- set_current_object(request, 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,
- 'category': category,
- 'entry_type': entry_type,
- 'submit': submit,
- })
-
-
-def entry(request, type_db=None, slug=None, entry=None):
- if entry is None:
- lang = request.LANGUAGE_CODE
- args = {'type': type_db, 'slug_%s' % lang: slug}
- entry = get_object_or_404(Entry, **args)
- if not entry.published and not request.user.has_perm('migdal.change_entry'):
- raise Http404
- set_current_object(request, entry, in_url=slug is not None)
-
- templates = ["migdal/entry/entry_detail.html"]
- if entry.type is not None:
- templates = ["migdal/entry/%s/entry_detail.html" % type_db] + templates
- return render(request, templates, {'entry': entry})
-
-
-def submit(request):
- if request.method == 'POST':
- submit_form = get_submit_form(request.POST)
- if submit_form.is_valid():
- submit_form.save()
- return redirect('migdal_submit_thanks')
- else:
- submit_form = get_submit_form()
-
- return render(request, 'migdal/entry/submit.html', {
- 'submit_form': submit_form,
- })
-
-def submit_thanks(request):
- return render(request, "migdal/entry/submit_thanks.html")
-
-
-class SearchPublishedView(SearchView):
- def __init__(self, *args, **kwargs):
- super(SearchPublishedView, self).__init__(*args, **kwargs)
-
- def get_results(self):
- results = super(SearchPublishedView, self).get_results()
- lang_code = get_language()
- def is_published(entity):
- if isinstance(entity, Entry):
- return getattr(entity, "published_%s" % lang_code) == True
- else:
- return True
- results = filter(lambda r: is_published(r.object), results)
- print results
- return results
sorl-thumbnail>=11.09,<12
django-pagination
+-e git+git://github.com/fnp/fnpdjango.git@7b2a81536977bb13b68ada3e5a281e35b24e0bfd#egg=fnpdjango
+-e git+git://github.com/fnp/django-migdal.git@734cd58d3f12c5397b42c1ae122c947500386014#egg=django-migdal
+
#django-jsonfield
-e git+git://github.com/bradjasper/django-jsonfield.git@2f427368ad70bf8d9a0580df58ec0eb0654d62ae#egg=django-jsonfield
+-e git+git://github.com/fnp/django-migdal.git@734cd58d3f12c5397b42c1ae122c947500386014#egg=django-migdal
+
textile
django-markupfield
django-gravatar
+++ /dev/null
-# -*- coding: utf-8 -*-
-import re
-from types import UnicodeType
-
-from django.template.defaultfilters import slugify
-
-# default unicode character mapping ( you may not see some chars, leave as is )
-char_map = {u'À': 'A', u'Á': 'A', u'Â': 'A', u'Ã': 'A', u'Ä': 'Ae', u'Å': 'A', u'Æ': 'A', u'Ā': 'A', u'Ą': 'A', u'Ă': 'A', u'Ç': 'C', u'Ć': 'C', u'Č': 'C', u'Ĉ': 'C', u'Ċ': 'C', u'Ď': 'D', u'Đ': 'D', u'È': 'E', u'É': 'E', u'Ê': 'E', u'Ë': 'E', u'Ē': 'E', u'Ę': 'E', u'Ě': 'E', u'Ĕ': 'E', u'Ė': 'E', u'Ĝ': 'G', u'Ğ': 'G', u'Ġ': 'G', u'Ģ': 'G', u'Ĥ': 'H', u'Ħ': 'H', u'Ì': 'I', u'Í': 'I', u'Î': 'I', u'Ï': 'I', u'Ī': 'I', u'Ĩ': 'I', u'Ĭ': 'I', u'Į': 'I', u'İ': 'I', u'IJ': 'IJ', u'Ĵ': 'J', u'Ķ': 'K', u'Ľ': 'K', u'Ĺ': 'K', u'Ļ': 'K', u'Ŀ': 'K', u'Ł': 'L', u'Ñ': 'N', u'Ń': 'N', u'Ň': 'N', u'Ņ': 'N', u'Ŋ': 'N', u'Ò': 'O', u'Ó': 'O', u'Ô': 'O', u'Õ': 'O', u'Ö': 'Oe', u'Ø': 'O', u'Ō': 'O', u'Ő': 'O', u'Ŏ': 'O', u'Œ': 'OE', u'Ŕ': 'R', u'Ř': 'R', u'Ŗ': 'R', u'Ś': 'S', u'Ş': 'S', u'Ŝ': 'S', u'Ș': 'S', u'Š': 'S', u'Ť': 'T', u'Ţ': 'T', u'Ŧ': 'T', u'Ț': 'T', u'Ù': 'U', u'Ú': 'U', u'Û': 'U', u'Ü': 'Ue', u'Ū': 'U', u'Ů': 'U', u'Ű': 'U', u'Ŭ': 'U', u'Ũ': 'U', u'Ų': 'U', u'Ŵ': 'W', u'Ŷ': 'Y', u'Ÿ': 'Y', u'Ý': 'Y', u'Ź': 'Z', u'Ż': 'Z', u'Ž': 'Z', u'à': 'a', u'á': 'a', u'â': 'a', u'ã': 'a', u'ä': 'ae', u'ā': 'a', u'ą': 'a', u'ă': 'a', u'å': 'a', u'æ': 'ae', u'ç': 'c', u'ć': 'c', u'č': 'c', u'ĉ': 'c', u'ċ': 'c', u'ď': 'd', u'đ': 'd', u'è': 'e', u'é': 'e', u'ê': 'e', u'ë': 'e', u'ē': 'e', u'ę': 'e', u'ě': 'e', u'ĕ': 'e', u'ė': 'e', u'ƒ': 'f', u'ĝ': 'g', u'ğ': 'g', u'ġ': 'g', u'ģ': 'g', u'ĥ': 'h', u'ħ': 'h', u'ì': 'i', u'í': 'i', u'î': 'i', u'ï': 'i', u'ī': 'i', u'ĩ': 'i', u'ĭ': 'i', u'į': 'i', u'ı': 'i', u'ij': 'ij', u'ĵ': 'j', u'ķ': 'k', u'ĸ': 'k', u'ł': 'l', u'ľ': 'l', u'ĺ': 'l', u'ļ': 'l', u'ŀ': 'l', u'ñ': 'n', u'ń': 'n', u'ň': 'n', u'ņ': 'n', u'ʼn': 'n', u'ŋ': 'n', u'ò': 'o', u'ó': 'o', u'ô': 'o', u'õ': 'o', u'ö': 'oe', u'ø': 'o', u'ō': 'o', u'ő': 'o', u'ŏ': 'o', u'œ': 'oe', u'ŕ': 'r', u'ř': 'r', u'ŗ': 'r', u'ś': 's', u'š': 's', u'ť': 't', u'ù': 'u', u'ú': 'u', u'û': 'u', u'ü': 'ue', u'ū': 'u', u'ů': 'u', u'ű': 'u', u'ŭ': 'u', u'ũ': 'u', u'ų': 'u', u'ŵ': 'w', u'ÿ': 'y', u'ý': 'y', u'ŷ': 'y', u'ż': 'z', u'ź': 'z', u'ž': 'z', u'ß': 'ss', u'ſ': 'ss', u'Α': 'A', u'Ά': 'A', u'Ἀ': 'A', u'Ἁ': 'A', u'Ἂ': 'A', u'Ἃ': 'A', u'Ἄ': 'A', u'Ἅ': 'A', u'Ἆ': 'A', u'Ἇ': 'A', u'ᾈ': 'A', u'ᾉ': 'A', u'ᾊ': 'A', u'ᾋ': 'A', u'ᾌ': 'A', u'ᾍ': 'A', u'ᾎ': 'A', u'ᾏ': 'A', u'Ᾰ': 'A', u'Ᾱ': 'A', u'Ὰ': 'A', u'Ά': 'A', u'ᾼ': 'A', u'Β': 'B', u'Γ': 'G', u'Δ': 'D', u'Ε': 'E', u'Έ': 'E', u'Ἐ': 'E', u'Ἑ': 'E', u'Ἒ': 'E', u'Ἓ': 'E', u'Ἔ': 'E', u'Ἕ': 'E', u'Έ': 'E', u'Ὲ': 'E', u'Ζ': 'Z', u'Η': 'I', u'Ή': 'I', u'Ἠ': 'I', u'Ἡ': 'I', u'Ἢ': 'I', u'Ἣ': 'I', u'Ἤ': 'I', u'Ἥ': 'I', u'Ἦ': 'I', u'Ἧ': 'I', u'ᾘ': 'I', u'ᾙ': 'I', u'ᾚ': 'I', u'ᾛ': 'I', u'ᾜ': 'I', u'ᾝ': 'I', u'ᾞ': 'I', u'ᾟ': 'I', u'Ὴ': 'I', u'Ή': 'I', u'ῌ': 'I', u'Θ': 'TH', u'Ι': 'I', u'Ί': 'I', u'Ϊ': 'I', u'Ἰ': 'I', u'Ἱ': 'I', u'Ἲ': 'I', u'Ἳ': 'I', u'Ἴ': 'I', u'Ἵ': 'I', u'Ἶ': 'I', u'Ἷ': 'I', u'Ῐ': 'I', u'Ῑ': 'I', u'Ὶ': 'I', u'Ί': 'I', u'Κ': 'K', u'Λ': 'L', u'Μ': 'M', u'Ν': 'N', u'Ξ': 'KS', u'Ο': 'O', u'Ό': 'O', u'Ὀ': 'O', u'Ὁ': 'O', u'Ὂ': 'O', u'Ὃ': 'O', u'Ὄ': 'O', u'Ὅ': 'O', u'Ὸ': 'O', u'Ό': 'O', u'Π': 'P', u'Ρ': 'R', u'Ῥ': 'R', u'Σ': 'S', u'Τ': 'T', u'Υ': 'Y', u'Ύ': 'Y', u'Ϋ': 'Y', u'Ὑ': 'Y', u'Ὓ': 'Y', u'Ὕ': 'Y', u'Ὗ': 'Y', u'Ῠ': 'Y', u'Ῡ': 'Y', u'Ὺ': 'Y', u'Ύ': 'Y', u'Φ': 'F', u'Χ': 'X', u'Ψ': 'PS', u'Ω': 'O', u'Ώ': 'O', u'Ὠ': 'O', u'Ὡ': 'O', u'Ὢ': 'O', u'Ὣ': 'O', u'Ὤ': 'O', u'Ὥ': 'O', u'Ὦ': 'O', u'Ὧ': 'O', u'ᾨ': 'O', u'ᾩ': 'O', u'ᾪ': 'O', u'ᾫ': 'O', u'ᾬ': 'O', u'ᾭ': 'O', u'ᾮ': 'O', u'ᾯ': 'O', u'Ὼ': 'O', u'Ώ': 'O', u'ῼ': 'O', u'α': 'a', u'ά': 'a', u'ἀ': 'a', u'ἁ': 'a', u'ἂ': 'a', u'ἃ': 'a', u'ἄ': 'a', u'ἅ': 'a', u'ἆ': 'a', u'ἇ': 'a', u'ᾀ': 'a', u'ᾁ': 'a', u'ᾂ': 'a', u'ᾃ': 'a', u'ᾄ': 'a', u'ᾅ': 'a', u'ᾆ': 'a', u'ᾇ': 'a', u'ὰ': 'a', u'ά': 'a', u'ᾰ': 'a', u'ᾱ': 'a', u'ᾲ': 'a', u'ᾳ': 'a', u'ᾴ': 'a', u'ᾶ': 'a', u'ᾷ': 'a', u'β': 'b', u'γ': 'g', u'δ': 'd', u'ε': 'e', u'έ': 'e', u'ἐ': 'e', u'ἑ': 'e', u'ἒ': 'e', u'ἓ': 'e', u'ἔ': 'e', u'ἕ': 'e', u'ὲ': 'e', u'έ': 'e', u'ζ': 'z', u'η': 'i', u'ή': 'i', u'ἠ': 'i', u'ἡ': 'i', u'ἢ': 'i', u'ἣ': 'i', u'ἤ': 'i', u'ἥ': 'i', u'ἦ': 'i', u'ἧ': 'i', u'ᾐ': 'i', u'ᾑ': 'i', u'ᾒ': 'i', u'ᾓ': 'i', u'ᾔ': 'i', u'ᾕ': 'i', u'ᾖ': 'i', u'ᾗ': 'i', u'ὴ': 'i', u'ή': 'i', u'ῂ': 'i', u'ῃ': 'i', u'ῄ': 'i', u'ῆ': 'i', u'ῇ': 'i', u'θ': 'th', u'ι': 'i', u'ί': 'i', u'ϊ': 'i', u'ΐ': 'i', u'ἰ': 'i', u'ἱ': 'i', u'ἲ': 'i', u'ἳ': 'i', u'ἴ': 'i', u'ἵ': 'i', u'ἶ': 'i', u'ἷ': 'i', u'ὶ': 'i', u'ί': 'i', u'ῐ': 'i', u'ῑ': 'i', u'ῒ': 'i', u'ΐ': 'i', u'ῖ': 'i', u'ῗ': 'i', u'κ': 'k', u'λ': 'l', u'μ': 'm', u'ν': 'n', u'ξ': 'ks', u'ο': 'o', u'ό': 'o', u'ὀ': 'o', u'ὁ': 'o', u'ὂ': 'o', u'ὃ': 'o', u'ὄ': 'o', u'ὅ': 'o', u'ὸ': 'o', u'ό': 'o', u'π': 'p', u'ρ': 'r', u'ῤ': 'r', u'ῥ': 'r', u'σ': 's', u'ς': 's', u'τ': 't', u'υ': 'y', u'ύ': 'y', u'ϋ': 'y', u'ΰ': 'y', u'ὐ': 'y', u'ὑ': 'y', u'ὒ': 'y', u'ὓ': 'y', u'ὔ': 'y', u'ὕ': 'y', u'ὖ': 'y', u'ὗ': 'y', u'ὺ': 'y', u'ύ': 'y', u'ῠ': 'y', u'ῡ': 'y', u'ῢ': 'y', u'ΰ': 'y', u'ῦ': 'y', u'ῧ': 'y', u'φ': 'f', u'χ': 'x', u'ψ': 'ps', u'ω': 'o', u'ώ': 'o', u'ὠ': 'o', u'ὡ': 'o', u'ὢ': 'o', u'ὣ': 'o', u'ὤ': 'o', u'ὥ': 'o', u'ὦ': 'o', u'ὧ': 'o', u'ᾠ': 'o', u'ᾡ': 'o', u'ᾢ': 'o', u'ᾣ': 'o', u'ᾤ': 'o', u'ᾥ': 'o', u'ᾦ': 'o', u'ᾧ': 'o', u'ὼ': 'o', u'ώ': 'o', u'ῲ': 'o', u'ῳ': 'o', u'ῴ': 'o', u'ῶ': 'o', u'ῷ': 'o', u'¨': '', u'΅': '', u'᾿': '', u'῾': '', u'῍': '', u'῝': '', u'῎': '', u'῞': '', u'῏': '', u'῟': '', u'῀': '', u'῁': '', u'΄': '', u'΅': '', u'`': '', u'῭': '', u'ͺ': '', u'᾽': '', u'А': 'A', u'Б': 'B', u'В': 'V', u'Г': 'G', u'Д': 'D', u'Е': 'E', u'Ё': 'E', u'Ж': 'ZH', u'З': 'Z', u'И': 'I', u'Й': 'I', u'К': 'K', u'Л': 'L', u'М': 'M', u'Н': 'N', u'О': 'O', u'П': 'P', u'Р': 'R', u'С': 'S', u'Т': 'T', u'У': 'U', u'Ф': 'F', u'Х': 'KH', u'Ц': 'TS', u'Ч': 'CH', u'Ш': 'SH', u'Щ': 'SHCH', u'Ы': 'Y', u'Э': 'E', u'Ю': 'YU', u'Я': 'YA', u'а': 'A', u'б': 'B', u'в': 'V', u'г': 'G', u'д': 'D', u'е': 'E', u'ё': 'E', u'ж': 'ZH', u'з': 'Z', u'и': 'I', u'й': 'I', u'к': 'K', u'л': 'L', u'м': 'M', u'н': 'N', u'о': 'O', u'п': 'P', u'р': 'R', u'с': 'S', u'т': 'T', u'у': 'U', u'ф': 'F', u'х': 'KH', u'ц': 'TS', u'ч': 'CH', u'ш': 'SH', u'щ': 'SHCH', u'ы': 'Y', u'э': 'E', u'ю': 'YU', u'я': 'YA', u'Ъ': '', u'ъ': '', u'Ь': '', u'ь': '', u'ð': 'd', u'Ð': 'D', u'þ': 'th', u'Þ': 'TH',
- u'ა': 'a', u'ბ': 'b', u'გ': 'g', u'დ': 'd', u'ე': 'e', u'ვ': 'v', u'ზ': 'z', u'თ': 't', u'ი': 'i', u'კ': 'k', u'ლ': 'l', u'მ': 'm', u'ნ': 'n', u'ო': 'o', u'პ': 'p', u'ჟ': 'zh', u'რ': 'r', u'ს': 's', u'ტ': 't', u'უ': 'u', u'ფ': 'p', u'ქ': 'k', u'ღ': 'gh', u'ყ': 'q', u'შ': 'sh', u'ჩ': 'ch', u'ც': 'ts', u'ძ': 'dz', u'წ': 'ts', u'ჭ': 'ch', u'ხ': 'kh', u'ჯ': 'j', u'ჰ': 'h' }
-
-def replace_char(m):
- char = m.group()
- if char_map.has_key(char):
- return char_map[char]
- else:
- return char
-
-def slughifi(value, do_slugify=True, overwrite_char_map={}):
- """
- High Fidelity slugify - slughifi.py, v 0.1
-
- Examples :
-
- >>> text = 'C\'est déjà l\'été.'
-
- >>> slughifi(text)
- 'cest-deja-lete'
-
- >>> slughifi(text, overwrite_char_map={u'\'': '-',})
- 'c-est-deja-l-ete'
-
- >>> slughifi(text, do_slugify=False)
- "C'est deja l'ete."
-
- # Normal slugify removes accented characters
- >>> slugify(text)
- 'cest-dj-lt'
-
- """
-
- # unicodification
- if type(value) != UnicodeType:
- value = unicode(value, 'utf-8', 'ignore')
-
- # overwrite chararcter mapping
- char_map.update(overwrite_char_map)
-
- # try to replace chars
- value = re.sub('[^a-zA-Z0-9\\s\\-]{1}', replace_char, value)
-
- # apply django default slugify
- if do_slugify:
- value = slugify(value)
-
- return value.encode('ascii', 'ignore')
-