<#assign manageCommentsUrl='jsp/admin/plugins/extend/modules/comment/ManageComments.jsp' /> <#macro operationButton idComment operation title icon color='primary' size=''> <@aButton color=color size=size href='${manageCommentsUrl}?view=confirmUpdateComment&idComment=${idComment}&operation=${operation}&viewAllResources=${allResources?c}${fromUrlParam}' title=title hideTitle=['all'] buttonIcon=icon /> <#assign fromUrlParam><#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url} <#assign addCommentHref>${manageCommentsUrl}?view=createComment&idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}${fromUrlParam} <@div class='d-flex justify-content-end gap-2 mb-3'> <@button type='button' title='#i18n{module.extend.comment.comment_info.labelSearch}' buttonIcon='filter' color='light' params='data-bs-toggle="modal" data-bs-target="#comment-filter-modal"' /> <@aButton href=addCommentHref title='#i18n{module.extend.comment.comment.labelAddComment}' buttonIcon='plus' /> <@modal id='comment-filter-modal'> <@modalHeader modalTitle='#i18n{module.extend.comment.comment_info.labelSearch}' /> <@modalBody> <@tform action='jsp/admin/plugins/extend/ViewExtenderInfo.jsp'> <@input type='hidden' name='idExtendableResource' value='${idExtendableResource}' /> <@input type='hidden' name='extendableResourceType' value='${extendableResourceType}' /> <@input type='hidden' name='extenderType' value='comment' /> <#if from_url?? && from_url?has_content && from_url != "null"><@input type='hidden' name='from_url' value='${from_url}' /> <@formGroup labelKey='#i18n{module.extend.comment.comment_info.pinned}' labelFor='filterPinned' rows=2> <@select name='filterPinned' default_value="${filterPinned!''}" items=listPinnedFilter /> <@formGroup labelKey='#i18n{module.extend.comment.comment_info.important}' labelFor='filterMarkAsImportant' rows=2> <@select name='filterMarkAsImportant' default_value="${filterMarkAsImportant!''}" items=listMarkAsImportantFilter /> <@formGroup labelKey='#i18n{module.extend.comment.comment_info.labelPublished}' labelFor='filterState' rows=2> <@select name='filterState' default_value="${filterState!''}" items=listCommentStates /> <@formGroup labelKey='#i18n{module.extend.comment.comment_info.labelSort}' labelFor='sorted_attribute_name' rows=2> <@select name='sorted_attribute_name'> <@option label='#i18n{module.extend.comment.comment_info.sortByDateModification}' value='date_last_modif' selected=(sorted_attribute_name?? && sorted_attribute_name == "date_last_modif") /> <@option label='#i18n{module.extend.comment.comment_info.sortByDateCreation}' value='date_comment' selected=(sorted_attribute_name?? && sorted_attribute_name == "date_comment") /> <@formGroup labelKey='#i18n{module.extend.comment.comment_info.labelSortOrder}' labelFor='asc_sort' rows=2> <@select name='asc_sort'> <@option label='#i18n{portal.util.sort.asc}' value='true' selected=(asc_sort?? && asc_sort) /> <@option label='#i18n{portal.util.sort.desc}' value='false' selected=(asc_sort?? && !asc_sort) /> <@formGroup rows=2> <@button type='submit' color='primary' title='#i18n{module.extend.comment.comment_info.labelSearch}' buttonIcon='filter' /> <#if listComments?? && listComments?has_content> <@manageFeature listClass='d-flex flex-column gap-3'> <#list listComments as comment> <#assign itemClass = comment.pinned?then('order-first', '')> <#assign commentIcon><#if comment.pinned>pin<#elseif comment.isImportant>exclamation-mark<#else>message <#assign commentIconBg><#if !comment.published> bg-danger<#elseif comment.isImportant> bg-warning<#elseif comment.pinned>bg-info<#else> bg-primary <#assign commentLabel> <#assign adminClass><#if !comment.isAdminComment> comment <@div class="d-flex justify-content-between align-items-center ${adminClass}"> <@div class='fw-bold'> <@span class='badge ${commentIconBg} text-white me-2'><@icon style=commentIcon /><@icon style='user' /> ${comment.name!} <@div> <#if 0 < comment.firstUnpublishedSubComment> <@tag color='warning' title='#i18n{module.extend.comment.comment_info.unpublishedSubComments}' tagIcon='alert-triangle'>#i18n{module.extend.comment.comment_info.unpublishedSubComments} <#if comment.published><@tag color='success' tagIcon='eye' title='#i18n{module.extend.comment.comment_info.labelPublished}' /><#else><@tag color='danger' tagIcon='eye-off' title='#i18n{module.extend.comment.comment_info.labelUnpublished}' /> <@span class='dt-comment'>${comment.dateComment!?string["dd/MM/yyyy HH:mm"]} ${comment.email!} <#assign actions> <@div class='d-flex flex-wrap gap-1'> <#assign deleteHref>${manageCommentsUrl}?view=confirmRemoveComment&idComment=${comment.idComment!}&viewAllResources=${allResources?c}${fromUrlParam} <@aButton color='danger' href=deleteHref title='#i18n{portal.util.labelDelete}' hideTitle=['all'] buttonIcon='trash' /> <#if comment.published> <@operationButton idComment=comment.idComment operation='unpublish' color='danger' title='#i18n{module.extend.comment.comment_info.buttonUnpublish}' icon='toggle-right' /> <#else> <@operationButton idComment=comment.idComment operation='publish' title='#i18n{module.extend.comment.comment_info.buttonPublish}' icon='toggle-left' /> <#if allowSubComments> <#assign answerHref>${manageCommentsUrl}?view=createComment&idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}&viewAllResources=${allResources?c}${fromUrlParam} <@aButton href=answerHref title='#i18n{module.extend.comment.comment_info.labelAnswer}' hideTitle=['all'] buttonIcon='message-reply' /> <#if comment.isImportant> <@operationButton idComment=comment.idComment operation='cancelFlagImportant' color='danger' title='#i18n{module.extend.comment.comment_info.labelCancelFlagImportant}' icon='thumb-down' /> <#else> <@operationButton idComment=comment.idComment operation='flagImportant' title='#i18n{module.extend.comment.comment_info.labelDoFlagImportant}' icon='thumb-up' /> <#if comment.pinned> <@operationButton idComment=comment.idComment operation='cancelPin' color='danger' title='#i18n{module.extend.comment.comment_info.labelCancelPinned}' icon='pinned-off' /> <#else> <@operationButton idComment=comment.idComment operation='pin' title='#i18n{module.extend.comment.comment_info.labelDoPinned}' icon='pin' /> @Extender[${comment.idComment},Comment,rating,{show:"button"}]@ <#if comment.listWorkflowActions?? && comment.listWorkflowActions?size gt 0> <#list comment.listWorkflowActions as action> <#assign iconStyle><#if action.icon.width!=-1> width="${action.icon.width}" <#if action.icon.height!=-1> height="${action.icon.height}" <@aButton color='link' href='${manageCommentsUrl}?view=confirmUpdateComment&idComment=${comment.idComment}&id_action=${action.id}&viewAllResources=${allResources?c}${fromUrlParam}' title='${action.name}' hideTitle=['all']> <@img url='image?resource_type=workflow_icon_img&id=${action.icon.id}' title='${action.name}' alt='${action.name}' params=iconStyle /> <@span class='ms-2'>${action.name} <@manageFeatureItem liClass=itemClass> <@manageFeatureItemColumn flex=false> ${commentLabel} <@row class='mb-3'>
<#if use_bbcode>${comment.BBCodeComment!}<#else>${comment.comment!}
<@row class='mb-3 py-2 border-bottom'> ${actions} <#if comment.listSubComments?? && 0 < comment.listSubComments?size> <#list comment.listSubComments as subComment> <@div class='border-start border-3 ps-3 mt-3'> <#assign subCommentIcon><#if subComment.pinned>pin<#elseif subComment.isImportant>exclamation-mark<#else>message <#assign subCommentIconBg><#if !subComment.published> bg-danger<#elseif subComment.isImportant> bg-warning<#else> bg-primary <#assign subCommentLabel> <#assign adminClass><#if !subComment.isAdminComment> comment <@div class="d-flex justify-content-start align-items-center ${adminClass}"> <@div> <@span class='badge ${subCommentIconBg} text-white me-2'><@icon style=subCommentIcon /><@icon style='user' /> ${subComment.name!} <@span class='dt-comment'>${subComment.dateComment!?string["dd/MM/yyyy HH:mm"]} ${subComment.email!} <#assign subCommentActions> <@div class='d-flex flex-wrap gap-1'> <#if subComment.published> <@operationButton idComment=subComment.idComment operation='unpublish' color='danger' size='sm' title='#i18n{module.extend.comment.comment_info.buttonUnpublish}' icon='toggle-right' /> <#else> <@operationButton idComment=subComment.idComment operation='publish' size='sm' title='#i18n{module.extend.comment.comment_info.buttonPublish}' icon='toggle-left' /> <#assign subDeleteHref>${manageCommentsUrl}?view=confirmRemoveComment&idComment=${subComment.idComment!}&viewAllResources=${allResources?c}${fromUrlParam} <@aButton color='danger' size='sm' href=subDeleteHref title='#i18n{portal.util.labelDelete}' hideTitle=['all'] buttonIcon='trash' /> <#if 0 < subComment.firstUnpublishedSubComment> <#assign unpublishedHref>${postBackUrl!}<#if (postBackUrl!)?contains('?')>&<#else>?extenderType=comment&idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${subComment.idComment}${fromUrlParam}#comment_${subComment.firstUnpublishedSubComment} <@aButton color='warning' size='sm' href=unpublishedHref title='#i18n{module.extend.comment.comment_info.unpublishedSubComments}' /> ${subCommentLabel} <@row>
<#if use_bbcode>${subComment.BBCodeComment!}<#else>${subComment.comment!}
<@row> ${subCommentActions} <@paginationAdmin paginator=paginator combo=1 showcount=0 /> <#else> <@row> <@columns> <@empty title='#i18n{module.extend.comment.comment_info.labelNoComment}' iconName='message-circle-off' subtitle=' ' />