Add @method documentation for DBO actions
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / templates / conversationList.tpl
CommitLineData
583b412e 1{capture assign='pageTitle'}{lang}wcf.conversation.conversations{/lang}{if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture}
9544b6b4 2
583b412e
MW
3{capture assign='contentHeader'}
4 <header class="contentHeader">
5 <div class="contentHeaderTitle">
6 <h1 class="contentTitle">{if $filter}{lang}wcf.conversation.folder.{$filter}{/lang}{else}{lang}wcf.conversation.conversations{/lang}{/if}</h1>
7 </div>
8
63faa8d1
MS
9 <nav class="contentHeaderNavigation">
10 <ul>
11 <li><a href="{link controller='ConversationAdd'}{/link}" title="{lang}wcf.conversation.add{/lang}" class="button"><span class="icon icon16 fa-asterisk"></span> <span>{lang}wcf.conversation.button.add{/lang}</span></a></li>
12 {event name='contentHeaderNavigation'}
13 </ul>
14 </nav>
583b412e
MW
15 </header>
16{/capture}
9544b6b4 17
583b412e
MW
18{capture assign='headContent'}
19 <link rel="alternate" type="application/rss+xml" title="{lang}wcf.global.button.rss{/lang}" href="{link controller='ConversationFeed' appendSession=false}at={@$__wcf->getUser()->userID}-{@$__wcf->getUser()->accessToken}{/link}" />
20{/capture}
9544b6b4 21
7cd36813
MW
22{capture assign='sidebarLeft'}
23 <section class="box">
24 <h2 class="boxTitle">{lang}wcf.conversation.folders{/lang}</h2>
331b1cdf 25
7cd36813
MW
26 <div class="boxContent">
27 <nav>
7961609e
MW
28 <ol class="boxMenu">
29 <li{if $filter == ''} class="active"{/if}>
30 <a class="boxMenuLink" href="{link controller='ConversationList'}{/link}"><span class="boxMenuLinkTitle">{lang}wcf.conversation.conversations{/lang}</span>{if $conversationCount} <span class="badge">{#$conversationCount}</span>{/if}</a>
7961609e
MW
31 </li>
32 <li{if $filter == 'draft'} class="active"{/if}>
33 <a class="boxMenuLink" href="{link controller='ConversationList'}filter=draft{/link}"><span class="boxMenuLinkTitle">{lang}wcf.conversation.folder.draft{/lang}</span>{if $draftCount} <span class="badge">{#$draftCount}</span>{/if}</a>
34 </li>
35 <li{if $filter == 'outbox'} class="active"{/if}>
36 <a class="boxMenuLink" href="{link controller='ConversationList'}filter=outbox{/link}"><span class="boxMenuLinkTitle">{lang}wcf.conversation.folder.outbox{/lang}</span>{if $outboxCount} <span class="badge">{#$outboxCount}</span>{/if}</a>
37 </li>
38 <li{if $filter == 'hidden'} class="active"{/if}>
39 <a class="boxMenuLink" href="{link controller='ConversationList'}filter=hidden{/link}"><span class="boxMenuLinkTitle">{lang}wcf.conversation.folder.hidden{/lang}</span>{if $hiddenCount} <span class="badge">{#$hiddenCount}</span>{/if}</a>
40 </li>
41 </ol>
7cd36813
MW
42 </nav>
43 </div>
44 </section>
3d6dd2ed
MS
45
46 <section class="box">
47 <h2 class="boxTitle">{lang}wcf.conversation.filter.participants{/lang}</h2>
48
49 <div class="boxContent">
50 <form action="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}{/link}" method="post">
51 <dl>
52 <dt></dt>
53 <dd><label><textarea id="participants" name="participants" class="long">{implode from=$participants item=participant glue=','}{$participant}{/implode}</textarea></label></dd>
54 </dl>
55
56 <div class="formSubmit">
57 <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
58 {@SECURITY_TOKEN_INPUT_TAG}
59 </div>
60 </form>
61 </div>
62 </section>
63
583b412e 64 <section class="box jsOnly">
7cd36813 65 <h2 class="boxTitle">{lang}wcf.conversation.label{/lang}</h2>
331b1cdf 66
7cd36813
MW
67 <div class="boxContent">
68 <div id="conversationLabelFilter" class="dropdown">
69 <div class="dropdownToggle" data-toggle="conversationLabelFilter">
70 {if $labelID}
71 {foreach from=$labelList item=label}
72 {if $label->labelID == $labelID}
73 <span class="badge label{if $label->cssClassName} {@$label->cssClassName}{/if}">{$label->label}</span>
74 {/if}
75 {/foreach}
76 {else}
77 <span class="badge">{lang}wcf.conversation.label.filter{/lang}</span>
78 {/if}
79 </div>
80
81 <div class="dropdownMenu">
82 <ul class="scrollableDropdownMenu">
83 {foreach from=$labelList item=label}
3d6dd2ed 84 <li><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}&labelID={@$label->labelID}{/link}"><span class="badge label{if $label->cssClassName} {@$label->cssClassName}{/if}" data-css-class-name="{if $label->cssClassName}{@$label->cssClassName}{/if}" data-label-id="{@$label->labelID}">{$label->label}</span></a></li>
7cd36813
MW
85 {/foreach}
86 </ul>
87 <ul>
88 <li class="dropdownDivider"{if !$labelList|count} style="display: none;"{/if}></li>
3d6dd2ed 89 <li><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}{/link}"><span class="badge label">{lang}wcf.conversation.label.disableFilter{/lang}</span></a></li>
7cd36813
MW
90 </ul>
91 </div>
331b1cdf 92 </div>
331b1cdf 93 </div>
7961609e
MW
94
95 <div class="boxContent">
96 <button id="manageLabel">{lang}wcf.conversation.label.management{/lang}</button>
97 </div>
7cd36813 98 </section>
331b1cdf 99
22f0bc73 100 {event name='beforeQuotaBox'}
3a49e3c9 101
7cd36813
MW
102 <section class="box conversationQuota">
103 <h2 class="boxTitle">{lang}wcf.conversation.quota{/lang}</h2>
331b1cdf 104
7cd36813 105 <div class="boxContent">
331b1cdf
MW
106 {assign var='conversationCount' value=$__wcf->getConversationHandler()->getConversationCount()}
107 {assign var='maxConversationCount' value=$__wcf->session->getPermission('user.conversation.maxConversations')}
c96fc841 108 <p class="conversationUsageBar{if $conversationCount/$maxConversationCount >= 1.0} red{elseif $conversationCount/$maxConversationCount > 0.9} yellow{/if}">
9b8f4622
MW
109 <span style="width: {if $conversationCount/$maxConversationCount < 1.0}{@$conversationCount/$maxConversationCount*100|round:0}{else}100{/if}%">{#$conversationCount/$maxConversationCount*100}%</span>
110 </p>
111 <p><small>{lang}wcf.conversation.quota.description{/lang}</small></p>
331b1cdf 112 </div>
7cd36813 113 </section>
c18fa102
MW
114
115 {event name='boxes'}
9544b6b4
MW
116{/capture}
117
d7649d82 118{capture assign='headerNavigation'}
7cd36813
MW
119 <li><a rel="alternate" href="{link controller='ConversationFeed' appendSession=false}at={@$__wcf->getUser()->userID}-{@$__wcf->getUser()->accessToken}{/link}" title="{lang}wcf.global.button.rss{/lang}" class="jsTooltip"><span class="icon icon16 fa-rss"></span> <span class="invisible">{lang}wcf.global.button.rss{/lang}</span></a></li>
120 <li class="jsOnly"><a href="#" title="{lang}wcf.conversation.markAllAsRead{/lang}" class="markAllAsReadButton jsTooltip"><span class="icon icon16 fa-check"></span> <span class="invisible">{lang}wcf.conversation.markAllAsRead{/lang}</span></a></li>
d7649d82
AE
121{/capture}
122
7cd36813 123{include file='header'}
9544b6b4 124
583b412e
MW
125{hascontent}
126 <div class="paginationTop">
127 {content}
128 {assign var='participantsParameter' value=''}
129 {if $participants}{capture assign='participantsParameter'}&participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}{/capture}{/if}
130 {assign var='labelIDParameter' value=''}
131 {if $labelID}{assign var='labelIDParameter' value="&labelID=$labelID"}{/if}
132 {pages print=true assign=pagesLinks controller='ConversationList' link="filter=$filter$participantsParameter&pageNo=%d&sortField=$sortField&sortOrder=$sortOrder$labelIDParameter"}
133 {/content}
134 </div>
135{/hascontent}
9544b6b4
MW
136
137{if !$items}
138 <p class="info">{lang}wcf.conversation.noConversations{/lang}</p>
139{else}
7cd36813 140 <div class="section tabularBox messageGroupList conversationList jsClipboardContainer" data-type="com.woltlab.wcf.conversation.conversation">
ba4a0151
MW
141 <ol class="tabularList">
142 <li class="tabularListRow tabularListRowHead">
143 <ol class="tabularListColumns">
144 <li class="columnMark jsOnly"><label><input type="checkbox" class="jsClipboardMarkAll" /></label></li>
3d6dd2ed
MS
145 <li class="columnSubject{if $sortField === 'subject'} active {@$sortOrder}{/if}"><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}pageNo={@$pageNo}&sortField=subject&sortOrder={if $sortField == 'subject' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{if $labelID}&labelID={@$labelID}{/if}{/link}">{lang}wcf.global.subject{/lang}</a></li>
146 <li class="columnStats{if $sortField == 'replies'} active {@$sortOrder}{/if}"><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}pageNo={@$pageNo}&sortField=replies&sortOrder={if $sortField == 'replies' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{if $labelID}&labelID={@$labelID}{/if}{/link}">{lang}wcf.conversation.replies{/lang}</a></li>
147 <li class="columnLastPost{if $sortField === 'lastPostTime'} active {@$sortOrder}{/if}"><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}pageNo={@$pageNo}&sortField=lastPostTime&sortOrder={if $sortField == 'lastPostTime' && $sortOrder == 'ASC'}DESC{else}ASC{/if}{if $labelID}&labelID={@$labelID}{/if}{/link}">{lang}wcf.conversation.lastPostTime{/lang}</a></li>
c18fa102
MW
148
149 {event name='columnHeads'}
ba4a0151
MW
150 </ol>
151 </li>
9544b6b4 152
ba4a0151
MW
153 {foreach from=$objects item=conversation}
154 <li class="tabularListRow">
155 <ol class="tabularListColumns conversation jsClipboardObject{if $conversation->isNew()} new{/if}" 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}">
156 <li class="columnMark jsOnly">
18ec67a4 157 <label><input type="checkbox" class="jsClipboardItem" data-object-id="{@$conversation->conversationID}" /></label>
ba4a0151
MW
158 </li>
159 <li class="columnIcon columnAvatar">
9544b6b4
MW
160 {if $conversation->getUserProfile()->getAvatar()}
161 <div>
7cd36813 162 <p{if $conversation->isNew()} title="{lang}wcf.conversation.markAsRead.doubleClick{/lang}"{/if}>{@$conversation->getUserProfile()->getAvatar()->getImageTag(48)}</p>
9544b6b4
MW
163
164 {if $conversation->ownPosts && $conversation->userID != $__wcf->user->userID}
165 {if $__wcf->getUserProfileHandler()->getAvatar()}
7cd36813 166 <small class="myAvatar" title="{lang}wcf.conversation.ownPosts{/lang}">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(24)}</small>
9544b6b4
MW
167 {/if}
168 {/if}
169 </div>
170 {/if}
ba4a0151
MW
171 </li>
172 <li class="columnSubject">
9cd031f5
MW
173 {hascontent}
174 <ul class="labelList">
175 {content}
176 {foreach from=$conversation->getAssignedLabels() item=label}
3d6dd2ed 177 <li><a href="{link controller='ConversationList'}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}&labelID={@$label->labelID}{/link}" class="badge label{if $label->cssClassName} {@$label->cssClassName}{/if}">{$label->label}</a></li>
9cd031f5
MW
178 {/foreach}
179 {/content}
180 </ul>
181 {/hascontent}
9544b6b4 182
f54c0746 183 <h3>
4dc16154 184 <a href="{if $conversation->isNew()}{link controller='Conversation' object=$conversation}action=firstNew{/link}{else}{link controller='Conversation' object=$conversation}{/link}{/if}" class="conversationLink messageGroupLink" data-conversation-id="{@$conversation->conversationID}">{$conversation->subject|tableWordwrap}</a>
f54c0746 185 </h3>
9544b6b4
MW
186
187 <aside class="statusDisplay">
188 {smallpages pages=$conversation->getPages() controller='Conversation' object=$conversation link='pageNo=%d'}
189 <ul class="statusIcons">
7cd36813
MW
190 {if $conversation->isClosed}<li><span class="icon icon16 fa-lock jsIconLock jsTooltip" title="{lang}wcf.global.state.closed{/lang}"></span></li>{/if}
191 {if $conversation->attachments}<li><span class="icon icon16 fa-paperclip jsIconAttachment jsTooltip" title="{lang}wcf.conversation.attachments{/lang}"></span></li>{/if}
9544b6b4
MW
192 </ul>
193 </aside>
194
71c837ea 195 <ul class="inlineList dotSeparated small messageGroupInfo">
6c5730e5
MW
196 <li class="messageGroupAuthor">{if $conversation->userID}<a href="{link controller='User' object=$conversation->getUserProfile()->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$conversation->userID}">{$conversation->username}</a>{else}{$conversation->username}{/if}</li>
197 <li class="messageGroupTime">{@$conversation->time|time}</li>
6c5730e5
MW
198 <li class="messageGroupEditLink jsOnly"><a class="jsConversationInlineEditor">{lang}wcf.global.button.edit{/lang}</a></li>
199 {event name='messageGroupInfo'}
200 </ul>
9544b6b4 201
f34884b9 202 {if $conversation->getParticipantSummary()|count}
d89a6adf 203 <small class="conversationParticipantSummary">
6a3c256b 204 {assign var='participantSummaryCount' value=$conversation->getParticipantSummary()|count}
6ab24384 205 {lang}wcf.conversation.participants{/lang}: {implode from=$conversation->getParticipantSummary() item=participant}<a href="{link controller='User' object=$participant}{/link}" class="userLink{if $participant->hideConversation == 2} conversationLeft{/if}" data-user-id="{@$participant->userID}">{$participant->username}</a>{/implode}
7acdb950 206 {if $participantSummaryCount < $conversation->participants}{lang}wcf.conversation.participants.other{/lang}{/if}
f34884b9
MW
207 </small>
208 {/if}
c18fa102
MW
209
210 {event name='conversationData'}
ba4a0151
MW
211 </li>
212 <li class="columnStats">
213 <dl class="plain statsDataList">
214 <dt>{lang}wcf.conversation.replies{/lang}</dt>
215 <dd>{@$conversation->replies|shortUnit}</dd>
216 </dl>
217 <dl class="plain statsDataList">
218 <dt>{lang}wcf.conversation.participants{/lang}</dt>
219 <dd>{@$conversation->participants|shortUnit}</dd>
220 </dl>
221
222 <div class="messageGroupListStatsSimple">{@$conversation->replies|shortUnit}</div>
223 </li>
224 <li class="columnLastPost">
9544b6b4 225 {if $conversation->replies != 0}
ba4a0151 226 <div class="box32">
7cd36813 227 <a href="{link controller='Conversation' object=$conversation}action=lastPost{/link}" class="jsTooltip" title="{lang}wcf.conversation.gotoLastPost{/lang}">{@$conversation->getLastPosterProfile()->getAvatar()->getImageTag(32)}</a>
9544b6b4 228
f54c0746
MW
229 <div>
230 <p>
78e7efdd
MS
231 {if $conversation->lastPosterID}
232 <a href="{link controller='User' object=$conversation->getLastPosterProfile()->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$conversation->getLastPosterProfile()->userID}">{$conversation->lastPoster}</a>
233 {else}
234 {$conversation->lastPoster}
235 {/if}
f54c0746
MW
236 </p>
237 <small>{@$conversation->lastPostTime|time}</small>
238 </div>
9544b6b4
MW
239 </div>
240 {/if}
ba4a0151 241 </li>
c18fa102
MW
242
243 {event name='columns'}
ba4a0151
MW
244 </ol>
245 </li>
246 {/foreach}
247 </ol>
9544b6b4
MW
248 </div>
249{/if}
250
583b412e
MW
251<footer class="contentFooter">
252 {hascontent}
253 <div class="paginationBottom">
254 {content}{@$pagesLinks}{/content}
255 </div>
256 {/hascontent}
9544b6b4 257
583b412e 258 <nav class="contentFooterNavigation">
462fcb4a 259 <ul>
ba4a0151 260 <li><a href="{link controller='ConversationAdd'}{/link}" title="{lang}wcf.conversation.add{/lang}" class="button"><span class="icon icon16 fa-asterisk"></span> <span>{lang}wcf.conversation.button.add{/lang}</span></a></li>
583b412e 261 {event name='contentFooterNavigation'}
462fcb4a
JR
262 </ul>
263 </nav>
583b412e 264</footer>
9544b6b4 265
583b412e
MW
266<script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Conversation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@LAST_UPDATE_TIME}"></script>
267<script data-relocate="true">
268 require(['Language', 'WoltLab/WCF/Ui/ItemList/User'], function(Language, UiItemListUser) {
269 Language.addObject({
270 'wcf.conversation.edit.addParticipants': '{lang}wcf.conversation.edit.addParticipants{/lang}',
271 'wcf.conversation.edit.assignLabel': '{lang}wcf.conversation.edit.assignLabel{/lang}',
272 'wcf.conversation.edit.close': '{lang}wcf.conversation.edit.close{/lang}',
273 'wcf.conversation.edit.leave': '{lang}wcf.conversation.edit.leave{/lang}',
274 'wcf.conversation.edit.open': '{lang}wcf.conversation.edit.open{/lang}',
275 'wcf.conversation.label.management': '{lang}wcf.conversation.label.management{/lang}',
276 'wcf.conversation.label.management.addLabel.success': '{lang}wcf.conversation.label.management.addLabel.success{/lang}',
277 'wcf.conversation.label.management.deleteLabel.confirmMessage': '{lang}wcf.conversation.label.management.deleteLabel.confirmMessage{/lang}',
278 'wcf.conversation.label.management.editLabel': '{lang}wcf.conversation.label.management.editLabel{/lang}',
279 'wcf.conversation.label.placeholder': '{lang}wcf.conversation.label.placeholder{/lang}',
280 'wcf.conversation.leave.title': '{lang}wcf.conversation.leave.title{/lang}',
281 'wcf.global.state.closed': '{lang}wcf.global.state.closed{/lang}',
282 'wcf.conversation.label.assignLabels': '{lang}wcf.conversation.label.assignLabels{/lang}'
283 });
284
285 WCF.Clipboard.init('wcf\\page\\ConversationListPage', {@$hasMarkedItems}, { });
286
287 var $editorHandler = new WCF.Conversation.EditorHandler();
288 var $inlineEditor = new WCF.Conversation.InlineEditor('.conversation');
289 $inlineEditor.setEditorHandler($editorHandler, 'list');
290
291 new WCF.Conversation.Clipboard($editorHandler);
292 new WCF.Conversation.Label.Manager('{link controller='ConversationList' encode=false}{if $filter}filter={@$filter}&{/if}{if !$participants|empty}participants={implode from=$participants item=participant}{$participant|rawurlencode}{/implode}&{/if}sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}{/link}');
293 new WCF.Conversation.Preview();
294 new WCF.Conversation.MarkAsRead();
295 new WCF.Conversation.MarkAllAsRead();
296
297 // mobile safari hover workaround
298 if ($(window).width() <= 800) {
299 $('.sidebar').addClass('mobileSidebar').hover(function() { });
300 }
301
302 UiItemListUser.init('participants', {
303 excludedSearchValues: ['{$__wcf->user->username|encodeJs}']
304 });
305 });
306</script>
9544b6b4 307
583b412e 308{include file='footer'}