From cc96a54d3bfe917023233a5f45ead32e10f2e66c Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Thu, 8 Nov 2012 11:23:28 +0100 Subject: [PATCH] registration limit --- contact/templates/contact/form.html | 3 + prawokultury/contact_forms.py | 9 +++ prawokultury/locale/pl/LC_MESSAGES/django.mo | Bin 2556 -> 3662 bytes prawokultury/locale/pl/LC_MESSAGES/django.po | 56 ++++++++++++++---- prawokultury/settings.d/60-custom.conf | 1 + prawokultury/static/css/base.css | 3 +- prawokultury/static/css/base.scss | 1 - prawokultury/templates/base.html | 2 +- .../templates/contact/register/form.html | 12 ++++ .../templates/contact/register/mail_body.txt | 6 ++ .../contact/register/mail_subject.txt | 1 + .../templates/contact/register/thanks.html | 6 ++ 12 files changed, 83 insertions(+), 17 deletions(-) create mode 100755 prawokultury/templates/contact/register/form.html create mode 100755 prawokultury/templates/contact/register/mail_body.txt create mode 100755 prawokultury/templates/contact/register/mail_subject.txt create mode 100755 prawokultury/templates/contact/register/thanks.html diff --git a/contact/templates/contact/form.html b/contact/templates/contact/form.html index d910424..29fdfa8 100644 --- a/contact/templates/contact/form.html +++ b/contact/templates/contact/form.html @@ -1,5 +1,8 @@ {% extends "base.html" %} {% load i18n chunks %} + +{% block "titleextra" %}{{ form.form_title }} :: {% endblock %} + {% block "body" %}

{% block contact_form_title %}{{ form.form_title }}{% endblock %}

