Section | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Section | ||||||
---|---|---|---|---|---|---|
| ||||||
Wiki Markup | ||||||
{jython}
from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
search = ContentSearch(LabelQuery("devel"),None,None,None)
results = searchManager.searchEntities(search)
out.print("<div class='results-container'><ul>")
for i in results:
out.print("<li class='update-item'><a href='/wiki%s'>%s</a> <div class='update-item-desc'>%s</div></li>" % (i.urlPath,i.displayTitle,i.content))
out.print("</ul></div>")
{jython}
{section}
{column:width=50%}
{jython}
from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
from com.atlassian.confluence.security import Permission
query = LabelQuery("releases")
search = ContentSearch(query,None,None,None)
results = searchManager.searchEntities(search)
alist = []
for i in results:
for a in i.attachments:
alist.append((a.lastModificationDate, a))
alist.sort()
alist.reverse()
out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>Latest Releases</h4><div class='results-container'><ul>")
for d,i in alist:
out.print("""
<li class='update-item'>
<div class='icon-container'><a href=\"/wiki%s\">%s (%s)</a></div>
<div class='update-item-desc'>from <a href='/wiki/display/%s'>%s</a></div>
<div class='update-item-date'>%s (%s)</div>
</li>""" % (i.downloadPathWithoutVersion, i.fileName, i.niceFileSize, i.space.key, i.space.name, d, permissionManager.hasPermission(request.userPrincipal,Permission.VIEW,i)))
out.print("</ul></div></div>")
{jython}
{column}
{column:width=50%}
{jython}
from com.atlassian.confluence.search.v2 import ContentSearch
from com.atlassian.confluence.search.v2.query import LabelQuery
query = LabelQuery("news")
search = ContentSearch(query,None,None,None)
results = searchManager.search(search)
out.print("<div class='recently-updated recently-updated-concise'><h4 class='sub-heading'>Latest News</h4><div class='results-container'><ul>")
for i in results:
out.print("""
<li class='update-item'>
<div class='icon-container'><a href=\"/wiki%s\">%s</a></div>
<div class='update-item-desc'>from <a href='/wiki/display/%s'>%s</a></div>
<div class='update-item-date'>%s</div>
</li>""" % (i.urlPath,i.displayTitle, i.spaceKey,i.spaceName,i.lastModificationDate))
out.print("</ul></div></div>")
{jython}
{recently-updated:max=5}
{column}
{section}
---- |