Added grade URL so admin can access information about schedule
authorThadeu Lima de Souza Cascardo <cascardo@vespa.holoscopio.com>
Tue, 9 Oct 2007 20:01:01 +0000 (17:01 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@vespa.holoscopio.com>
Tue, 9 Oct 2007 20:01:01 +0000 (17:01 -0300)
Schedule information on event accessible only to admin temporarily
untill all is confirmed and open to the public.

templates/grade.html [new file with mode: 0644]
urls.py
views.py

diff --git a/templates/grade.html b/templates/grade.html
new file mode 100644 (file)
index 0000000..0cf74a4
--- /dev/null
@@ -0,0 +1,36 @@
+{% extends "base.html" %}
+{% block content %}
+
+{% if aprovadas %}
+
+<!--<h2>{{ dados_usuario.nome }}</h2>-->
+    {% for p in aprovadas %}
+    {% ifchanged p.dia %}
+      <h3>
+        {{ p.dia|date:"l, d \de F" }}
+      </h3>
+      <br /><br />
+    {% endifchanged %}
+    <span style="font-size:12pt"><a href="/palestra/{{p.id}}/" style="color:#333;">{{p.titulo}}</a></span>
+        <br />
+        <span style="font-weight:bolder;margin-left:15px">Palestrante{{ p.palestrante.all|pluralize }}:</span>
+        <br />
+            {% for x in p.palestrante.all %}
+        <span style="margin-left:30px">
+            <a href="/palestrante/{{x.id}}/">{{x.nome|capfirst}} </a>{% ifnotequal p.palestrante.all|length 1%}<br /> {% endifnotequal %}
+        </span>
+            {% endfor %}
+        <br />
+    {% endfor %}
+{% else %}
+<div id="404" style="text-align:center">
+    <h2>Padre Quevedo 404</h2>
+    <br />
+    <div style="color:#FF0000;">
+        Usuario nón ecziste!
+    </div>
+</div>
+{% endif %}
+
+<a href="javascript:;" onclick="history.back ();">Voltar</a>
+{% endblock %}
diff --git a/urls.py b/urls.py
index 988dcbe..82cfefb 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -41,6 +41,7 @@ urlpatterns = patterns('',
     (r'^palestrante/(?P<codigo>\d+)', views.dados_palestrante),
     (r'^palestra/(?P<codigo>\d+)', views.dados_palestra),
     (r'^programacao', views.programacao),
     (r'^palestrante/(?P<codigo>\d+)', views.dados_palestrante),
     (r'^palestra/(?P<codigo>\d+)', views.dados_palestra),
     (r'^programacao', views.programacao),
+    (r'^grade', views.grade),
     (r'^meus_dados/', views.meus_dados),
     (r'^chamada_trabalhos/', views.chamada_trabalhos),
     (r'^avaliacao/', views.avaliacao),
     (r'^meus_dados/', views.meus_dados),
     (r'^chamada_trabalhos/', views.chamada_trabalhos),
     (r'^avaliacao/', views.avaliacao),
index ca3443a..3850ff9 100644 (file)
--- a/views.py
+++ b/views.py
@@ -22,6 +22,7 @@ from django.template import RequestContext, Context, loader
 from django.contrib.auth.decorators import login_required, user_passes_test
 from django.contrib.auth.models import Group, User
 from django.contrib.auth import authenticate, login
 from django.contrib.auth.decorators import login_required, user_passes_test
 from django.contrib.auth.models import Group, User
 from django.contrib.auth import authenticate, login
+from django.contrib.admin.views.decorators import staff_member_required
 from django.newforms import form_for_instance
 from django.core.exceptions import ObjectDoesNotExist
 from django.core.mail import EmailMessage
 from django.newforms import form_for_instance
 from django.core.exceptions import ObjectDoesNotExist
 from django.core.mail import EmailMessage
@@ -425,6 +426,14 @@ def programacao(request):
         d = {}
     return build_response(request, 'programacao.html',d)
 
         d = {}
     return build_response(request, 'programacao.html',d)
 
+@enable_login_form
+@staff_member_required
+def grade(request):
+    try:
+               d = {'aprovadas': Trabalho.objects.filter(aprovado=True).order_by('dia', 'time_start')}
+       except ObjectDoesNotExist:
+               d = {}
+       return build_response(request, 'grade.html', d)
 
 @enable_login_form
 def chamada_trabalhos(request):
 
 @enable_login_form
 def chamada_trabalhos(request):