nome_contato = models.CharField('Nome do contato', maxlength=100)
telefone = models.CharField(maxlength=100)
cidade = models.CharField(maxlength=100)
- estado = models.CharField(maxlength=100) # TODO: can became a combobox
+ uf = models.CharField(maxlength=100) # TODO: should became a combobox
rua = models.CharField(maxlength=100)
numero = models.CharField('Número', maxlength=10)
info_adicional = models.TextField()
fields = (
(None, {'fields': ('nome', 'data_inicio', 'data_final')}),
('Informações da sede', {'fields': ('nome_local', 'nome_contato',
- 'cidade', 'estado', 'rua', 'numero', 'info_adicional')}),
+ 'cidade', 'uf', 'rua', 'numero', 'info_adicional')}),
)
def __str__(self):
return self.nome
+class Participante(models.Model):
+ nome = models.CharField(maxlength=100)
+
+ class Admin:
+ pass
+
+ def __str__(self):
+ return self.nome
+
+
class CategoriaPalestra(models.Model):
nome = models.CharField(maxlength=100)
Boston, MA 02111-1307, USA.
"""
from django import newforms as forms
+from django.newforms.widgets import Textarea
class InscreverPalestra(forms.Form):
pass
+
+class CadastroPalestrante(forms.Form):
+ nome = forms.CharField(max_length=100)
+ email = forms.CharField(max_length=100)
+
+ telefone_comercial = forms.CharField(max_length=11)
+ telefone_residencial = forms.CharField(max_length=11)
+ telefone_celular = forms.CharField(max_length=11)
+
+ instituicao = forms.CharField(max_length=100)
+ minicurriculo = forms.CharField(widget=Textarea())
+
+ rua = forms.CharField(max_length=100)
+ numero = forms.CharField(max_length=10)
+ bairro = forms.CharField(max_length=100)
+ cidade = forms.CharField(max_length=100)
+ uf = forms.CharField(max_length=100)
+
+ areas_interesse = forms.MultipleChoiceField()
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pt_BR" lang="pt_BR">
<head>
<title>Encontro Mineiro de Software Livre</title>
+
+ <style type="text/css">
+ body {
+ margin: 10px;
+ background-color: #fff;
+ }
+
+ h1.title {
+ color: #f00;
+ }
+
+ label {
+ display: block;
+ width: 180px;
+ font-weight: bold;
+ }
+
+ #login-form {
+ position: absolute;
+ right: 10px;
+ background-color: #f7f7f7;
+ padding: 10px;
+ }
+
+ #login-form label {
+ width: 80px !important;
+ float: left;
+ }
+
+ #login-form input[type=text] {
+ width: 100px;
+ }
+
+ #login-form input[type=password] {
+ width: 40px;
+ }
+ </style>
</head>
<body>
- <h1>Encontro Mineiro de Software Livre</h1>
+ <h1 class="title">Encontro Mineiro de Software Livre</h1>
{% if user.is_authenticated %}
<form id="login-form" method="post" action=".">
<h3>Login</h3>
<div class="field">
- <label for="id_username">{% trans "Username" %}</label>
+ <label for="id_username">Usuário:</label>
<input id="id_username" class="vTextField required" type="text"
- maxlength="30" name="username" style="width: 85px" />
+ maxlength="30" name="username" />
</div>
<div class="field">
- <label for="id_password-login">{% trans "Password" %}</label>
+ <label for="id_password-login">Senha:</label>
<input id="id_password-login" class="vTextField required"
- type="password" name="password" style="width: 45px;" />
+ type="password" name="password" />
<input type="submit" value="Login" class="submit" name="submitting_login_form" />
</div>
+
+ <a href="/cadastro">Cadastre-se</a>
</form>
{% endif %}
- {% block content %}
- {% endblock %}
+ <div id="conteudo">
+ {% block content %}{% endblock %}
+ </div>
</body>
</html>
+{# vim: set ft=htmldjango: #}
{% extends "base.html" %}
{% block content %}
-teste
+Openarena R0X
{% endblock %}
(r'^logout/', 'django.contrib.auth.views.logout',
{'next_page': '/'}),
(r'^inscrever_palestra/', views.inscrever_palestra),
+ (r'^cadastro/', views.cadastro),
(r'^$', views.index),
)
Boston, MA 02111-1307, USA.
"""
from django.shortcuts import render_to_response
-from django.template import RequestContext
+from django.template import RequestContext, Context
from eventmanager.decorators import enable_login_form
+from eventmanager.forms import InscreverPalestra, CadastroPalestrante
@enable_login_form
def index(request):
return render_to_response('index.html',
context_instance=RequestContext(request))
+@enable_login_form
+def cadastro(request):
+ form = CadastroPalestrante()
+ c = Context({'form': form})
+ return render_to_response('cadastro.html', c,
+ context_instance=RequestContext(request))
def inscrever_palestra(request):
- form = forms.InscreverPalestra()
- return render_to_response('inscrever_palestra.html',
+ form = InscreverPalestra()
+ c = Context({'form': form})
+ return render_to_response('inscrever_palestra.html', c,
context_instance=RequestContext(request))