Merge branch '6.0'
[GitHub/WoltLab/WCF.git] / com.woltlab.wcf / templates / commentResponseList.tpl
CommitLineData
285b1d92 1{foreach from=$responseList item=response}
c1cf73eb 2 {if $response->isDisabled && !$commentCanModerate}
8d861006 3 <div class="commentResponseList__item">
cc2b69dd 4 <p class="info commentModerationDisabledComment">{lang}wcf.comment.moderation.disabledComment{/lang}</p>
ac6aa27a 5 </div>
cc2b69dd 6 {else}
5a7aead1 7 <div class="commentResponseList__item jsCommentResponse{if $__wcf->getUserProfileHandler()->isIgnoredUser($response->userID, 2)} ignoredUserContent{/if}"
f5b772aa
MW
8 data-response-id="{@$response->responseID}"
9 {@$__wcf->getReactionHandler()->getDataAttributes('com.woltlab.wcf.comment.response', $response->responseID)}
10 data-can-edit="{if $response->isEditable()}true{else}false{/if}"
11 data-can-delete="{if $response->isDeletable()}true{else}false{/if}"
12 data-user-id="{@$response->userID}"
13 >
ac6aa27a 14 <woltlab-core-comment-response class="commentResponse" response-id="{@$response->responseID}" itemprop="comment" itemscope itemtype="http://schema.org/Comment">
f5b772aa
MW
15 <div class="commentResponse__header">
16 <div class="commentResponse__avatar">
17 {user object=$response->getUserProfile() type='avatar32' ariaHidden='true' tabindex='-1'}
cc2b69dd 18 </div>
f5b772aa
MW
19 <div class="commentResponse__author" itemprop="author" itemscope itemtype="http://schema.org/Person">
20 {if $response->userID}
ac6aa27a 21 <a href="{$response->getUserProfile()->getLink()}" class="commentResponse__author__link userLink" data-object-id="{@$response->userID}" itemprop="url">
f5b772aa
MW
22 <span itemprop="name">{@$response->getUserProfile()->getFormattedUsername()}</span>
23 </a>
24 {else}
25 <span itemprop="name">{$response->username}</span>
26 {/if}
27 </div>
28 <div class="commentResponse__date">
9908cbb0 29 <meta itemprop="datePublished" content="{@$response->time|date:'c'}">
ac6aa27a 30 <a href="{$response->getLink()}" class="commentResponse__permalink">{@$response->time|time}</a>
f5b772aa
MW
31 </div>
32 <div class="commentResponse__status">
33 {if $response->isDisabled}
34 <span class="badge label green commentResponse__status--disabled">{lang}wcf.message.status.disabled{/lang}</span>
35 {/if}
36
37 {if $commentManager->isContentAuthor($response)}
38 <span class="badge label">{lang}wcf.comment.objectAuthor{/lang}</span>
39 {/if}
9e666b64
MW
40
41 {event name='commentResponseStatus'}
f5b772aa
MW
42 </div>
43
f72c3be7
MW
44 {hascontent}
45 <div class="commentResponse__menu dropdown" id="commentResponseOptions{@$response->responseID}">
46 <button type="button" class="dropdownToggle" aria-label="{lang}wcf.global.button.more{/lang}">{icon name='ellipsis-vertical'}</button>
fd9f35c2 47
f72c3be7
MW
48 <ul class="dropdownMenu">
49 {content}
50 {if $response->isDisabled && $commentCanModerate}
51 <li>
52 <a href="#" class="commentResponse__option commentResponse__option--enable">
53 {lang}wcf.comment.approve{/lang}
54 </a>
55 </li>
56 {/if}
57 {if $commentManager->supportsReport() && $__wcf->session->getPermission('user.profile.canReportContent')}
58 <li>
59 <a
60 href="#"
61 data-report-content="com.woltlab.wcf.comment.response"
62 data-object-id="{$response->responseID}"
63 class="commentResponse__option commentResponse__option--report"
64 >
65 {lang}wcf.moderation.report.reportContent{/lang}
66 </a>
67 </li>
68 {/if}
69 {if $response->isEditable()}
70 <li>
71 <a href="#" class="commentResponse__option commentResponse__option--edit">
72 {lang}wcf.global.button.edit{/lang}
73 </a>
74 </li>
75 {/if}
76 {if $response->isDeletable()}
77 <li>
78 <a href="#" class="commentResponse__option commentResponse__option--delete">
79 {lang}wcf.global.button.delete{/lang}
80 </a>
81 </li>
82 {/if}
f5b772aa 83
f72c3be7
MW
84 {event name='commentResponseMenuOptions'}
85 {/content}
86 </ul>
87 </div>
88 {/hascontent}
f5b772aa
MW
89
90 {event name='commentResponseHeader'}
91 </div>
92
93 {event name='commentBeforeMessage'}
94
95 <div class="commentResponse__message">
96 <div class="htmlContent userMessage" itemprop="text">{@$response->getFormattedMessage()}</div>
97 </div>
98
99 {event name='commentAfterMessage'}
100
101 <div class="commentResponse__footer">
102 <div class="commentResponse__reactions">
103 {if MODULE_LIKE && $commentManager->supportsLike() && $likeData|isset}
104 {include file="reactionSummaryList" isTiny=true reactionData=$likeData[response] objectType="com.woltlab.wcf.comment.response" objectID=$response->responseID}
105 {else}
106 <a href="#" class="reactionSummaryList reactionSummaryListTiny jsOnly" data-object-type="com.woltlab.wcf.comment.response" data-object-id="{$response->responseID}" title="{lang}wcf.reactions.summary.listReactions{/lang}" style="display: none;"></a>
107 {/if}
108 </div>
109
110 <div class="commentResponse__buttons">
111 {if MODULE_LIKE && $commentManager->supportsLike() && $__wcf->session->getPermission('user.like.canLike') && $response->userID != $__wcf->user->userID}
112 <button
113 type="button"
2ac901f6 114 class="commentResponse__button commentResponse__button--react jsTooltip button small {if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID} active{/if}"
f5b772aa
MW
115 title="{lang}wcf.reactions.react{/lang}"
116 data-reaction-type-id="{if $likeData[response][$response->responseID]|isset && $likeData[response][$response->responseID]->reactionTypeID}{$likeData[response][$response->responseID]->reactionTypeID}{else}0{/if}"
117 >
118 {icon name='face-smile'}
119 <span class="invisible">{lang}wcf.reactions.react{/lang}</span>
2ac901f6 120 </button>
f5b772aa
MW
121 {/if}
122
123 {event name='commentResponseButtons'}
124 </div>
125
126 {event name='commentResponseFooter'}
285b1d92 127 </div>
f5b772aa 128 </woltlab-core-comment-response>
ac6aa27a 129 </div>
cc2b69dd 130 {/if}
285b1d92 131{/foreach}