Merge branch '5.2' into 5.3
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / templates / conversation.tpl
CommitLineData
583b412e 1{capture assign='pageTitle'}{$conversation->subject} {if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture}
9544b6b4 2
bf5c93eb
MW
3{assign var='__pageCssClassName' value='mobileShowPaginationTop'}
4
583b412e
MW
5{capture assign='contentHeader'}
6 <header class="contentHeader">
7 <div class="contentHeaderIcon">
8 {@$conversation->getUserProfile()->getAvatar()->getImageTag(64)}
9 </div>
7961609e 10
583b412e 11 <div class="contentHeaderTitle">
4251df82 12 <h1 class="contentTitle jsConversationSubject" data-conversation-id="{@$conversation->conversationID}">{$conversation->subject}</h1>
583b412e
MW
13
14 <ul class="inlineList contentHeaderMetaData">
15 {hascontent}
16 <li>
17 <span class="icon icon16 fa-tags"></span>
18 <ul class="labelList">
19 {content}
20 {foreach from=$conversation->getAssignedLabels() item=label}
f27a3c56 21 <li><span class="label badge{if $label->cssClassName} {$label->cssClassName}{/if}">{$label->label}</span></li>
583b412e
MW
22 {/foreach}
23 {/content}
24 </ul>
25 </li>
26 {/hascontent}
27
7961609e 28 <li>
583b412e
MW
29 <span class="icon icon16 fa-user"></span>
30 {if $conversation->userID}
02dcae10 31 {user object=$conversation->getUserProfile()}
583b412e
MW
32 {else}
33 {$conversation->username}
34 {/if}
7961609e 35 </li>
583b412e 36
7961609e 37 <li>
583b412e
MW
38 <span class="icon icon16 fa-clock-o"></span>
39 {@$conversation->time|time}
7961609e 40 </li>
583b412e
MW
41
42 {if $conversation->isClosed}
43 <li>
44 <span class="icon icon16 fa-lock jsIconLock"></span>
45 {lang}wcf.global.state.closed{/lang}
46 </li>
47 {/if}
48 </ul>
49 </div>
50
63faa8d1 51 <nav class="contentHeaderNavigation">
7d269a63
MW
52 <ul class="conversation jsConversationInlineEditorContainer" data-conversation-id="{@$conversation->conversationID}" data-label-ids="[ {implode from=$conversation->getAssignedLabels() item=label}{@$label->labelID}{/implode} ]" data-is-closed="{@$conversation->isClosed}" data-can-close-conversation="{if $conversation->userID == $__wcf->getUser()->userID}1{else}0{/if}" data-can-add-participants="{if $conversation->canAddParticipants()}1{else}0{/if}" data-is-draft="{if $conversation->isDraft}1{else}0{/if}">
53 <li class="jsOnly"><a href="{if $conversation->isDraft}{link controller='ConversationDraftEdit' id=$conversation->conversationID}{/link}{else}#{/if}" class="button jsConversationInlineEditor"><span class="icon icon16 fa-pencil"></span> <span>{lang}wcf.global.button.edit{/lang}</span></a></li>
f2e42256 54 {if $conversation->canReply()}<li class="jsOnly"><a href="#" class="button buttonPrimary jsQuickReply"><span class="icon icon16 fa-reply"></span> <span>{lang}wcf.conversation.message.button.add{/lang}</span></a></li>{/if}
63faa8d1
MS
55 {event name='contentHeaderNavigation'}
56 </ul>
57 </nav>
583b412e
MW
58 </header>
59{/capture}
9544b6b4 60
583b412e 61{include file='header'}
9544b6b4 62
60d1935c 63{if !$conversation->isDraft}
7cd36813
MW
64 <section class="section">
65 <h2 class="sectionTitle">{lang}wcf.conversation.participants{/lang}</h2>
66
67 <ul class="containerBoxList tripleColumned conversationParticipantList">
68 {foreach from=$participants item=participant}
219838a1 69 <li class="jsParticipant{if !$participant->userID || $participant->hideConversation == 2 || $participant->leftAt > 0} conversationLeft{/if}">
7cd36813 70 <div class="box24">
02dcae10
MS
71 {if $participant->userID}
72 {user object=$participant type='avatar24'}
73 {else}
74 <span>{@$participant->getAvatar()->getImageTag(24)}</span>
75 {/if}
7cd36813
MW
76 <div>
77 <p>
02dcae10
MS
78 {if $participant->userID}
79 {user object=$participant}
80 {else}
81 <span>{$participant->username}</span>
82 {/if}
7cd36813 83 {if $participant->isInvisible}<small>({lang}wcf.conversation.invisible{/lang})</small>{/if}
c651e196 84 {if $participant->userID && ($conversation->userID == $__wcf->getUser()->userID) && ($participant->userID != $__wcf->getUser()->userID) && $participant->hideConversation != 2 && $participant->leftAt == 0}
7ce8b013 85 <a href="#" class="jsDeleteButton jsTooltip jsOnly" title="{lang}wcf.conversation.participants.removeParticipant{/lang}" data-confirm-message-html="{lang __encode=true}wcf.conversation.participants.removeParticipant.confirmMessage{/lang}" data-object-id="{@$participant->userID}"><span class="icon icon16 fa-times"></span></a>
7cd36813
MW
86 {/if}
87 </p>
7961609e 88 <dl class="plain inlineDataList small">
7cd36813
MW
89 <dt>{lang}wcf.conversation.lastVisitTime{/lang}</dt>
90 <dd>{if $participant->lastVisitTime}{@$participant->lastVisitTime|time}{else}-{/if}</dd>
91 </dl>
2a3b78db 92 </div>
7cd36813
MW
93 </div>
94 </li>
95 {/foreach}
96 </ul>
97 </section>
60d1935c 98{/if}
530c5f83 99
583b412e
MW
100{hascontent}
101 <div class="paginationTop">
102 {content}{pages print=true assign=pagesLinks controller='Conversation' object=$conversation link="pageNo=%d"}{/content}
103 </div>
104{/hascontent}
9544b6b4 105
7cd36813 106<div class="section">
431964d9 107 <ul class="messageList">
4315dc4a 108 {if $pageNo == 1 && !$conversation->joinedAt|empty}<li><p class="info" role="status">{lang}wcf.conversation.visibility.previousMessages{/lang}</p></li>{/if}
9544b6b4 109 {include file='conversationMessageList'}
a3508589
AE
110 {hascontent}
111 <li class="messageListPagination">
112 {content}{@$pagesLinks}{/content}
113 </li>
114 {/hascontent}
219838a1 115 {if $conversation->canReply()}{include file='conversationQuickReply'}{/if}
4315dc4a 116 {if $pageNo == $pages && !$conversation->leftAt|empty}<li><p class="info" role="status">{lang}wcf.conversation.visibility.nextMessages{/lang}</p></li>{/if}
9544b6b4
MW
117 </ul>
118</div>
119
38340e3b 120{if !ENABLE_DEBUG_MODE}<script src="{@$__wcf->getPath()}js/WoltLabSuite.Core.Conversation.min.js?v={@LAST_UPDATE_TIME}"></script>{/if}
583b412e
MW
121<script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Conversation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@LAST_UPDATE_TIME}"></script>
122<script data-relocate="true">
583b412e
MW
123 $(function() {
124 WCF.Language.addObject({
9361d1b8
MW
125 'wcf.conversation.edit.addParticipants': '{jslang}wcf.conversation.edit.addParticipants{/jslang}',
126 'wcf.conversation.edit.assignLabel': '{jslang}wcf.conversation.edit.assignLabel{/jslang}',
127 'wcf.conversation.edit.close': '{jslang}wcf.conversation.edit.close{/jslang}',
128 'wcf.conversation.edit.leave': '{jslang}wcf.conversation.edit.leave{/jslang}',
129 'wcf.conversation.edit.open': '{jslang}wcf.conversation.edit.open{/jslang}',
130 'wcf.conversation.edit.subject': '{jslang}wcf.conversation.edit.subject{/jslang}',
131 'wcf.conversation.leave.title': '{jslang}wcf.conversation.leave.title{/jslang}',
132 'wcf.global.state.closed': '{jslang}wcf.global.state.closed{/jslang}',
133 'wcf.global.subject': '{jslang}wcf.global.subject{/jslang}',
134 'wcf.message.bbcode.code.copy': '{jslang}wcf.message.bbcode.code.copy{/jslang}',
135 'wcf.message.error.editorAlreadyInUse': '{jslang}wcf.message.error.editorAlreadyInUse{/jslang}',
136 'wcf.moderation.report.reportContent': '{jslang}wcf.moderation.report.reportContent{/jslang}',
137 'wcf.moderation.report.success': '{jslang}wcf.moderation.report.success{/jslang}',
138 'wcf.conversation.label.assignLabels': '{jslang}wcf.conversation.label.assignLabels{/jslang}'
583b412e
MW
139 });
140
66aca762 141 var $availableLabels = [ {implode from=$labelList item=label}{ cssClassName: '{if $label->cssClassName}{@$label->cssClassName}{/if}', labelID: {@$label->labelID}, label: '{$label->label|encodeJS}' }{/implode} ];
583b412e
MW
142 var $editorHandler = new WCF.Conversation.EditorHandlerConversation($availableLabels);
143 var $inlineEditor = new WCF.Conversation.InlineEditor('.conversation');
144 $inlineEditor.setEditorHandler($editorHandler);
145
146 {assign var=__supportPaste value=true}
219838a1 147 {if !$conversation->canReply()}{assign var=__supportPaste value=false}{/if}
583b412e
MW
148 {include file='__messageQuoteManager' wysiwygSelector='text' supportPaste=$__supportPaste}
149
150 new WCF.Conversation.Message.InlineEditor({@$conversation->conversationID}, $quoteManager);
151 new WCF.Conversation.Message.QuoteHandler($quoteManager);
6e0570f0 152
219838a1 153 {if $conversation->canReply()}
6e0570f0
AE
154 require(['WoltLabSuite/Core/Ui/Message/Reply'], function(UiMessageReply) {
155 new UiMessageReply({
156 ajax: {
157 className: 'wcf\\data\\conversation\\message\\ConversationMessageAction'
158 },
159 quoteManager: $quoteManager
160 });
161 });
162 {/if}
583b412e
MW
163
164 {if $__wcf->session->getPermission('user.profile.canReportContent')}
6e0570f0 165 new WCF.Moderation.Report.Content('com.woltlab.wcf.conversation.message', '.jsReportConversationMessage');
583b412e
MW
166 {/if}
167 new WCF.Conversation.RemoveParticipant({@$conversation->conversationID});
583b412e 168 });
583b412e 169</script>
9544b6b4 170
583b412e 171{include file='footer'}