Add dyn:category_name
This commit is contained in:
parent
eb283280f1
commit
0b347c2f16
|
@ -50,6 +50,7 @@ class Index(DynastieGenerator):
|
||||||
'first_page_only' : self.createFirstPageOnly,
|
'first_page_only' : self.createFirstPageOnly,
|
||||||
'ljdc_last' : self.createLJDCLast,
|
'ljdc_last' : self.createLJDCLast,
|
||||||
'comments_count' : self.createCommentsCount,
|
'comments_count' : self.createCommentsCount,
|
||||||
|
'category_name' : self.createCategoryName,
|
||||||
}
|
}
|
||||||
|
|
||||||
self.first_try = True
|
self.first_try = True
|
||||||
|
@ -86,6 +87,14 @@ class Index(DynastieGenerator):
|
||||||
count = Comment.objects.filter(post=self.cur_post_obj.id).count()
|
count = Comment.objects.filter(post=self.cur_post_obj.id).count()
|
||||||
self.replaceByText(dom, root, node, str(count))
|
self.replaceByText(dom, root, node, str(count))
|
||||||
|
|
||||||
|
def createCategoryName(self, posts, dom, root, node):
|
||||||
|
from dynastie.models import Category
|
||||||
|
if self.cur_post_obj is None:
|
||||||
|
category = ''
|
||||||
|
else:
|
||||||
|
category = Category.objects.filter(id=self.cur_post_obj.category.id)[0].name
|
||||||
|
self.replaceByText(dom, root, node, category)
|
||||||
|
|
||||||
def createNavigation(self, posts, dom, root, node):
|
def createNavigation(self, posts, dom, root, node):
|
||||||
if self.nb_pages == 0 or self.nb_pages == 1:
|
if self.nb_pages == 0 or self.nb_pages == 1:
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<dyn:year>
|
<dyn:year>
|
||||||
<dyn:month>
|
<dyn:month>
|
||||||
<dyn:posts>
|
<dyn:posts>
|
||||||
<dyn:title link="1"/>
|
[<dyn:category_name/>] <dyn:title link="1"/>
|
||||||
</dyn:posts>
|
</dyn:posts>
|
||||||
</dyn:month>
|
</dyn:month>
|
||||||
</dyn:year>
|
</dyn:year>
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<ljdc>
|
<ljdc>
|
||||||
|
<entry>
|
||||||
|
<id>86876038790</id>
|
||||||
|
<address>http://lesjoiesducode.fr/post/86876038790/quand-je-corrige-sans-probleme-une-serie-de-bugs</address>
|
||||||
|
<title>quand je corrige sans problème une série de bugs mineurs</title>
|
||||||
|
<img>http://ljdchost.com/H3lqXrR.gif</img>
|
||||||
|
</entry>
|
||||||
|
<entry>
|
||||||
|
<id>86598933572</id>
|
||||||
|
<address>http://lesjoiesducode.fr/post/86598933572/vendredi-17h</address>
|
||||||
|
<title>vendredi, 17h</title>
|
||||||
|
<img>http://ljdchost.com/KtEbpO4.gif</img>
|
||||||
|
</entry>
|
||||||
<entry>
|
<entry>
|
||||||
<id>87886854819</id>
|
<id>87886854819</id>
|
||||||
<address>http://thecodinglove.com/post/87886854819/when-my-app-comes-back-from-qa-without-any-bugs</address>
|
<address>http://thecodinglove.com/post/87886854819/when-my-app-comes-back-from-qa-without-any-bugs</address>
|
||||||
|
|
|
@ -606,3 +606,8 @@ div.all_posts div.post
|
||||||
{
|
{
|
||||||
padding-right:20px;
|
padding-right:20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.year .title
|
||||||
|
{
|
||||||
|
display:inline;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user