Merge remote-tracking branch 'refs/remotes/origin/3.0'
[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}">{lang}{$label->label}{/lang}</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 <a href="{link controller='User' object=$conversation->getUserProfile()->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$conversation->userID}">{$conversation->username}</a>
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-plus"></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}<a href="{link controller='User' object=$participant}{/link}">{@$participant->getAvatar()->getImageTag(24)}</a>{else}<span>{@$participant->getAvatar()->getImageTag(24)}</span>{/if}
72 <div>
73 <p>
74 {if $participant->userID}<a href="{link controller='User' object=$participant}{/link}" class="userLink" data-user-id="{@$participant->userID}">{$participant->username}</a>{else}<span>{$participant->username}</span>{/if}
75 {if $participant->isInvisible}<small>({lang}wcf.conversation.invisible{/lang})</small>{/if}
76 {if $participant->userID && ($conversation->userID == $__wcf->getUser()->userID) && ($participant->userID != $__wcf->getUser()->userID) && $participant->hideConversation != 2 && $participant->leftAt == 0}
77 <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>
78 {/if}
79 </p>
80 <dl class="plain inlineDataList small">
81 <dt>{lang}wcf.conversation.lastVisitTime{/lang}</dt>
82 <dd>{if $participant->lastVisitTime}{@$participant->lastVisitTime|time}{else}-{/if}</dd>
83 </dl>
84 </div>
85 </div>
86 </li>
87 {/foreach}
88 </ul>
89 </section>
90 {/if}
91
92 {hascontent}
93 <div class="paginationTop">
94 {content}{pages print=true assign=pagesLinks controller='Conversation' object=$conversation link="pageNo=%d"}{/content}
95 </div>
96 {/hascontent}
97
98 <div class="section">
99 <ul class="messageList">
100 {if $pageNo == 1 && !$conversation->joinedAt|empty}<li><p class="info">{lang}wcf.conversation.visibility.previousMessages{/lang}</p></li>{/if}
101 {include file='conversationMessageList'}
102 {hascontent}
103 <li class="messageListPagination">
104 {content}{@$pagesLinks}{/content}
105 </li>
106 {/hascontent}
107 {if $conversation->canReply()}{include file='conversationQuickReply'}{/if}
108 {if $pageNo == $pages && !$conversation->leftAt|empty}<li><p class="info">{lang}wcf.conversation.visibility.nextMessages{/lang}</p></li>{/if}
109 </ul>
110 </div>
111
112 {if !ENABLE_DEBUG_MODE}<script src="{@$__wcf->getPath()}js/WoltLabSuite.Core.Conversation.min.js?v={@LAST_UPDATE_TIME}"></script>{/if}
113 <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Conversation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@LAST_UPDATE_TIME}"></script>
114 <script data-relocate="true">
115 $(function() {
116 WCF.Language.addObject({
117 'wcf.conversation.edit.addParticipants': '{lang}wcf.conversation.edit.addParticipants{/lang}',
118 'wcf.conversation.edit.assignLabel': '{lang}wcf.conversation.edit.assignLabel{/lang}',
119 'wcf.conversation.edit.close': '{lang}wcf.conversation.edit.close{/lang}',
120 'wcf.conversation.edit.leave': '{lang}wcf.conversation.edit.leave{/lang}',
121 'wcf.conversation.edit.open': '{lang}wcf.conversation.edit.open{/lang}',
122 'wcf.conversation.edit.subject': '{lang}wcf.conversation.edit.subject{/lang}',
123 'wcf.conversation.leave.title': '{lang}wcf.conversation.leave.title{/lang}',
124 'wcf.global.state.closed': '{lang}wcf.global.state.closed{/lang}',
125 'wcf.global.subject': '{lang}wcf.global.subject{/lang}',
126 'wcf.message.bbcode.code.copy': '{lang}wcf.message.bbcode.code.copy{/lang}',
127 'wcf.message.error.editorAlreadyInUse': '{lang}wcf.message.error.editorAlreadyInUse{/lang}',
128 'wcf.moderation.report.reportContent': '{lang}wcf.moderation.report.reportContent{/lang}',
129 'wcf.moderation.report.success': '{lang}wcf.moderation.report.success{/lang}',
130 'wcf.conversation.label.assignLabels': '{lang}wcf.conversation.label.assignLabels{/lang}'
131 });
132
133 var $availableLabels = [ {implode from=$labelList item=label}{ cssClassName: '{if $label->cssClassName}{@$label->cssClassName}{/if}', labelID: {@$label->labelID}, label: '{$label->label}' }{/implode} ];
134 var $editorHandler = new WCF.Conversation.EditorHandlerConversation($availableLabels);
135 var $inlineEditor = new WCF.Conversation.InlineEditor('.conversation');
136 $inlineEditor.setEditorHandler($editorHandler);
137
138 {assign var=__supportPaste value=true}
139 {if !$conversation->canReply()}{assign var=__supportPaste value=false}{/if}
140 {include file='__messageQuoteManager' wysiwygSelector='text' supportPaste=$__supportPaste}
141
142 new WCF.Conversation.Message.InlineEditor({@$conversation->conversationID}, $quoteManager);
143 new WCF.Conversation.Message.QuoteHandler($quoteManager);
144
145 {if $conversation->canReply()}
146 require(['WoltLabSuite/Core/Ui/Message/Reply'], function(UiMessageReply) {
147 new UiMessageReply({
148 ajax: {
149 className: 'wcf\\data\\conversation\\message\\ConversationMessageAction'
150 },
151 quoteManager: $quoteManager
152 });
153 });
154 {/if}
155
156 {if $__wcf->session->getPermission('user.profile.canReportContent')}
157 new WCF.Moderation.Report.Content('com.woltlab.wcf.conversation.message', '.jsReportConversationMessage');
158 {/if}
159 new WCF.Conversation.RemoveParticipant({@$conversation->conversationID});
160 new WCF.Message.BBCode.CodeViewer();
161 });
162 </script>
163
164 {include file='footer'}