adicionando template de email de confirmacão para o cadastro de palestrantes.
[cascardo/eventmanager.git] / forms.py
index e7ece08..cac8fd6 100644 (file)
--- a/forms.py
+++ b/forms.py
@@ -22,16 +22,18 @@ from django.newforms.widgets import Textarea, PasswordInput
 from eventmanager.eventos.models import \
         TipoTrabalho, CategoriaTrabalho, Palestrante, STATE_CHOICES
 
-MKCHOICES = lambda K:[(x.id, str(x)) for x in K.objects.all()]
+MKCHOICES = lambda K, xid=-1:[(x.id, str(x)) for x in K.objects.all() \
+        if xid != x.id]
 
 class SubmeterTrabalho(forms.Form):
-    def __init__(self, *args, **kwargs):
+    def __init__(self, request, *args, **kwargs):
         super(SubmeterTrabalho, self).__init__(*args, **kwargs)
 
         newchoices = MKCHOICES(TipoTrabalho)
         self.fields['tipo'].choices = newchoices
 
-        newchoices = MKCHOICES(Palestrante)
+        palestrante = request.user.palestrante_set.get()
+        newchoices = MKCHOICES(Palestrante, xid=palestrante.id)
         self.fields['outros_palestrantes'].choices = newchoices
 
     titulo = forms.CharField(max_length=100, label='Título do trabalho')
@@ -47,7 +49,7 @@ class SubmeterTrabalho(forms.Form):
                   '(máximo 1500 caracteres).')
     recursos = forms.CharField(widget=Textarea(), max_length=300, required=0,
         help_text='Liste os recursos que seu trabalho irá necessitar, '
-                  'ex.: Computadores, softwares, etc.')
+                  'ex.: Computadores, softwares, etc. Máximo de 300 caracteres.')
     outros_palestrantes = forms.MultipleChoiceField(required=0)
 
 
@@ -63,9 +65,12 @@ class CadastroPalestrante(forms.Form):
     celular = forms.CharField(required=False)
 
     instituicao = forms.CharField(max_length=100, label='Instituição')
-    minicurriculo = forms.CharField(widget=Textarea(), label='Mini Currículo')
-    curriculo = forms.CharField(widget=Textarea(), label='Currículo')
-
+    minicurriculo = forms.CharField(widget=Textarea(), max_length=250, label='Mini Currículo',
+       help_text='Este mini currículo será utilizado no material de divulgação '
+                 'e no sítio. Máximo de 250 caracteres.')
+    curriculo = forms.CharField(widget=Textarea(), max_length=6000, label='Currículo',
+       help_text='Este currículo será utilizado para avaliação do palestrante. '
+                 'Máximo de 6000 caracteres.')
     rua = forms.CharField(max_length=100)
     numero = forms.CharField(max_length=10, label='Número')
     bairro = forms.CharField(max_length=100)
@@ -81,9 +86,12 @@ class EditarPalestrante(forms.Form):
     celular = forms.CharField(required=False)
 
     instituicao = forms.CharField(max_length=100, label='Instituição')
-    minicurriculo = forms.CharField(widget=Textarea(), label='Mini Currículo')
-    curriculo = forms.CharField(widget=Textarea(), label='Currículo')
-
+    minicurriculo = forms.CharField(widget=Textarea(), max_length=250, label='Mini Currículo',
+       help_text='Este mini currículo será utilizado no material de divulgação'
+                 'e no site. Máximo de 250 caracteres.')
+    curriculo = forms.CharField(widget=Textarea(), max_length=6000, label='Currículo',
+       help_text='Este currículo será utilizado para avaliação do palestrante.'
+                 'Máximo de 6000 caracteres.')
     rua = forms.CharField(max_length=100)
     numero = forms.CharField(max_length=10, label='Número')
     bairro = forms.CharField(max_length=100)
@@ -108,3 +116,28 @@ class Inscricao(forms.Form):
     bairro = forms.CharField(max_length=100)
     cidade = forms.CharField(max_length=100)
     uf = forms.ChoiceField(choices=STATE_CHOICES)
+    pagina_pessoal = forms.CharField(max_length=100)
+
+    telefone = forms.CharField(max_length=100)
+    estudante = forms.BooleanField(required=False)
+
+    first_step = forms.CharField(max_length=1,
+            widget=forms.HiddenInput, initial='1')
+
+
+class InscricaoEstudante(forms.Form):
+    post2 = forms.CharField(max_length=1,
+            widget=forms.HiddenInput, initial='1')
+    estudante = forms.CharField(max_length=1,
+            widget=forms.HiddenInput, initial='1')
+
+    instituicao = forms.CharField(max_length=100)
+    curso = forms.CharField(max_length=100)
+    periodo = forms.CharField(max_length=100)
+
+
+class InscricaoNormal(forms.Form):
+    empresa = forms.CharField(max_length=100)
+    post2 = forms.CharField(max_length=1,
+            widget=forms.HiddenInput, initial='1')
+