adicionando template de email de confirmacão para o cadastro de palestrantes.
[cascardo/eventmanager.git] / forms.py
index cf89425..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')
@@ -64,11 +66,11 @@ class CadastroPalestrante(forms.Form):
 
     instituicao = forms.CharField(max_length=100, label='Instituição')
     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=1000, label='Currículo',
-       help_text='Este currículo será utilizado para avaliação do palestrante.'
-                 'Máximo de 1000 caracteres.')
+       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)
@@ -87,9 +89,9 @@ class EditarPalestrante(forms.Form):
     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=1000, label='Currículo',
+    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 1000 caracteres.')
+                 '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)
@@ -114,4 +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')