File tree Expand file tree Collapse file tree 7 files changed +28
-1
lines changed Expand file tree Collapse file tree 7 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 77
88def artigo (request , slug ):
99 tags = Tag .objects .all ().order_by ("nome" )
10+ artigos = Artigo .objects .all ()
1011 artigo = get_object_or_404 (Artigo , slug = slug )
1112 return render_to_response ('blog/artigo.html' , locals (),
1213 context_instance = RequestContext (request ))
1314
1415def sobre_mim (request ):
1516 tags = Tag .objects .all ().order_by ("nome" )
17+ artigos = Artigo .objects .all ()
1618 return render_to_response ('blog/sobre-mim.html' , locals (),
1719 context_instance = RequestContext (request ))
1820
Original file line number Diff line number Diff line change @@ -185,6 +185,13 @@ div.links {
185185 background-color : # ff3e3e ;
186186}
187187
188+ /* Box Ultimos Posts */
189+
190+ div .ultimos_posts {
191+ background-color : # 769cc1 ;
192+ }
193+
194+
188195/* Topo */
189196
190197div .topo {
Original file line number Diff line number Diff line change 33from django .template import RequestContext
44
55from models import Tag
6+ from blog .models import Artigo
67
78def tag (request , tag_nome ):
89 tags = Tag .objects .all ().order_by ("nome" )
910 tag = get_object_or_404 (Tag , nome = tag_nome )
11+ artigos = Artigo .objects .all ()
1012 return render_to_response (
1113 'tags/tag.html' ,
1214 locals (),
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ <h1 style="display: none;">Blog do Hugo Maia Vieira</h1>
5858 {% include "twitter.html" %}
5959 {% include "categorias.html" %}
6060 {% include "links.html" %}
61+ {% include "ultimos_posts.html" %}
6162 </ div >
6263
6364 </ div >
Original file line number Diff line number Diff line change 1+ < div class ="box ultimos_posts ">
2+ < h3 > Últimos posts</ h3 >
3+ < ul >
4+ {% for artigo in artigos|slice:":10" %}
5+ < li >
6+ < a href ="{{ artigo.get_absolute_url }} " alt ="{{ artigo.titulo }} ">
7+ {{ artigo.titulo }}
8+ </ a >
9+ </ li >
10+ {% endfor %}
11+ </ ul >
12+ </ div >
13+
Original file line number Diff line number Diff line change 1111blog_dict = {
1212 'queryset' : Artigo .objects .all (),
1313 'paginate_by' : 10 ,
14- 'extra_context' : {'tags' : Tag .objects .all ().order_by ("nome" )}
14+ 'extra_context' : {'tags' : Tag .objects .all ().order_by ("nome" ), 'artigos' : Artigo . objects . all () }
1515}
1616
1717urlpatterns = patterns ('' ,
Original file line number Diff line number Diff line change 44from django .core .mail import send_mail
55
66from tags .models import Tag
7+ from blog .models import Artigo
78
89class FormContato (forms .Form ):
910 nome = forms .CharField (max_length = 50 , required = True )
@@ -34,6 +35,7 @@ def enviar(self):
3435
3536def contato (request ):
3637 tags = Tag .objects .all ().order_by ("nome" )
38+ artigos = Artigo .objects .all ()
3739
3840 if request .method == 'POST' :
3941 form = FormContato (request .POST )
You can’t perform that action at this time.
0 commit comments