|
a/Allura/allura/lib/macro.py |
|
b/Allura/allura/lib/macro.py |
|
... |
|
... |
114 |
@macro()
|
114 |
@macro()
|
115 |
def project_blog_posts(max_number=5, sort='timestamp', summary=False, mount_point=None):
|
115 |
def project_blog_posts(max_number=5, sort='timestamp', summary=False, mount_point=None):
|
116 |
from forgeblog import model as BM
|
116 |
from forgeblog import model as BM
|
117 |
app_config_ids = []
|
117 |
app_config_ids = []
|
118 |
for conf in c.project.app_configs:
|
118 |
for conf in c.project.app_configs:
|
119 |
if conf.tool_name == 'blog' and (mount_point is None or conf.options.mount_point==mount_point):
|
119 |
if conf.tool_name.lower() == 'blog' and (mount_point is None or conf.options.mount_point==mount_point):
|
120 |
app_config_ids.append(conf._id)
|
120 |
app_config_ids.append(conf._id)
|
121 |
posts = BM.BlogPost.query.find({'state':'published','app_config_id':{'$in':app_config_ids}})
|
121 |
posts = BM.BlogPost.query.find({'state':'published','app_config_id':{'$in':app_config_ids}})
|
122 |
posts = posts.sort(sort, pymongo.DESCENDING).limit(int(max_number)).all()
|
122 |
posts = posts.sort(sort, pymongo.DESCENDING).limit(int(max_number)).all()
|
123 |
output = '\n'.join(
|
123 |
output = '\n'.join(
|
124 |
template_neighborhood_blog_posts.substitute(dict(
|
124 |
template_neighborhood_blog_posts.substitute(dict(
|