From: Aleksander Łukasz Date: Fri, 18 Oct 2013 10:56:29 +0000 (+0200) Subject: Contact form for mil X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/8bf64e144b5eb0367f8d5da19765ea0dabd66bfb?ds=sidebyside Contact form for mil --- diff --git a/comment/locale/pl/LC_MESSAGES/django.mo b/comment/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000..bae5ed3 Binary files /dev/null and b/comment/locale/pl/LC_MESSAGES/django.mo differ diff --git a/comment/locale/pl/LC_MESSAGES/django.po b/comment/locale/pl/LC_MESSAGES/django.po new file mode 100644 index 0000000..96fc115 --- /dev/null +++ b/comment/locale/pl/LC_MESSAGES/django.po @@ -0,0 +1,34 @@ +# 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: 2013-10-18 12:46+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \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/comment/commentdocument_list.html:7 +#, python-format +msgid "" +"\n" +" Take part in consultations by filling out this " +"form or comment on specific competencies in different thematic fields\n" +" " +msgstr "" +"\n" +" Weź udział w konsultacjach wypełniając ten formularz" +" lub skomentuj szczegółowo kompetencje w poszczególnych obszarach tematycznych\n" +" " + diff --git a/comment/templates/comment/commentdocument_list.html b/comment/templates/comment/commentdocument_list.html index 41d115b..e58fc37 100644 --- a/comment/templates/comment/commentdocument_list.html +++ b/comment/templates/comment/commentdocument_list.html @@ -1,8 +1,13 @@ {% extends "base_mil.html" %} +{% load i18n %} {% block body %} +

{% blocktrans with href=form_href %} + Take part in consultations by filling out this form or comment on specific competencies in different thematic fields + {% endblocktrans %}:

+
    {% for document in object_list %}
  1. {{document.name}}
  2. diff --git a/comment/views.py b/comment/views.py index e494828..1471029 100644 --- a/comment/views.py +++ b/comment/views.py @@ -2,6 +2,8 @@ from django.views.generic import ListView, DetailView from django.conf import settings from django.utils.translation import get_language +from django.core.urlresolvers import reverse + from .models import CommentDocument @@ -11,6 +13,11 @@ class CommentDocumentList(ListView): def get_queryset(self, **kwargs): return super(CommentDocumentList, self).get_queryset(**kwargs).filter(language_code = get_language()) + def get_context_data(self, **kwargs): + context = super(CommentDocumentList, self).get_context_data(**kwargs) + context['form_href'] = reverse('contact_form', kwargs = dict(form_tag = 'mil')) + return context + class CommentDocument(DetailView): model = CommentDocument diff --git a/contact/templates/contact/form.html b/contact/templates/contact/form.html index 963742e..a9741f1 100644 --- a/contact/templates/contact/form.html +++ b/contact/templates/contact/form.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends form.base_template|default:"base.html" %} {% load chunks %} {% block title %}{{ form.form_title }}{% endblock %} diff --git a/contact/templates/contact/thanks.html b/contact/templates/contact/thanks.html index cc061ed..63adb30 100644 --- a/contact/templates/contact/thanks.html +++ b/contact/templates/contact/thanks.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends form.base_template|default:"base.html" %} {% load i18n %} {% block title %}{% trans "Thank you" %}{% endblock %} diff --git a/edumed/contact_forms.py b/edumed/contact_forms.py index 3ffdded..7271558 100644 --- a/edumed/contact_forms.py +++ b/edumed/contact_forms.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from django import forms from contact.forms import ContactForm +from django.utils.translation import ugettext as _ class RegistrationForm(ContactForm): @@ -127,3 +128,37 @@ class WTEMForm(ContactForm): required=False ) +class MILForm(ContactForm): + form_tag = 'mil' + from_title = 'Mil' + submit_label = _('Submit') + base_template = 'base_mil.html' + + name = forms.CharField(label = _('Name and Surname'), max_length = 255) + contact = forms.EmailField(label = _('E-mail'), max_length = 255) + + institution = forms.CharField(label =_('Institution'), widget = forms.Textarea, max_length = 8192) + + question_stages = forms.CharField( + label = _('What do you think about the proposed educational stages classification?'), + widget = forms.Textarea, + max_length = 255 + ) + + question_fields = forms.CharField( + label = _('What do you think about the proposed thematic fields?'), + widget = forms.Textarea, + max_length = 255 + ) + + question_left_out = forms.CharField( + label = _('What important areas of media and information literacy have been left out?'), + widget = forms.Textarea, + max_length = 255 + ) + + other = forms.CharField( + label = _('Other suggestions and comments'), + widget = forms.Textarea, + max_length = 255 + ) diff --git a/edumed/locale/pl/LC_MESSAGES/django.mo b/edumed/locale/pl/LC_MESSAGES/django.mo index 0480e2c..87f7778 100644 Binary files a/edumed/locale/pl/LC_MESSAGES/django.mo and b/edumed/locale/pl/LC_MESSAGES/django.mo differ diff --git a/edumed/locale/pl/LC_MESSAGES/django.po b/edumed/locale/pl/LC_MESSAGES/django.po index ceb63cc..5e8bd6f 100644 --- a/edumed/locale/pl/LC_MESSAGES/django.po +++ b/edumed/locale/pl/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-15 14:02+0200\n" +"POT-Creation-Date: 2013-10-18 12:02+0200\n" "PO-Revision-Date: 2012-11-19 15:58+0100\n" "Last-Translator: Radek Czajka \n" "Language-Team: LANGUAGE \n" @@ -18,6 +18,39 @@ msgstr "" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2)\n" +#: contact_forms.py:133 +msgid "Submit" +msgstr "Zgłoś" + +#: contact_forms.py:135 +msgid "Name and Surname" +msgstr "Imię i nazwisko" + +#: contact_forms.py:136 +msgid "E-mail" +msgstr "Adres e-mail" + +#: contact_forms.py:138 +msgid "Institution" +msgstr "Instytucja" + +#: contact_forms.py:141 +msgid "What do you think about the proposed educational stages classification?" +msgstr "Co sądzisz o zaproponowanym podziale na etapy edukacyjne?" + +#: contact_forms.py:147 +msgid "What do you think about the proposed thematic fields?" +msgstr "Co sądzisz o zaproponowanym podziale na obszary tematyczne?" + +#: contact_forms.py:153 +msgid "" +"What important areas of media and information literacy have been left out?" +msgstr "Jakie ważne obszary edukacji medialnej i informacyjnej zostały Twoim zdaniem niewystarczająco pogłębione lub pominięto je w ogóle?" + +#: contact_forms.py:159 +msgid "Other suggestions and comments" +msgstr "Inne uwagi i sugestie" + #: templates/404.html:4 #: templates/404.html.py:8 #: templates/404.html:4 templates/404.html.py:8 templates/404_mil.html:4 diff --git a/edumed/milurls.py b/edumed/milurls.py index 9178dfa..0fe0f5d 100644 --- a/edumed/milurls.py +++ b/edumed/milurls.py @@ -7,7 +7,8 @@ from .views import mil_home_view urlpatterns = i18n_patterns('', url(r'^$', mil_home_view, name="mil_home"), url(r'^kompetencje/', include('curriculum.urls')), - url(r'^wez-udzial/', include('comment.urls')) + url(r'^wez-udzial/', include('comment.urls')), + url(r'^zglos/', include('contact.urls')), ) handler404 = 'edumed.views.mil_404_view'