manage_blog_extendcomment.html
1 <#assign cumber_char_comments=200/>
2 <div class="mailbox-controls">
3 <@tform type='inline' method='post' action='jsp/admin/plugins/blog/modules/extendcomment/ManageBlogExtendcomment.jsp'>
4
5 <@input type='hidden' name='idExtendableResource' value='${idExtendableResource}' />
6 <@input type='hidden' name='extendableResourceType' value='${extendableResourceType}' />
7 <@input type='hidden' name='extenderType' value='comment' />
8 <#if from_url?? && from_url?has_content && from_url != "null">
9 <@input type='hidden' name='from_url' value='${from_url}' />
10 </#if>
11 <@select name='filterPinned' default_value='${filterPinned!''}' items=listPinnedFilter />
12 <@select name='filterMarkAsImportant' default_value='${filterMarkAsImportant!''}' items=listMarkAsImportantFilter />
13 <@select name='filterState' default_value='${filterState!\'\'}' items=listCommentStates />
14 <@select name='sorted_attribute_name'>
15 <option <#if sorted_attribute_name?? && sorted_attribute_name = "date_last_modif">selected="selected"</#if> value="date_last_modif">Date de modifications</option>
16 <option <#if sorted_attribute_name?? && sorted_attribute_name = "date_comment">selected="selected"</#if> value="date_comment">Date de création</option>
17 </@select>
18 <@inputGroup>
19 <@select name='asc_sort'>
20 <option <#if asc_sort?? && asc_sort>selected="selected"</#if> value="true">#i18n{portal.util.sort.asc}</option>
21 <option <#if asc_sort?? && !asc_sort>selected="selected"</#if>value="false">#i18n{portal.util.sort.desc}</option>
22 </@select>
23 <@inputGroupItem>
24 <@button type='submit' title='#i18n{module.extend.comment.comment_info.labelSearch}' buttonIcon='filter' hideTitle=['xs','sm'] />
25 </@inputGroupItem>
26 </@inputGroup>
27 <#if !allResources>
28 <#assign aButtonUrl>
29 jsp/admin/plugins/extend/modules/comment/GetCreateComment.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
30 </#assign>
31 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment.labelAddComment}' title='#i18n{module.extend.comment.comment.labelAddComment}' buttonIcon='plus' hideTitle=['xs','sm'] />
32 </#if>
33 </@tform>
34 <!--
35 <@paginationItemCount paginator=paginator combo=1 nb_items_per_page=nb_items_per_page/>
36 -->
37 </div>
38 <#if !allResources && resourceExtender??>
39 <@row>
40 <@columns><h2>${resourceExtender.extendableResourceName}</h2></@columns>
41 </@row>
42 </#if>
43 <#if listComments?? && listComments?has_content>
44 <@table>
45 <tbody>
46 <thead>
47 <@th>#i18n{module.extend.comment.comment_info.statePublished}</@th>
48 <@th>#i18n{module.extend.comment.comment_info.labelComment}</@th>
49 <@th></@th>
50 <@th></@th>
51 <@th></@th>
52 </thead>
53 <#list listComments as comment>
54 <@tr>
55 <@td>
56 <@ul>
57 <#if comment.published>
58 <@li>
59 <@tag color='success' title='#i18n{module.extend.comment.comment_info.statePublished}'>
60 <@icon style='check' />
61 </@tag>
62 </@li>
63 <#else>
64 <@li>
65 <@tag color='danger' title='#i18n{module.extend.comment.comment_info.stateNotPublished}'>
66 <@icon style='times' />
67 </@tag>
68 </@li>
69 </#if>
70 <#if comment.pinned>
71 <@li>
72 <@tag color=''>
73 <@icon style='thumbtack' />
74 </@tag>
75 </@li>
76 </#if>
77 <#if comment.isImportant>
78 <@li>
79 <@tag color=''>
80 <@icon style='thumbs-up' title='#i18n{module.extend.comment.comment_info.important}'>
81 </@tag>
82 </@li>
83 </#if>
84
85
86
87 <#assign unpublishedSubComment = comment.firstUnpublishedSubComment>
88 <#if 0 < unpublishedSubComment>
89 <#assign aButtonUrl>
90 ${postBackUrl!}<#if postBackUrl?contains('?')>&<#else>?</#if>extenderType=comment&idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>#subcomment_${unpublishedSubComment}
91 </#assign>
92 <@aButton params='onclick="javascript:$(\'#comment_toggle_${comment.idComment!}\').next().show();"' href=aButtonUrl title='#i18n{module.extend.comment.comment_info.unpublishedSubComments}' buttonIcon='' />
93 </#if>
94 </@ul>
95 </@td>
96 <@td>
97 <@link name='comment_${comment.idComment!}'></@link>
98 <strong>
99 <#if use_bbcode>
100 ${comment.BBCodeComment!}
101 <#else>
102 ${comment.comment!}
103 </#if>
104 </strong>
105 <#if comment.listSubComments?? && 0 < comment.listSubComments?size>
106 <#list comment.listSubComments as subComment>
107 <@box>
108 <#assign boxHeaderTitle>
109 <#if subComment.published>
110 <@tag color='success' title='#i18n{module.extend.comment.comment_info.statePublished}'>
111 <@icon style='check' />
112 </@tag>
113 <#else>
114 <@tag color='important' title='#i18n{module.extend.comment.comment_info.stateNotPublished}'>
115 <@icon style='times' />
116 </@tag>
117 </#if>
118 <#if use_bbcode>
119 <#if subComment.BBCodeComment?length <= cumber_char_comments>
120 ${(subComment.BBCodeComment)!""}
121 <#else>
122 ${(subComment.BBCodeComment[0..cumber_char_comments-1])!""}...
123 </#if>
124 <#else>
125 <#if subComment.comment?length <= cumber_char_comments>
126 ${(subComment.comment)!""}
127 <#else>
128 ${(subComment.comment[0..cumber_char_comments-1])!""}...
129 </#if>
130 </#if>
131 </#assign>
132 <@boxHeader title=boxHeaderTitle>
133 <@tform type='inline' method='post' action='jsp/admin/plugins/extend/modules/comment/DoPublishUnpublishComment.jsp#comment_${comment.idComment!}'>
134 <@input type='hidden' name='viewAllResources' value='${allResources?c}' />
135 <@input type='hidden' name='idComment' value='${subComment.idComment!}' />
136 <#if from_url?? && from_url?has_content && from_url != "null">
137 <@input type='hidden' name='from_url' value='${from_url!}' />
138 </#if>
139 <@btnGroup>
140 <#if subComment.published>
141 <@button type='submit' title='#i18n{module.extend.comment.comment_info.buttonUnpublish}' name='unpublish' value='#i18n{module.extend.comment.comment_info.buttonUnpublish}' title='#i18n{module.extend.comment.comment_info.labelPublished}' buttonIcon='unlink' />
142 <#else>
143 <@button type='submit' title='#i18n{module.extend.comment.comment_info.buttonPublish}' name='publish' value='#i18n{module.extend.comment.comment_info.buttonPublish}' title='#i18n{module.extend.comment.comment_info.labelUnpublished}' buttonIcon='unlink' />
144 </#if>
145
146 <#assign aButtonUrl> jsp/admin/plugins/extend/modules/comment/ConfirmRemoveComment.jsp?idComment=${subComment.idComment!}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
147 </#assign>
148 <@aButton href=aButtonUrl title='#i18n{portal.util.labelDelete}' buttonIcon='trash' color='danger' />
149 <@button style='card-control collapse' title='Collapse' buttonIcon='minus' buttonTargetId='' />
150 </@btnGroup>
151 </@tform>
152 </@boxHeader>
153 <@boxBody>>
154 <#if use_bbcode>
155 ${subComment.BBCodeComment!}
156 <#else>
157 ${subComment.comment!}
158 </#if>
159 <#if subComment.isAdminComment>
160 <@p>${adminBadge!}</@p>
161 </#if>
162 <@p>
163 <strong>#i18n{module.extend.comment.comment_info.labelAuthor}</strong>
164 #i18n{module.extend.comment.comment_info.labelName} : ${subComment.name!} - #i18n{module.extend.comment.comment_info.labelSendTime} : ${subComment.dateComment!}
165 </@p>
166 <@p>
167 #i18n{module.extend.comment.comment_info.labelEmail} : ${subComment.email!} - #i18n{module.extend.comment.comment_info.labelIpAddress} : ${subComment.ipAddress!}
168 </@p>
169 </@boxBody>
170 </@box>
171 </#list>
172 </#if>
173 </@td>
174 <@td>
175 <@tform method='post' action='jsp/admin/plugins/extend/modules/comment/DoPublishUnpublishComment.jsp#comment_${comment.idComment!}'>
176 <@input type='hidden' name='idComment' value='${comment.idComment!}' />
177 <@input type='hidden' name='viewAllResources' value='${allResources?c}' />
178 <#if from_url?? && from_url?has_content && from_url != "null">
179 <@input type='hidden' name='from_url' value='${from_url!}' />
180 </#if>
181 <div class="btn-group-vertical" role="group" aria-label="...">
182 <#if comment.published>
183 <@button type='submit' name='unpublish' value='#i18n{module.extend.comment.comment_info.buttonPublish}' title='#i18n{module.extend.comment.comment_info.labelUnpublished}' hideTitle=['all'] buttonIcon='unlink' size='sm' color='danger' />
184 <#else>
185 <@button type='submit' name='publish' value='#i18n{module.extend.comment.comment_info.buttonUnpublish}' title='#i18n{module.extend.comment.comment_info.labelPublished}' hideTitle=['all'] buttonIcon='link' size='sm' color='success' />
186 </#if>
187 <#if allowSubComments>
188 <#assign aButtonUrl>
189 jsp/admin/plugins/extend/modules/comment/GetCreateComment.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
190 </#assign>
191 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment_info.labelAnswer}' hideTitle=['all'] buttonIcon='comment' size='sm' />
192 </#if>
193 <#assign aButtonUrl>
194 jsp/admin/plugins/extend/modules/comment/ConfirmRemoveComment.jsp?idComment=${comment.idComment!}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
195 </#assign>
196 <@aButton href=aButtonUrl title='#i18n{portal.util.labelDelete}' hideTitle=['all'] buttonIcon='trash' size='sm' />
197 <!--
198 <#if comment.listSubComments?? && 0 < comment.listSubComments?size>
199 <a class="btn btn-primary btn-xs comment_toggle" id="comment_toggle_${comment.idComment!}" data-toggle-id="subcomment_${comment.idComment!}" href="javascript:;" title="#i18n{module.extend.comment.comment_info.displaySubComments}">
200 <i class="fa fa-chevron-down"></i>
201 </a>
202 </#if>
203 -->
204 <#if comment.isImportant>
205 <#assign aButtonUrl>
206 jsp/admin/plugins/extend/modules/comment/DoCancelFlagAsImportant.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
207 </#assign>
208 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment_info.labelCancelFlagImportant}' hideTitle=['all'] buttonIcon='thumbs-down' color='warning' size='sm' />
209 <#else>
210 <#assign aButtonUrl>
211 jsp/admin/plugins/extend/modules/comment/DoFlagAsImportant.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
212 </#assign>
213 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment_info.labelDoFlagImportant}' hideTitle=['all'] buttonIcon='thumbs-up' size='sm' />
214 </#if>
215 <#if comment.pinned>
216 <#assign aButtonUrl>
217 jsp/admin/plugins/extend/modules/comment/DoCancelPinned.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
218 </#assign>
219 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment_info.labelCancelPinned}' hideTitle=['all'] color='danger' size='sm'>
220 <@iconStack>
221 <@icon style='thumbtack' class='fa-stack-1x' />
222 <@icon style='ban' class='fa-stack-1x fa-inverse' />
223 </@iconStack>
224 </@aButton>
225 <#else>
226 <#assign aButtonUrl>
227 jsp/admin/plugins/extend/modules/comment/DoPinned.jsp?idExtendableResource=${idExtendableResource}&extendableResourceType=${extendableResourceType}&idComment=${comment.idComment}<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
228 </#assign>
229 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment_info.labelDoPinned}' hideTitle=['all'] buttonIcon='thumbtack' size='sm' />
230 </#if>
231
232 <#if comment.listWorkflowActions?? && comment.listWorkflowActions?size > 0>
233 <#list comment.listWorkflowActions as action>
234 <@aButton href='jsp/admin/plugins/extend/modules/comment/DoProcessWorkflowAction.jsp?id_action=${action.id}&idComment=${comment.idComment}'>
235 <img src="image?resource_type=workflow_icon_img&id=${action.icon.id}"<#if action.icon.width!=-1> width="${action.icon.width}" </#if><#if action.icon.height!=-1> height="${action.icon.height}"</#if>title="${action.name}" alt="${action.name}" />
236 </@aButton>
237 </#list>
238 </#if>
239 </div>
240 </@tform>
241 </@td>
242 <@td>
243 @Extender[${comment.idComment},Comment,rating,{show:"vote"}]@
244 </@td>
245 <@td>
246 <#if allResources && resourceExtenderMap?? && resourceExtenderMap[comment.idExtendableResource]??>
247 <#assign resourceExtender=resourceExtenderMap[comment.idExtendableResource]/>
248 <h4>${resourceExtender.extendableResourceName} </h4>
249 <#assign aButtonUrl>
250 jsp/admin/plugins/extend/modules/comment/GetCreateComment.jsp?idExtendableResource=${resourceExtender.idExtendableResource}&extendableResourceType=${extendableResourceType}&viewAllResources=true<#if from_url?? && from_url?has_content && from_url != "null">&from_url=${from_url}</#if>
251 </#assign>
252 <@aButton href=aButtonUrl title='#i18n{module.extend.comment.comment.labelAddComment}' hideTitle=['all'] buttonIcon='plus' size='sm' />
253 <!--
254 ${resourceExtender.extendableResourceDescription}
255 -->
256 </#if>
257 </@td>
258 <@td>
259 <!-- strong>#i18n{module.extend.comment.comment_info.labelAuthor}</strong -->
260 <p>#i18n{module.extend.comment.comment_info.labelSendTime} : ${comment.dateComment!} par ${comment.name!}</p>
261 <p>#i18n{module.extend.comment.comment_info.labelEmail} : ${comment.email!} - #i18n{module.extend.comment.comment_info.labelIpAddress} : ${comment.ipAddress!}
262 <#if comment.isAdminComment>
263 ${adminBadge!}
264 </#if>
265 </p>
266 </@td>
267 </@tr>
268 </#list>
269 </@table>
270 <@paginationAdmin paginator=paginator combo=1 />
271 <script>
272 $(function(){
273 $(".commentComments").toggle();
274 $( ".comment_toggle" ).click( function(){
275 var sId="#" + $(this).attr("data-toggle-id");
276 $(sId).fadeToggle("slow", "linear");
277 });
278 });
279 </script>
280 <#else>
281 <@row>
282 <columns>
283 <@alert color='warning' params='style="margin-top:2em;"'>
284 <h4><i class="fa fa-exclamation"></i> #i18n{module.extend.comment.comment_info.labelNoComment}</h4>
285 </@alert>
286 </@columns>
287 </@row>
288 </#if>