From 8bf64e144b5eb0367f8d5da19765ea0dabd66bfb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Aleksander=20=C5=81ukasz?= Date: Fri, 18 Oct 2013 12:56:29 +0200 Subject: [PATCH] Contact form for mil --- comment/locale/pl/LC_MESSAGES/django.mo | Bin 0 -> 831 bytes comment/locale/pl/LC_MESSAGES/django.po | 34 +++++++++++++++++ .../comment/commentdocument_list.html | 5 +++ comment/views.py | 7 ++++ contact/templates/contact/form.html | 2 +- contact/templates/contact/thanks.html | 2 +- edumed/contact_forms.py | 35 ++++++++++++++++++ edumed/locale/pl/LC_MESSAGES/django.mo | Bin 899 -> 1648 bytes edumed/locale/pl/LC_MESSAGES/django.po | 35 +++++++++++++++++- edumed/milurls.py | 3 +- 10 files changed, 119 insertions(+), 4 deletions(-) create mode 100644 comment/locale/pl/LC_MESSAGES/django.mo create mode 100644 comment/locale/pl/LC_MESSAGES/django.po diff --git a/comment/locale/pl/LC_MESSAGES/django.mo b/comment/locale/pl/LC_MESSAGES/django.mo new file mode 100644 index 0000000000000000000000000000000000000000..bae5ed3c924b52d4088dafd2e396ce2321981ce9 GIT binary patch literal 831 zcmZ`%L2uJA6fOuZIdbOkG-=bO;VtPVG-XM*ux6v8X-n4)!3DXgo4QNw$aWa5cACT= zK;puk8#iuTp?`y4z>nZL8=5%qq)&c+{_OAB{(e1r@TrDzAMqIR1o03NAZ+vypAjz+ zU+&dvzj6GE_=p>D`cK$1Y7Srw=mmpF?7 z(g&y49gri%symP-HOz;)>+KNFCEgx*b$|EirdxMiB$7UR$L-;_yw`EmCrOtyBY58R zlh)>&ZYOryR2wo-ROp-YtwaGb_36atE;MRIqnAT@o-OlW8Xmoy<*GnP>vRyF0bJdE^hskPH8%UOT5JL zT5vl3`62zkeVC}+Q|44HDhuW15cGw#9xA7x7wLj!KfW!m<)uW0TOUms>J{?uYA)ue UD2IAMmDM)ZRP%IU%Qu$#17P?36aWAK literal 0 HcmV?d00001 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 0480e2c77bbaccb489fd8df1f65795467d12098c..87f7778f4b0be8d5ea6981c1b657ebc1786f671d 100644 GIT binary patch literal 1648 zcma)+&u<$=6vr26`C-ZrAt4SR^n^rdRo2~gi4@#8X$WbQHchO=ZO_lUV|(n~nbpi} zT(5eH=mCivaOka9Bsld1f&*%D;~zjm9Fb73aOXSgMB&(x#-G`Fzh~z8&$rHe8(_SF z`5xvsnD1bodk#MsBk&w3!Pmfj@FnmI@I~;eWBJ$MtN4Bdz6pL0z7PHaz7GBYz5+f4 zKL-B=H^2{`4}t}74Bh}Afxklb6!iXnI1>a7@JGggFfy*;M?HY zvva-+di@x@3@(FhP=QO}ci@-cUm(KP!^iVEBZbf~Vez4CnK^b63;*Rfalv|+v&@3)+LSq2!6q36o60)rO0O7f zb1sNgN_(YISO+_9Bn;VdI26!=t6G}qJQvE@pvyx+N;?|pQl&wUCxW_cT+kZ{D!g!} zOPUHJDARf()exG7QZ20d$dR}wt!oB%N9?dy>$;It6XL!u9U(RqMi<(Oltfx4bv2xk zb#QGd$=F&skn{bOXY&K6Is7CvkRnU%v6ajVZ5%5{Yy?}<1Ik4zxh_{KB<+o~qD(qr zIGNFi_XYKZz?K*|LcS|O*XXfGT)3HrcZ9LfZ&P=5?dIynI^9{{-P_#RZtMylDZFKe zG7Uc~hc@i#HZ{6Cy>JboeUR{TcA`zKD83TLQ5Y{$+-gUyOHnI|pcw9oed(Q_>b1f+ z4&zTLUT7~YUW#JqZLxJ>&#qTE*iD(~{v-Lo#h9^~N=&r#h){EnMi# zPPnPfuvuiw@S}z$jyvoL&fB!Ly1jAR*R!;>buE)#?NkSK+}gagep-Coj2iy!;jx6h zS%IRQxaTex8B2AQk`Ws#T<3Q0dboJ1=W`wi6RxX7r+6}LTI@^L=w_wiEX3Q*ZJSh4 zf7;HKt2AGBE~ri?rWJ|^;t%6!xznQa=j-KC=M%rY;J2ftIHLRa>wT{iU4%^xo7Tlf zaPy>x#scek3(c2~CoWh`4c?uYchO!|PIyd;{hKcHx{+qCOvW5+=JN0%Nyw_Hv=a@P z5>!rkD6xxn^4%nYJ!dq`l@wGd&P0Vv<>0P3`iaW4l6-Vtot#Zlci# zM+f{r+a@}l?BN3#LrGJ`b^qXUSCKOX1Gf< z#Vo13@eQ7!iYXucj6zQo=HAD0-bEV;d88Z0~z(n4x delta 258 zcmXZWKMO%&6vy%NxYz%Sx}_w;vso01*>=4E%3`^RM5rr^#h|=_o6WoM3T(Uqi!#|5 ztTx|APJQ~FPR}_#Z)Y3d++BMwR01XRk;Vb0&Tw!+23N%KfSJFL#Ro|wlt_hi$rD;I z_mm})A~U4fFOWGAPc%)QL5(yAJ+ex6NOpf^7NY;2vBVI84fAmchpOy&i(oa=%b_0( j#^Fu1!)K&tH+8*n^sJrAb=Iq?KhbkvkIcic80~%mnLQuc 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' -- 2.20.1