fazendo sistema de seções funcionar e melhorando o layout do sistema de menus
authorLincoln de Sousa <pythonwarrior@pidinti.localdomain>
Thu, 9 Aug 2007 13:42:32 +0000 (10:42 -0300)
committerLincoln de Sousa <pythonwarrior@pidinti.localdomain>
Thu, 9 Aug 2007 13:42:32 +0000 (10:42 -0300)
conteudo/views.py
media/css/geral.css
templates/secao.html [new file with mode: 0644]
urls.py

index d7767a1..128c646 100644 (file)
@@ -1,9 +1,18 @@
 from django.shortcuts import render_to_response
 from django.template import RequestContext, Context
-from eventmanager.conteudo.models import Noticia
+from eventmanager.conteudo.models import Noticia, Secao, Menu
 
 def noticia(request, nid):
     n = Noticia.objects.get(pk=int(nid))
-    c = Context({'noticia': n})
+    m = Menu.objects.all()
+    c = Context({'noticia': n, 'menu': m})
     return render_to_response('noticia.html', c,
             context_instance=RequestContext(request))
+
+
+def secao(request, sid):
+    s = Secao.objects.get(pk=int(sid))
+    m = Menu.objects.all()
+    c = Context({'secao': s, 'menu': m})
+    return render_to_response('secao.html', c,
+            context_instance=RequestContext(request))
index 4a89e46..f2414a7 100644 (file)
@@ -67,6 +67,15 @@ em {
 }
 
 #menu {
+    list-style-type: none;
+    list-style-image: none;
+    padding: 0px;
+    margin-top: 180px;
+    margin-left: 200px;
+}
+
+#menu li {
+    display: inline;
 }
 
 #content {
diff --git a/templates/secao.html b/templates/secao.html
new file mode 100644 (file)
index 0000000..1b41176
--- /dev/null
@@ -0,0 +1,12 @@
+{% extends "base.html" %}
+{% block content %}
+
+<h2>{{ secao.titulo }}</h2>
+<!--em>{{ secao.data_criacao }} (por {{ secao.autor }})</em-->
+
+<p>{{ secao.chamada }}</p>
+<p>{{ secao.corpo }}</p>
+
+<a href="javascript:;" onclick="history.back ();">Voltar</a>
+
+{% endblock %}
diff --git a/urls.py b/urls.py
index 8780f22..8fe1e45 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -24,6 +24,7 @@ import os
 
 urlpatterns = patterns('',
     (r'^noticias/(\d+)/$', conteudo_views.noticia),
+    (r'^secao/(\d+)/$', conteudo_views.secao),
     (r'^admin/', include('django.contrib.admin.urls')),
     (r'^logout/', 'django.contrib.auth.views.logout',
         {'next_page': '/'}),