Merge branch '5.2'
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / templates / conversation.tpl
1 {capture assign='pageTitle'}{$conversation->subject} {if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture}
2
3 {assign var='__pageCssClassName' value='mobileShowPaginationTop'}
4
5 {capture assign='contentHeader'}
6 <header class="contentHeader">
7 <div class="contentHeaderIcon">
8 {@$conversation->getUserProfile()->getAvatar()->getImageTag(64)}
9 </div>
10
11 <div class="contentHeaderTitle">
12 <h1 class="contentTitle jsConversationSubject" data-conversation-id="{@$conversation->conversationID}">{$conversation->subject}</h1>
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}
21 <li><span class="label badge{if $label->cssClassName} {$label->cssClassName}{/if}">{$label->label}</span></li>
22 {/foreach}
23 {/content}
24 </ul>
25 </li>
26 {/hascontent}
27
28 <li>
29 <span class="icon icon16 fa-user"></span>
30 {if $conversation->userID}
31 {user object=$conversation->getUserProfile()}
32 {else}
33 {$conversation->username}
34 {/if}
35 </li>
36
37 <li>
38 <span class="icon icon16 fa-clock-o"></span>
39 {@$conversation->time|time}
40 </li>
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
51 <nav class="contentHeaderNavigation">
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>
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}
55 {event name='contentHeaderNavigation'}
56 </ul>
57 </nav>
58 </header>
59 {/capture}
60
61 {include file='header'}
62
63 {if !$conversation->isDraft}
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}
69 <li class="jsParticipant{if !$participant->userID || $participant->hideConversation == 2 || $participant->leftAt > 0} conversationLeft{/if}">
70 <div class="box24">
71 {if $participant->userID}
72 {user object=$participant type='avatar24'}
73 {else}
74 <span>{@$participant->getAvatar()->getImageTag(24)}</span>
75 {/if}
76 <div>
77 <p>
78 {if $participant->userID}
79 {user object=$participant}
80 {else}
81 <span>{$participant->username}</span>
82 {/if}
83 {if $participant->isInvisible}<small>({lang}wcf.conversation.invisible{/lang})</small>{/if}
84 {if $participant->userID && ($conversation->userID == $__wcf->getUser()->userID) && ($participant->userID != $__wcf->getUser()->userID) && $participant->hideConversation != 2 && $participant->leftAt == 0}
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>
86 {/if}
87 </p>
88 <dl class="plain inlineDataList small">
89 <dt>{lang}wcf.conversation.lastVisitTime{/lang}</dt>
90 <dd>{if $participant->lastVisitTime}{@$participant->lastVisitTime|time}{else}-{/if}</dd>
91 </dl>
92 </div>
93 </div>
94 </li>
95 {/foreach}
96 </ul>
97 </section>
98 {/if}
99
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}
105
106 <div class="section">
107 <ul class="messageList">
108 {if $pageNo == 1 && !$conversation->joinedAt|empty}<li><p class="info" role="status">{lang}wcf.conversation.visibility.previousMessages{/lang}</p></li>{/if}
109 {include file='conversationMessageList'}
110 {hascontent}
111 <li class="messageListPagination">
112 {content}{@$pagesLinks}{/content}
113 </li>
114 {/hascontent}
115 {if $conversation->canReply()}{include file='conversationQuickReply'}{/if}
116 {if $pageNo == $pages && !$conversation->leftAt|empty}<li><p class="info" role="status">{lang}wcf.conversation.visibility.nextMessages{/lang}</p></li>{/if}
117 </ul>
118 </div>
119
120 {if !ENABLE_DEBUG_MODE}<script src="{@$__wcf->getPath()}js/WoltLabSuite.Core.Conversation.min.js?v={@LAST_UPDATE_TIME}"></script>{/if}
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">
123 $(function() {
124 WCF.Language.addObject({
125 'wcf.conversation.edit.addParticipants': '{lang}wcf.conversation.edit.addParticipants{/lang}',
126 'wcf.conversation.edit.assignLabel': '{lang}wcf.conversation.edit.assignLabel{/lang}',
127 'wcf.conversation.edit.close': '{lang}wcf.conversation.edit.close{/lang}',
128 'wcf.conversation.edit.leave': '{lang}wcf.conversation.edit.leave{/lang}',
129 'wcf.conversation.edit.open': '{lang}wcf.conversation.edit.open{/lang}',
130 'wcf.conversation.edit.subject': '{lang}wcf.conversation.edit.subject{/lang}',
131 'wcf.conversation.leave.title': '{lang}wcf.conversation.leave.title{/lang}',
132 'wcf.global.state.closed': '{lang}wcf.global.state.closed{/lang}',
133 'wcf.global.subject': '{lang}wcf.global.subject{/lang}',
134 'wcf.message.bbcode.code.copy': '{lang}wcf.message.bbcode.code.copy{/lang}',
135 'wcf.message.error.editorAlreadyInUse': '{lang}wcf.message.error.editorAlreadyInUse{/lang}',
136 'wcf.moderation.report.reportContent': '{lang}wcf.moderation.report.reportContent{/lang}',
137 'wcf.moderation.report.success': '{lang}wcf.moderation.report.success{/lang}',
138 'wcf.conversation.label.assignLabels': '{lang}wcf.conversation.label.assignLabels{/lang}'
139 });
140
141 var $availableLabels = [ {implode from=$labelList item=label}{ cssClassName: '{if $label->cssClassName}{@$label->cssClassName}{/if}', labelID: {@$label->labelID}, label: '{$label->label|encodeJS}' }{/implode} ];
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}
147 {if !$conversation->canReply()}{assign var=__supportPaste value=false}{/if}
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);
152
153 {if $conversation->canReply()}
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}
163
164 {if $__wcf->session->getPermission('user.profile.canReportContent')}
165 new WCF.Moderation.Report.Content('com.woltlab.wcf.conversation.message', '.jsReportConversationMessage');
166 {/if}
167 new WCF.Conversation.RemoveParticipant({@$conversation->conversationID});
168 new WCF.Message.BBCode.CodeViewer();
169 });
170 </script>
171
172 {include file='footer'}