From: Radek Czajka {% trans "Report a bug or suggestion" %}
+
\ No newline at end of file
diff --git a/apps/suggest/urls.py b/apps/suggest/urls.py
new file mode 100644
index 000000000..44d606e6b
--- /dev/null
+++ b/apps/suggest/urls.py
@@ -0,0 +1,14 @@
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from django.conf.urls.defaults import *
+from django.views.generic.simple import direct_to_template
+from suggest.forms import SuggestForm
+
+urlpatterns = patterns('',
+ url(r'^$', 'django.views.generic.simple.direct_to_template',
+ {'template': 'suggest.html', 'extra_context': {'form': SuggestForm }}, name='suggest'),
+ url(r'^wyslij/$', 'suggest.views.report', name='report'),
+)
+
diff --git a/apps/suggest/views.py b/apps/suggest/views.py
new file mode 100644
index 000000000..cd733a840
--- /dev/null
+++ b/apps/suggest/views.py
@@ -0,0 +1,37 @@
+# -*- coding: utf-8 -*-
+# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
+from django.http import HttpResponse, HttpResponseRedirect
+from django.views.decorators import cache
+from django.views.decorators.http import require_POST
+from django.utils.translation import ugettext as _
+
+from suggest import forms
+from suggest.models import Suggestion
+
+# FIXME - shouldn't be in catalogue
+from catalogue.views import LazyEncoder
+
+
+#@require_POST
+@cache.never_cache
+def report(request):
+ suggest_form = forms.SuggestForm(request.POST)
+ if suggest_form.is_valid():
+ author = suggest_form.cleaned_data['author']
+ email = suggest_form.cleaned_data['email']
+ title = suggest_form.cleaned_data['title']
+ description = suggest_form.cleaned_data['description']
+
+ suggestion = Suggestion(author=author, email=email, title=title,
+ description=description, ip=request.META['REMOTE_ADDR'])
+ if request.user.is_authenticated():
+ suggestion.user = request.user
+ suggestion.save()
+
+ response_data = {'success': True, 'message': _('Report was sent successfully.')}
+ else:
+ response_data = {'success': False, 'errors': suggest_form.errors}
+ print LazyEncoder(ensure_ascii=False).encode(response_data)
+ return HttpResponse(LazyEncoder(ensure_ascii=False).encode(response_data))
diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.mo b/wolnelektury/locale/de/LC_MESSAGES/django.mo
index 55259ba7f..bcaab3060 100644
Binary files a/wolnelektury/locale/de/LC_MESSAGES/django.mo and b/wolnelektury/locale/de/LC_MESSAGES/django.mo differ
diff --git a/wolnelektury/locale/de/LC_MESSAGES/django.po b/wolnelektury/locale/de/LC_MESSAGES/django.po
index bc5d3d53b..ab85ecb03 100644
--- a/wolnelektury/locale/de/LC_MESSAGES/django.po
+++ b/wolnelektury/locale/de/LC_MESSAGES/django.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-05-25 14:29+0200\n"
+"POT-Creation-Date: 2010-06-01 10:53+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME
{% trans "Sign in" %} / {% trans "Register" %}
+{% trans "Report a bug" %} + | {% trans "Sign in" %} / {% trans "Register" %}
{% endif %} +{% trans "Loading" %}
+