From: Radek Czajka Date: Tue, 1 Jun 2010 10:05:45 +0000 (+0200) Subject: bug report form X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/98e12313596c58738fc7e3eeaccfde202b91ef2a bug report form --- diff --git a/apps/suggest/__init__.py b/apps/suggest/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/suggest/admin.py b/apps/suggest/admin.py new file mode 100644 index 000000000..b8743dfe4 --- /dev/null +++ b/apps/suggest/admin.py @@ -0,0 +1,12 @@ +# -*- 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.contrib import admin + +from suggest.models import Suggestion + +class SuggestionAdmin(admin.ModelAdmin): + list_display = ('title', 'user', 'author', 'email', 'created_at') + +admin.site.register(Suggestion, SuggestionAdmin) diff --git a/apps/suggest/forms.py b/apps/suggest/forms.py new file mode 100644 index 000000000..fed55f6f5 --- /dev/null +++ b/apps/suggest/forms.py @@ -0,0 +1,12 @@ +# -*- 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 import forms +from django.utils.translation import ugettext_lazy as _ + +class SuggestForm(forms.Form): + author = forms.CharField(label=_('Author'), max_length=50, required=False) + email = forms.EmailField(label=_('E-mail'), required=False) + title = forms.CharField(label=_('Title'), max_length=120, required=True) + description = forms.CharField(label=_('Description'), widget=forms.Textarea, required=True) diff --git a/apps/suggest/locale/de/LC_MESSAGES/django.po b/apps/suggest/locale/de/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/de/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/en/LC_MESSAGES/django.po b/apps/suggest/locale/en/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/en/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/es/LC_MESSAGES/django.po b/apps/suggest/locale/es/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/es/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/fr/LC_MESSAGES/django.po b/apps/suggest/locale/fr/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/fr/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/lt/LC_MESSAGES/django.po b/apps/suggest/locale/lt/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/lt/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/pl/LC_MESSAGES/django.mo b/apps/suggest/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 000000000..cee6f93a8 Binary files /dev/null and b/apps/suggest/locale/pl/LC_MESSAGES/django.mo differ diff --git a/apps/suggest/locale/pl/LC_MESSAGES/django.po b/apps/suggest/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 000000000..ef570c86c --- /dev/null +++ b/apps/suggest/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: 2010-06-01 11:37\n" +"Last-Translator: \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Translated-Using: django-rosetta 0.5.3\n" + +#: forms.py:9 +msgid "Author" +msgstr "Autor" + +#: forms.py:10 +msgid "E-mail" +msgstr "E-mail" + +#: forms.py:11 +msgid "Title" +msgstr "Tytuł" + +#: forms.py:12 +msgid "Description" +msgstr "Opis" + +#: models.py:10 +msgid "author" +msgstr "autor" + +#: models.py:11 +msgid "e-mail" +msgstr "e-mail" + +#: models.py:12 +msgid "title" +msgstr "tytuł" + +#: models.py:13 +msgid "description" +msgstr "opis" + +#: models.py:14 +msgid "creation date" +msgstr "data utworzenia" + +#: models.py:15 +msgid "IP address" +msgstr "adres IP" + +#: models.py:20 +msgid "suggestion" +msgstr "sugestia" + +#: models.py:21 +msgid "suggestions" +msgstr "sugestie" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "Zgłoszenie zostało wysłane." + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "Zgłoś błąd lub sugestię" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "Wyślij zgłoszenie" diff --git a/apps/suggest/locale/ru/LC_MESSAGES/django.po b/apps/suggest/locale/ru/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/ru/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/locale/uk/LC_MESSAGES/django.po b/apps/suggest/locale/uk/LC_MESSAGES/django.po new file mode 100644 index 000000000..d4d2985bb --- /dev/null +++ b/apps/suggest/locale/uk/LC_MESSAGES/django.po @@ -0,0 +1,77 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2010-06-01 11:35+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: forms.py:9 +msgid "Author" +msgstr "" + +#: forms.py:10 +msgid "E-mail" +msgstr "" + +#: forms.py:11 +msgid "Title" +msgstr "" + +#: forms.py:12 +msgid "Description" +msgstr "" + +#: models.py:10 +msgid "author" +msgstr "" + +#: models.py:11 +msgid "e-mail" +msgstr "" + +#: models.py:12 +msgid "title" +msgstr "" + +#: models.py:13 +msgid "description" +msgstr "" + +#: models.py:14 +msgid "creation date" +msgstr "" + +#: models.py:15 +msgid "IP address" +msgstr "" + +#: models.py:20 +msgid "suggestion" +msgstr "" + +#: models.py:21 +msgid "suggestions" +msgstr "" + +#: views.py:33 +msgid "Report was sent successfully." +msgstr "" + +#: templates/suggest.html:2 +msgid "Report a bug or suggestion" +msgstr "" + +#: templates/suggest.html:9 +msgid "Send report" +msgstr "" diff --git a/apps/suggest/migrations/0001_initial.py b/apps/suggest/migrations/0001_initial.py new file mode 100644 index 000000000..dca73ea0e --- /dev/null +++ b/apps/suggest/migrations/0001_initial.py @@ -0,0 +1,81 @@ +# encoding: 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 'Suggestion' + db.create_table('suggest_suggestion', ( + ('description', self.gf('django.db.models.fields.TextField')(blank=True)), + ('title', self.gf('django.db.models.fields.CharField')(max_length=120)), + ('ip', self.gf('django.db.models.fields.IPAddressField')(max_length=15)), + ('created_at', self.gf('django.db.models.fields.DateTimeField')(auto_now=True, blank=True)), + ('author', self.gf('django.db.models.fields.CharField')(max_length=120, blank=True)), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'], null=True, blank=True)), + ('email', self.gf('django.db.models.fields.EmailField')(max_length=75, blank=True)), + )) + db.send_create_signal('suggest', ['Suggestion']) + + + def backwards(self, orm): + + # Deleting model 'Suggestion' + db.delete_table('suggest_suggestion') + + + models = { + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'suggest.suggestion': { + 'Meta': {'object_name': 'Suggestion'}, + 'author': ('django.db.models.fields.CharField', [], {'max_length': '120', 'blank': 'True'}), + 'created_at': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), + 'description': ('django.db.models.fields.TextField', [], {'blank': 'True'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '120'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}) + } + } + + complete_apps = ['suggest'] diff --git a/apps/suggest/migrations/__init__.py b/apps/suggest/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/apps/suggest/models.py b/apps/suggest/models.py new file mode 100644 index 000000000..f690bc831 --- /dev/null +++ b/apps/suggest/models.py @@ -0,0 +1,25 @@ +# -*- 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.db import models +from django.contrib.auth.models import User +from django.utils.translation import ugettext_lazy as _ + +class Suggestion(models.Model): + author = models.CharField(_('author'), blank=True, max_length=120) + email = models.EmailField(_('e-mail'), blank=True) + title = models.CharField(_('title'), max_length=120) + description = models.TextField(_('description'), blank=True) + created_at = models.DateTimeField(_('creation date'), auto_now=True) + ip = models.IPAddressField(_('IP address')) + user = models.ForeignKey(User, blank=True, null=True) + + class Meta: + ordering = ('-created_at',) + verbose_name = _('suggestion') + verbose_name_plural = _('suggestions') + + def __unicode__(self): + return self.title + \ No newline at end of file diff --git a/apps/suggest/templates/suggest.html b/apps/suggest/templates/suggest.html new file mode 100644 index 000000000..a2d9d726e --- /dev/null +++ b/apps/suggest/templates/suggest.html @@ -0,0 +1,11 @@ +{% load i18n %} +

