8573791c3da5f674b59eec2d0e80638184ce37e0
[cascardo/eventmanager.git] / views.py
1 """
2 Copyright (C) 2007 Lincoln de Sousa <lincoln@archlinux-br.org>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18 """
19 from django.shortcuts import render_to_response
20 from django.template import RequestContext, Context
21 from eventmanager.decorators import enable_login_form
22 from eventmanager.forms import InscreverPalestra, CadastroPalestrante
23 from eventmanager.conteudo.models import Noticia
24
25 @enable_login_form
26 def index(request):
27     news = Noticia.objects.order_by('-data_criacao')
28     c = Context({'news': news})
29     return render_to_response('index.html', c,
30             context_instance=RequestContext(request))
31
32 @enable_login_form
33 def cadastro(request):
34     form = CadastroPalestrante()
35     c = Context({'form': form})
36     return render_to_response('cadastro.html', c,
37             context_instance=RequestContext(request))
38
39 def inscrever_palestra(request):
40     form = InscreverPalestra()
41     c = Context({'form': form})
42     return render_to_response('inscrever_palestra.html', c,
43             context_instance=RequestContext(request))