<#-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <#import "BlogLib.ftl" as blog/>

{${uiLabelMap.EcommerceFromSite}


<@blog.renderAncestryPath trail=ancestorList?default([]) endIndexOffset=1 /> <#-- Do this so that we don't have to find the content twice (again in renderSubContent) --> <#assign lastNode = globalNodeTrail!?last/> <#if lastNode?has_content> <#assign subContent=lastNode.value/> <#else> <#assign subContent = delegator.findOne("Content", Static["org.apache.ofbiz.base.util.UtilMisc"] .toMap("contentId", subContentId), true)/> <#assign dummy = globalNodeTrail.add(lastNode)/>

${uiLabelMap.EcommerceContentFor} [${subContentId}] ${subContent.contentName!} - ${subContent.description!}:


<#assign thisContentId=subContentId!> <#if !thisContentId?has_content> <#assign thisContentId=contentId!>
  <@renderSubContentCache subContentId=thisContentId /> <@checkPermission subContentId=subContentId targetOperation="HAS_USER_ROLE" contentPurposeList="RESPONSE" > ${uiLabelMap.EcommerceRespond}

<#-- <@checkPermission mode="not-equals" subContentId=subContentId targetOperation="CONTENT_CREATE|CONTENT_RESPOND" contentPurposeList="RESPONSE" > ${permissionErrorMsg!} -->

${uiLabelMap.EcommerceResponses}


<@loopSubContent contentAssocTypeId="RESPONSE" contentId=subContentId mapKey="" pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\") && mapKey == null" followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")"> <@traverseSubContentCache contentAssocTypeId="RESPONSE" pickWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"RESPONSE\")" wrapTemplateId=""> <#assign indentStr=indent?default("0")/> <#assign indent=indentStr?number/> <#if 1 < indent > <#assign fillRange=1..indent/> <#assign indentFill=""/> <#list fillRange as i> <#assign indentFill = indentFill + "    " /> <#assign thisContentId = ""/> <#if nodeTrailCsv??> <#assign idList = nodeTrailCsv?split(",")/> <#if 0 < idList?size > <#assign thisContentId = idList?last> <#if content??> <#-- <@wrapSubContentCache subContentId=subContentId wrapTemplateId="WRAP_NEXT_PREV" > -->
${indentFill} ${uiLabelMap.CommonView} ${content.contentId!}-${content.description!}
<#-- not used, will be deleted --> <#macro getCurrentContent > <#assign globalNodeTrail=globalNodeTrail/> <#if globalNodeTrail??> <#assign currentNode=globalNodeTrail?last/> <#if currentNode??> <#assign currentValue=currentNode.value/> <#if currentValue??> <@wrapSubContentCache subContentId=currentValue.contentId wrapTemplateId="WRAP_ARTICLE" > <@traverseSubContentCache contentAssocTypeId="SUB_CONTENT" pickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" returnAfterPickWhen="mapKey != null && mapKey.equals(\"ARTICLE\")" followWhen="contentAssocTypeId != null && contentAssocTypeId.equals(\"_never_\")" wrapTemplateId=""> <#assign description=currentValue.description?default("No description")/> ${uiLabelMap.CommonDescription}[${currentValue.contentId!}]:${description} ${uiLabelMap.CommonView} <#macro renderSiteAncestryPath trail startIndex=0 > <#assign indent = ""> <#assign csv = ""> <#assign counter = 0> <#assign len = trail?size> <#list trail as webSitePublishPoint> <#if counter < len && startIndex <= counter > <#assign counter = counter + 1> <#if 20 < counter > <#break/>
${indent} ${uiLabelMap.CommonBackTo}  ${webSitePublishPoint.templateTitle!} <#assign indent = indent + "    "> [${webSitePublishPoint.contentId!}]