diff --git a/prawokultury/contact_forms.py b/prawokultury/contact_forms.py index 2021be7..b3019cf 100644 --- a/prawokultury/contact_forms.py +++ b/prawokultury/contact_forms.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- +from django.conf import settings from django import forms from contact.forms import ContactForm +from contact.models import Contact from django.utils.translation import ugettext_lazy as _ @@ -26,3 +28,10 @@ class RegistrationForm(ContactForm): label=_('Permission for publication'), help_text=_('I agree to having materials recorded during the conference released under the terms of CC BY-SA license.') ) + + def __init__(self, *args, **kwargs): + super(RegistrationForm, self).__init__(*args, **kwargs) + self.limit_reached = Contact.objects.all().count() >= settings.REGISTRATION_LIMIT + if self.limit_reached: + for field in ('title', 'summary'): + self.fields[field].required = True diff --git a/prawokultury/locale/pl/LC_MESSAGES/django.mo b/prawokultury/locale/pl/LC_MESSAGES/django.mo index 32dd74ca49405b99940bf1cc104ca0010481d9ec..b64ebaabe7054a845f78faa8c4203a689d117b9a 100644 GIT binary patch delta 1599 zcmb7?J!~9B6vxM3NzMTR4j&RS&Fwz#&F${YGBd|% zw>fdhL_##y2_cg%QVNRDxPXEt%AJIS1Su$y3uvH-M1i15!GG3A?9gR&v%hyUZ{GK< z<3BF;cNb z+?o~QCGgETAs~v6z#aT&s+IJh=Z_yr7x{{WldpWr-r0*9}G&wN2AXbuc0G&|2hJ z2OnAyRtWq7>^`cyzgCRiV9PpUvYaUAt@O%h%2cjAwWXsLv&Nl_+8j6M&ofEOq)m@x z6mj8|PRJE3Q?}%~tz0>W_l}It%BEN`MY$sL;XYG3MZr{|uS$ftHz=iZs>zg4&1a)-k- zL>)!lsDi9jdVQxy>3{vhMP;0q;{h3`Mw^LNqitU{=T}=CX@#I|Rd(`jhjUb~%u+*D zG9DOLu~rhd48aEncg#tDZ(=C8r$VvqxvI>m7bd|)yhO$(Qme}Jq{g|H6nDqpjW)@p zG8=7U7>!S%z&XOYzSE*gh9E|pQ5m%ffo{XKX=RLlmnq(1J}}G}0P9i}wJ{%84z;Jx zoL4e7xfx#?U8G*=#sdjglQ}7)3J#WnA*YaC$kxP#>EVqWT^t^5eA7Qy!Bx7KeI;R{ z;PC*8K{rfB7Xy#;+jTBGniCA1B$V9*t^du<-5G4iXwPDEc&%~f_4OXc;6VK$@Ab|g diHcKMNsSzwX~A(CW~J11(YO<`>~QLv;$Pyp$BO^} delta 473 zcmX}ozb^zq6u|Mf>+WWcTR#qw$hw?{M2=`K7e_(1QMrOzqSJ^=6r!=wh%1>W6c-H= z5!E4TwcsxhiAYFPS_\n" "Language-Team: FNP \n" "Language: \n" @@ -17,48 +17,48 @@ msgstr "" "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" -#: contact_forms.py:9 +#: contact_forms.py:11 #: menu_items.py:22 msgid "Take part!" msgstr "Weź udział!" -#: contact_forms.py:11 +#: contact_forms.py:13 msgid "Name" msgstr "Imię i nazwisko" -#: contact_forms.py:12 +#: contact_forms.py:14 msgid "E-mail" msgstr "E-mail" -#: contact_forms.py:13 +#: contact_forms.py:15 msgid "Organization" msgstr "Organizacja" -#: contact_forms.py:15 +#: contact_forms.py:17 msgid "Title of presentation" msgstr "Tytuł prezentacji" -#: contact_forms.py:17 +#: contact_forms.py:19 msgid "Presentation" msgstr "Prezentacja" -#: contact_forms.py:19 +#: contact_forms.py:21 msgid "Summary of presentation (max. 1800 characters)" msgstr "Krótki opis prezentacji (maks. 1800 znaków)" -#: contact_forms.py:22 +#: contact_forms.py:24 msgid "Permission for data processing" msgstr "Zgoda na przetwarzanie danych" -#: contact_forms.py:23 +#: contact_forms.py:25 msgid "I hereby grant Modern Poland Foundation (Fundacja Nowoczesna Polska, ul. Marszałkowska 84/92, 00-514 Warszawa) permission to process my personal data (name, e-mail address) for purposes of registration for CopyCamp conference." msgstr "Wyrażam zgodę na przetwarzanie moich danych osobowych (imię, nazwisko, adres poczty elektronicznej) przez Fundację Nowoczesna Polska (ul. Marszałkowska 84/92, 00-514 Warszawa) w związku z rejestracją na konferencję CopyCamp." -#: contact_forms.py:26 +#: contact_forms.py:28 msgid "Permission for publication" msgstr "Zgoda na publikację" -#: contact_forms.py:27 +#: contact_forms.py:29 msgid "I agree to having materials recorded during the conference released under the terms of CC BY-SA license." msgstr "Wyrażam zgodę na publikację materiałów zarejestrowanych na konferencji na licencji CC BY-SA." @@ -71,6 +71,10 @@ msgstr "Strona nie znaleziona" msgid "The page you were looking for doesn't exist." msgstr "Strona, której szukasz, nie istnieje." +#: templates/base.html:16 +msgid "CopyCamp Conference is the first large-scale meeting in Poland devoted to the issues of copyright in both ideological and practical terms." +msgstr "CopyCamp jest pierwszym w Polsce, organizowanym na dużą skalę spotkaniem osób zajmujących się problematyką praw autorskich." + #: templates/base.html:26 msgid "CopyCamp" msgstr "CopyCamp" @@ -83,6 +87,32 @@ msgstr "Szukaj" msgid "If not explicitly stated otherwise, all texts are licensed under the Creative Commons Attribution-Share Alike free license." msgstr "Jeśli nie oznaczono inaczej, wszystkie teksty są objęte wolną licencją Creative Commons Uznanie autorstwa – Na tych samych warunkach." +#: templates/contact/register/form.html:8 +msgid "" +"Conference registration limit has been reached.\n" +"We are now accepting speaker submissions only." +msgstr "" +"Limit rejestracji uczestników konferencji został osiągnięty.\n" +"Obecnie przyjmujemy tylko zgłoszenia prezentacji." + +#: templates/contact/register/mail_body.txt:2 +#: templates/contact/register/mail_subject.txt:1 +#, python-format +msgid "Thank you for submitting the registration form at %(site_name)s." +msgstr "Dziękujemy za wypełnienie formularza rejestracyjnego na stronie %(site_name)s." + +#: templates/contact/register/mail_body.txt:3 +msgid "Your submission has been referred to the project coordinator." +msgstr "Twoje zgłoszenie zostało przekazane osobie koordynującej projekt." + +#: templates/contact/register/mail_body.txt:6 +msgid "Message sent automatically. Please do not reply to it." +msgstr "Wiadomość wysłana automatycznie, prosimy nie odpowiadać." + +#: templates/contact/register/thanks.html:5 +msgid "Thank you for submitting the registration form." +msgstr "Dziękujemy za wypełnienie formularza rejestracyjnego." + #~ msgid "Registration form" #~ msgstr "Formularz rejestracyjny" diff --git a/prawokultury/settings.d/60-custom.conf b/prawokultury/settings.d/60-custom.conf index bf41dc9..87e1d91 100755 --- a/prawokultury/settings.d/60-custom.conf +++ b/prawokultury/settings.d/60-custom.conf @@ -16,3 +16,4 @@ MENU_MODULE = 'prawokultury.menu_items' # See http://wiki.nginx.org/X-accel X_ACCEL_REDIRECT = False +REGISTRATION_LIMIT = 100 diff --git a/prawokultury/static/css/base.css b/prawokultury/static/css/base.css index 9c3ddd8..cc08544 100644 --- a/prawokultury/static/css/base.css +++ b/prawokultury/static/css/base.css @@ -27,8 +27,7 @@ h1 { .warning { border: 1px solid #ddd; padding: 1em; - background: #ffd; - font-size: 1.3em; } + background: #ffd; } .notice { font-size: 1.3em; } diff --git a/prawokultury/static/css/base.scss b/prawokultury/static/css/base.scss index 18db75e..adcb27c 100644 --- a/prawokultury/static/css/base.scss +++ b/prawokultury/static/css/base.scss @@ -35,7 +35,6 @@ h1 { border: 1px solid #ddd; padding: 1em; background: #ffd; - font-size: 1.3em; } .notice { diff --git a/prawokultury/templates/base.html b/prawokultury/templates/base.html index b484c46..8debfde 100755 --- a/prawokultury/templates/base.html +++ b/prawokultury/templates/base.html @@ -13,7 +13,7 @@ - + diff --git a/prawokultury/templates/contact/register/form.html b/prawokultury/templates/contact/register/form.html new file mode 100755 index 0000000..75d99a9 --- /dev/null +++ b/prawokultury/templates/contact/register/form.html @@ -0,0 +1,12 @@ +{% extends "contact/form.html" %} +{% load i18n %} + +{% block contact_form_description %} +{{ block.super }} + +{% if form.limit_reached %} +