{% trans "Report a bug or suggestion" %}

+
+
    +
  1. {{ form.author }}
  2. +
  3. {{ form.email }}
  4. +
  5. {{ form.title }}
  6. +
  7. {{ form.description }}
  8. +
  9. +
+
\ 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 \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -110,32 +110,36 @@ msgstr "Twoje półki" msgid "Administration" msgstr "Administracja" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "Wyloguj" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "Zaloguj się" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "Załóż konto" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "Wybierz język interfejsu:" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "Wybierz język" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by Bibliotekę Narodową z egzemplarzy pochodzących ze zbiorów BN.\n" "Hosting EO Networks. " -#: templates/base.html:75 +#: templates/base.html:77 msgid "" "\n" "\t\t\t\tModern Poland Foundation, 00-514 Warsaw, ul. Marszałkowska 84/92 " @@ -166,7 +170,7 @@ msgstr "" "125, tel/fax: (22) 621-30-17, e-mail: fundacja@nowoczesnapolska.org.pl" -#: templates/base.html:84 templates/base.html.py:105 +#: templates/base.html:86 templates/base.html.py:107 templates/base.html:113 #: templates/catalogue/book_detail.html:129 #: templates/catalogue/book_fragments.html:33 #: templates/catalogue/book_stub_detail.html:31 @@ -177,7 +181,8 @@ msgstr "" msgid "Close" msgstr "Zamknij" -#: templates/base.html:107 templates/catalogue/book_detail.html:131 +#: templates/base.html:109 templates/base.html.py:115 +#: templates/catalogue/book_detail.html:131 #: templates/catalogue/book_fragments.html:35 #: templates/catalogue/book_stub_detail.html:33 #: templates/catalogue/search_multiple_hits.html:25 diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.mo b/wolnelektury/locale/ru/LC_MESSAGES/django.mo index 55259ba7f..bcaab3060 100644 Binary files a/wolnelektury/locale/ru/LC_MESSAGES/django.mo and b/wolnelektury/locale/ru/LC_MESSAGES/django.mo differ diff --git a/wolnelektury/locale/ru/LC_MESSAGES/django.po b/wolnelektury/locale/ru/LC_MESSAGES/django.po index bc5d3d53b..ab85ecb03 100644 --- a/wolnelektury/locale/ru/LC_MESSAGES/django.po +++ b/wolnelektury/locale/ru/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 \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by \n" "Language-Team: LANGUAGE \n" @@ -100,32 +100,36 @@ msgstr "" msgid "Administration" msgstr "" -#: templates/base.html:38 +#: templates/base.html:38 templates/base.html.py:42 +msgid "Report a bug" +msgstr "" + +#: templates/base.html:39 msgid "Logout" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:91 -#: templates/base.html.py:95 templates/auth/login.html:4 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:93 +#: templates/base.html.py:97 templates/auth/login.html:4 #: templates/auth/login.html.py:7 templates/auth/login.html:12 #: templates/auth/login.html.py:15 msgid "Sign in" msgstr "" -#: templates/base.html:41 templates/base.html.py:87 templates/base.html:95 -#: templates/base.html.py:99 templates/auth/login.html:7 +#: templates/base.html:43 templates/base.html.py:89 templates/base.html:97 +#: templates/base.html.py:101 templates/auth/login.html:7 #: templates/auth/login.html.py:21 templates/auth/login.html:23 msgid "Register" msgstr "" -#: templates/base.html:51 +#: templates/base.html:53 msgid "Choose your interface language: " msgstr "" -#: templates/base.html:56 +#: templates/base.html:58 msgid "Choose language" msgstr "" -#: templates/base.html:68 +#: templates/base.html:70 msgid "" "\n" "\t\t\t\tWolne Lektury is a project lead by ' + errors[0] + ''); + }); + $('#suggest-form input[type=submit]').removeAttr('disabled'); + return false; + } + } + }); + } + }); $('#books-list .book').hover( function() { $(this).css({background: '#F3F3F3', cursor: 'pointer'}); }, diff --git a/wolnelektury/templates/base.html b/wolnelektury/templates/base.html index f0eb274d7..ddec560b4 100644 --- a/wolnelektury/templates/base.html +++ b/wolnelektury/templates/base.html @@ -35,10 +35,12 @@ {% if user.is_staff %} | {% trans "Administration" %} {% endif %} + | {% trans "Report a bug" %} | {% trans "Logout" %}

{% else %} -

+

{% trans "Report a bug" %} + |

{% endif %} +
+ +
+

* {% trans "Loading" %}

+
+
{% endblock bodycontent %}