mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- 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:
@@ -14,26 +14,29 @@
|
|||||||
|
|
||||||
<#--
|
<#--
|
||||||
|
|
||||||
This template renders a comment.
|
This template renders a comment.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
<#macro commentJSON item>
|
<#macro commentJSON item>
|
||||||
<#escape x as jsonUtils.encodeJSONString(x)>
|
<#escape x as jsonUtils.encodeJSONString(x)>
|
||||||
{
|
{
|
||||||
"url" : "api/comment/node/${item.node.nodeRef?replace('://','/')}",
|
"url" : "api/comment/node/${item.node.nodeRef?replace('://','/')}",
|
||||||
"nodeRef" : "${item.node.nodeRef}",
|
"nodeRef" : "${item.node.nodeRef}",
|
||||||
"name" : "${item.node.properties.name!''}",
|
"name" : "${item.node.properties.name!''}",
|
||||||
"title" : "${item.node.properties.title!''}",
|
"title" : "${item.node.properties.title!''}",
|
||||||
"content" : "${stringUtils.stripUnsafeHTML(item.node.content)}",
|
"content" : "${stringUtils.stripUnsafeHTML(item.node.content)}",
|
||||||
<#if item.author??>
|
<#if item.author??>
|
||||||
<@renderPerson person=item.author fieldName="author" />
|
<@renderPerson person=item.author fieldName="author" />
|
||||||
<#else>
|
<#else>
|
||||||
"author" : { "username" : "${item.node.properties.creator}" },
|
"author" : { "username" : "${item.node.properties.creator}" },
|
||||||
</#if>
|
</#if>
|
||||||
"createdOn" : "${item.node.properties.created?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
"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')'")}",
|
"modifiedOn" : "${item.node.properties.modified?string("MMM dd yyyy HH:mm:ss 'GMT'Z '('zzz')'")}",
|
||||||
"isUpdated" : ${item.isUpdated?string},
|
"isUpdated" : ${item.isUpdated?string},
|
||||||
"permissions" : {"edit" : true, "delete" : true}
|
"permissions" : {
|
||||||
|
"edit" : ${item.node.hasPermission("Write")?string},
|
||||||
|
"delete" : ${item.node.hasPermission("Delete")?string}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</#escape>
|
</#escape>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
@@ -26,6 +26,7 @@ function main()
|
|||||||
var count = args["pageSize"] != undefined ? parseInt(args["pageSize"]) : 10;
|
var count = args["pageSize"] != undefined ? parseInt(args["pageSize"]) : 10;
|
||||||
|
|
||||||
model.data = getCommentsList(node, index, count);
|
model.data = getCommentsList(node, index, count);
|
||||||
|
model.node = node;
|
||||||
}
|
}
|
||||||
|
|
||||||
main();
|
main();
|
||||||
|
@@ -1,6 +1,11 @@
|
|||||||
<#import "comment.lib.ftl" as commentLib/>
|
<#import "comment.lib.ftl" as commentLib/>
|
||||||
<#import "../generic-paged-results.lib.ftl" as gen/>
|
<#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>
|
<@gen.pagedResults data=data ; item>
|
||||||
<@commentLib.commentJSON item=item />
|
<@commentLib.commentJSON item=item />
|
||||||
</@gen.pagedResults>
|
</@gen.pagedResults>
|
||||||
|
Reference in New Issue
Block a user