|
67 | 67 |
|
68 | 68 | <div |
69 | 69 | class="section entry article" |
70 | | - {unsafe:$__wcf->getReactionHandler()->getDataAttributes('com.woltlab.wcf.likeableArticle', $article->articleID)} |
71 | 70 | > |
72 | 71 | {if $articleContent->getImage() && $articleContent->getImage()->hasThumbnail('large')} |
73 | 72 | <div |
|
122 | 121 | <footer class="entry__footer"> |
123 | 122 | {if MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canViewLike')} |
124 | 123 | <div class="article__reactionSummary"> |
125 | | - {include file="reactionSummaryList" reactionData=$articleLikeData objectType="com.woltlab.wcf.likeableArticle" objectID=$article->articleID} |
| 124 | + {include file="reactionSummary" reactionData=$article->getReactionData()} |
126 | 125 | </div> |
127 | 126 | {/if} |
128 | 127 |
|
|
140 | 139 | {icon name='triangle-exclamation'} |
141 | 140 | </button> |
142 | 141 | {/if} |
143 | | - {if MODULE_LIKE && ARTICLE_ENABLE_LIKE && $__wcf->session->getPermission('user.like.canLike') && $article->userID != $__wcf->user->userID} |
144 | | - <button |
145 | | - type="button" |
146 | | - class="button jsTooltip reactButton{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID} active{/if}" |
147 | | - title="{lang}wcf.reactions.react{/lang}" |
148 | | - data-reaction-type-id="{if $articleLikeData[$article->articleID]|isset && $articleLikeData[$article->articleID]->reactionTypeID}{$articleLikeData[$article->articleID]->reactionTypeID}{else}0{/if}" |
149 | | - > |
150 | | - {icon name='face-smile'} |
151 | | - </button> |
| 142 | + {if $article->canReact()} |
| 143 | + {include file="reactionButton" reactionData=$article->getReactionData()} |
152 | 144 | {/if} |
153 | 145 |
|
154 | 146 | {event name='articleLikeButtons'}{* deprecated: use footerButtons instead *} |
|
264 | 256 |
|
265 | 257 | {unsafe:$article->getDiscussionProvider()->renderDiscussions()} |
266 | 258 |
|
267 | | -{if MODULE_LIKE && ARTICLE_ENABLE_LIKE} |
268 | | - <script data-relocate="true"> |
269 | | - require(['WoltLabSuite/Core/Ui/Reaction/Handler'], function(UiReactionHandler) { |
270 | | - new UiReactionHandler('com.woltlab.wcf.likeableArticle', { |
271 | | - // permissions |
272 | | - canReact: {if $__wcf->getUser()->userID}true{else}false{/if}, |
273 | | - canReactToOwnContent: false, |
274 | | - |
275 | | - // selectors |
276 | | - containerSelector: '.article', |
277 | | - }); |
278 | | - }); |
279 | | - </script> |
280 | | -{/if} |
281 | | - |
282 | 259 | {include file='footer'} |
0 commit comments