{% blocktrans %}Conference registration limit has been reached. +We are now accepting speaker submissions only.{% endblocktrans %}

+{% endif %} + +{% endblock %} diff --git a/prawokultury/templates/contact/register/mail_body.txt b/prawokultury/templates/contact/register/mail_body.txt new file mode 100755 index 0000000..4c30ef7 --- /dev/null +++ b/prawokultury/templates/contact/register/mail_body.txt @@ -0,0 +1,6 @@ +{% load i18n %} +{% blocktrans %}Thank you for submitting the registration form at {{ site_name }}.{% endblocktrans %} +{% trans "Your submission has been referred to the project coordinator." %} + +-- +{% trans "Message sent automatically. Please do not reply to it." %} diff --git a/prawokultury/templates/contact/register/mail_subject.txt b/prawokultury/templates/contact/register/mail_subject.txt new file mode 100755 index 0000000..63a44bf --- /dev/null +++ b/prawokultury/templates/contact/register/mail_subject.txt @@ -0,0 +1 @@ +{% load i18n %}{% blocktrans %}Thank you for submitting the registration form at {{ site_name }}.{% endblocktrans %} \ No newline at end of file diff --git a/prawokultury/templates/contact/register/thanks.html b/prawokultury/templates/contact/register/thanks.html new file mode 100755 index 0000000..3a21c98 --- /dev/null +++ b/prawokultury/templates/contact/register/thanks.html @@ -0,0 +1,6 @@ +{% extends "contact/thanks.html" %} +{% load i18n %} + +{% block contact_form_description %} +

{% trans "Thank you for submitting the registration form." %}

+{% endblock %} -- 2.20.1