- removed highlight for blog/discussions/comments in case no actions are available

- some ui improvements for blog/discussions lists
- comment components now check for permissions

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10540 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Michael Ru
2008-08-27 16:00:21 +00:00
parent 8b71ac4400
commit b7a8c5fac8
3 changed files with 18 additions and 9 deletions

View File

@@ -14,26 +14,29 @@
<#--
This template renders a comment.
This template renders a comment.
-->
<#macro commentJSON item>
<#escape x as jsonUtils.encodeJSONString(x)>
{
"url" : "api/comment/node/${item.node.nodeRef?replace('://','/')}",
"nodeRef" : "${item.node.nodeRef}",
"name" : "${item.node.properties.name!''}",
"url" : "api/comment/node/${item.node.nodeRef?replace('://','/')}",
"nodeRef" : "${item.node.nodeRef}",
"name" : "${item.node.properties.name!''}",
"title" : "${item.node.properties.title!''}",
"content" : "${stringUtils.stripUnsafeHTML(item.node.content)}",
"content" : "${stringUtils.stripUnsafeHTML(item.node.content)}",
<#if item.author??>
<@renderPerson person=item.author fieldName="author" />
<#else>
"author" : { "username" : "${item.node.properties.creator}" },
</#if>
"createdOn" : "${item.node.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
"modifiedOn" : "${item.node.properties.modified?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
"isUpdated" : ${item.isUpdated?string},
"permissions" : {"edit" : true, "delete" : true}
"createdOn" : "${item.node.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
"modifiedOn" : "${item.node.properties.modified?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
"isUpdated" : ${item.isUpdated?string},
"permissions" : {
"edit" : ${item.node.hasPermission("Write")?string},
"delete" : ${item.node.hasPermission("Delete")?string}
}
}
</#escape>
</#macro>

View File

@@ -26,6 +26,7 @@ function main()
var count = args["pageSize"] != undefined ? parseInt(args["pageSize"]) : 10;
model.data = getCommentsList(node, index, count);
model.node = node;
}
main();

View File

@@ -1,6 +1,11 @@
<#import "comment.lib.ftl" as commentLib/>
<#import "../generic-paged-results.lib.ftl" as gen/>
{
"nodePermissions" : {
"create" : ${node.hasPermission("CreateChildren")?string},
"edit" : ${node.hasPermission("Write")?string},
"delete" : ${node.hasPermission("Delete")?string}
},
<@gen.pagedResults data=data ; item>
<@commentLib.commentJSON item=item />
</@gen.pagedResults>