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,
|
||||
'ljdc_last' : self.createLJDCLast,
|
||||
'comments_count' : self.createCommentsCount,
|
||||
'category_name' : self.createCategoryName,
|
||||
}
|
||||
|
||||
self.first_try = True
|
||||
|
@ -86,6 +87,14 @@ class Index(DynastieGenerator):
|
|||
count = Comment.objects.filter(post=self.cur_post_obj.id).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):
|
||||
if self.nb_pages == 0 or self.nb_pages == 1:
|
||||
return None
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<dyn:year>
|
||||
<dyn:month>
|
||||
<dyn:posts>
|
||||
<dyn:title link="1"/>
|
||||
[<dyn:category_name/>] <dyn:title link="1"/>
|
||||
</dyn:posts>
|
||||
</dyn:month>
|
||||
</dyn:year>
|
||||
|
|
|
@ -1,5 +1,17 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<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>
|
||||
<id>87886854819</id>
|
||||
<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;
|
||||
}
|
||||
|
||||
.year .title
|
||||
{
|
||||
display:inline;
|
||||
}
|
Loading…
Reference in New Issue
Block a user