Added missing conversation subject editing
[GitHub/WoltLab/com.woltlab.wcf.conversation.git] / templates / conversationList.tpl
1 {capture assign='pageTitle'}{if $filter}{lang}wcf.conversation.folder.{$filter}{/lang}{else}{$__wcf->getActivePage()->getTitle()}{/if}{if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture}
2
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}{$__wcf->getActivePage()->getTitle()}{/if}</h1>
7 </div>
8
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-plus"></span> <span>{lang}wcf.conversation.button.add{/lang}</span></a></li>
12 {event name='contentHeaderNavigation'}
13 </ul>
14 </nav>
15 </header>
16 {/capture}
17
18 {capture assign='headContent'}
19 <link rel="alternate" type="application/rss+xml" title="{lang}wcf.global.button.rss{/lang}" href="{link controller='ConversationFeed'}at={@$__wcf->getUser()->userID}-{@$__wcf->getUser()->accessToken}{/link}">
20 {/capture}
21
22 {capture assign='sidebarRight'}
23 <section class="box">
24 <h2 class="boxTitle">{lang}wcf.conversation.folders{/lang}</h2>
25
26 <div class="boxContent">
27 <nav>
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>
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>
42 </nav>
43 </div>
44 </section>
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
64 <section class="box jsOnly">
65 <h2 class="boxTitle">{lang}wcf.conversation.label{/lang}</h2>
66
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}
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>
85 {/foreach}
86 </ul>
87 <ul>
88 <li class="dropdownDivider"{if !$labelList|count} style="display: none;"{/if}></li>
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>
90 </ul>
91 </div>
92 </div>
93 </div>
94
95 <div class="boxContent">
96 <button id="manageLabel">{lang}wcf.conversation.label.management{/lang}</button>
97 </div>
98 </section>
99
100 {event name='beforeQuotaBox'}
101
102 <section class="box conversationQuota">
103 <h2 class="boxTitle">{lang}wcf.conversation.quota{/lang}</h2>
104
105 <div class="boxContent">
106 {assign var='conversationCount' value=$__wcf->getConversationHandler()->getConversationCount()}
107 {assign var='maxConversationCount' value=$__wcf->session->getPermission('user.conversation.maxConversations')}
108 <p class="conversationUsageBar{if $conversationCount/$maxConversationCount >= 1.0} red{elseif $conversationCount/$maxConversationCount > 0.9} yellow{/if}">
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>
112 </div>
113 </section>
114
115 {event name='boxes'}
116 {/capture}
117
118 {capture assign='headerNavigation'}
119 <li><a rel="alternate" href="{link controller='ConversationFeed'}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>
121 {/capture}
122
123 {include file='header'}
124
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}
136
137 {if !$items}
138 <p class="info">{lang}wcf.conversation.noConversations{/lang}</p>
139 {else}
140 <div class="section tabularBox messageGroupList conversationList jsClipboardContainer" data-type="com.woltlab.wcf.conversation.conversation">
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>
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>
148
149 {event name='columnHeads'}
150 </ol>
151 </li>
152
153 {foreach from=$objects item=conversation}
154 <li class="tabularListRow">
155 <ol class="tabularListColumns messageGroup 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">
157 <label><input type="checkbox" class="jsClipboardItem" data-object-id="{@$conversation->conversationID}"></label>
158 </li>
159 <li class="columnIcon columnAvatar">
160 {if $conversation->getUserProfile()->getAvatar()}
161 <div>
162 <p{if $conversation->isNew()} title="{lang}wcf.conversation.markAsRead.doubleClick{/lang}"{/if}>{@$conversation->getUserProfile()->getAvatar()->getImageTag(48)}</p>
163
164 {if $conversation->ownPosts && $conversation->userID != $__wcf->user->userID}
165 {if $__wcf->getUserProfileHandler()->getAvatar()}
166 <small class="myAvatar jsTooltip" title="{lang}wcf.conversation.ownPosts{/lang}">{@$__wcf->getUserProfileHandler()->getAvatar()->getImageTag(24)}</small>
167 {/if}
168 {/if}
169 </div>
170 {/if}
171 </li>
172 <li class="columnSubject">
173 {hascontent}
174 <ul class="labelList">
175 {content}
176 {foreach from=$conversation->getAssignedLabels() item=label}
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>
178 {/foreach}
179 {/content}
180 </ul>
181 {/hascontent}
182
183 <h3>
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}</a>
185 {if $conversation->replies}
186 <span class="badge messageGroupCounterMobile">{@$conversation->replies|shortUnit}</span>
187 {/if}
188 </h3>
189
190 <aside class="statusDisplay">
191 <ul class="statusIcons">
192 {if $conversation->isClosed}<li><span class="icon icon16 fa-lock jsIconLock jsTooltip" title="{lang}wcf.global.state.closed{/lang}"></span></li>{/if}
193 {if $conversation->attachments}<li><span class="icon icon16 fa-paperclip jsIconAttachment jsTooltip" title="{lang}wcf.conversation.attachments{/lang}"></span></li>{/if}
194 </ul>
195 </aside>
196
197 <ul class="inlineList dotSeparated small messageGroupInfo">
198 <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>
199 <li class="messageGroupTime">{@$conversation->time|time}</li>
200 <li class="messageGroupEditLink jsOnly"><a class="jsConversationInlineEditor">{lang}wcf.global.button.edit{/lang}</a></li>
201 {event name='messageGroupInfo'}
202 </ul>
203
204 <ul class="messageGroupInfoMobile">
205 <li class="messageGroupAuthorMobile">{$conversation->username}</li>
206 <li class="messageGroupLastPostTimeMobile">{@$conversation->lastPostTime|time}</li>
207 </ul>
208
209 {if $conversation->getParticipantSummary()|count}
210 <small class="conversationParticipantSummary">
211 {assign var='participantSummaryCount' value=$conversation->getParticipantSummary()|count}
212 {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}
213 {if $participantSummaryCount < $conversation->participants}{lang}wcf.conversation.participants.other{/lang}{/if}
214 </small>
215 {/if}
216
217 {event name='conversationData'}
218 </li>
219 <li class="columnStats">
220 <dl class="plain statsDataList">
221 <dt>{lang}wcf.conversation.replies{/lang}</dt>
222 <dd>{@$conversation->replies|shortUnit}</dd>
223 </dl>
224 <dl class="plain statsDataList">
225 <dt>{lang}wcf.conversation.participants{/lang}</dt>
226 <dd>{@$conversation->participants|shortUnit}</dd>
227 </dl>
228
229 <div class="messageGroupListStatsSimple">{@$conversation->replies|shortUnit}</div>
230 </li>
231 <li class="columnLastPost">
232 {if $conversation->replies != 0}
233 <div class="box32">
234 <a href="{link controller='Conversation' object=$conversation}action=lastPost{/link}" class="jsTooltip" title="{lang}wcf.conversation.gotoLastPost{/lang}">{@$conversation->getLastPosterProfile()->getAvatar()->getImageTag(32)}</a>
235
236 <div>
237 <p>
238 {if $conversation->lastPosterID}
239 <a href="{link controller='User' object=$conversation->getLastPosterProfile()->getDecoratedObject()}{/link}" class="userLink" data-user-id="{@$conversation->getLastPosterProfile()->userID}">{$conversation->lastPoster}</a>
240 {else}
241 {$conversation->lastPoster}
242 {/if}
243 </p>
244 <small>{@$conversation->lastPostTime|time}</small>
245 </div>
246 </div>
247 {/if}
248 </li>
249
250 {event name='columns'}
251 </ol>
252 </li>
253 {/foreach}
254 </ol>
255 </div>
256 {/if}
257
258 <footer class="contentFooter">
259 {hascontent}
260 <div class="paginationBottom">
261 {content}{@$pagesLinks}{/content}
262 </div>
263 {/hascontent}
264
265 <nav class="contentFooterNavigation">
266 <ul>
267 <li><a href="{link controller='ConversationAdd'}{/link}" title="{lang}wcf.conversation.add{/lang}" class="button"><span class="icon icon16 fa-plus"></span> <span>{lang}wcf.conversation.button.add{/lang}</span></a></li>
268 {event name='contentFooterNavigation'}
269 </ul>
270 </nav>
271 </footer>
272
273 <script data-relocate="true" src="{@$__wcf->getPath()}js/WCF.Conversation{if !ENABLE_DEBUG_MODE}.min{/if}.js?v={@LAST_UPDATE_TIME}"></script>
274 <script data-relocate="true">
275 require(['Language', 'WoltLabSuite/Core/Ui/ItemList/User'], function(Language, UiItemListUser) {
276 Language.addObject({
277 'wcf.conversation.edit.addParticipants': '{lang}wcf.conversation.edit.addParticipants{/lang}',
278 'wcf.conversation.edit.assignLabel': '{lang}wcf.conversation.edit.assignLabel{/lang}',
279 'wcf.conversation.edit.close': '{lang}wcf.conversation.edit.close{/lang}',
280 'wcf.conversation.edit.leave': '{lang}wcf.conversation.edit.leave{/lang}',
281 'wcf.conversation.edit.open': '{lang}wcf.conversation.edit.open{/lang}',
282 'wcf.conversation.edit.subject': '{lang}wcf.conversation.edit.subject{/lang}',
283 'wcf.conversation.label.management': '{lang}wcf.conversation.label.management{/lang}',
284 'wcf.conversation.label.management.addLabel.success': '{lang}wcf.conversation.label.management.addLabel.success{/lang}',
285 'wcf.conversation.label.management.deleteLabel.confirmMessage': '{lang}wcf.conversation.label.management.deleteLabel.confirmMessage{/lang}',
286 'wcf.conversation.label.management.editLabel': '{lang}wcf.conversation.label.management.editLabel{/lang}',
287 'wcf.conversation.label.placeholder': '{lang}wcf.conversation.label.placeholder{/lang}',
288 'wcf.conversation.leave.title': '{lang}wcf.conversation.leave.title{/lang}',
289 'wcf.global.state.closed': '{lang}wcf.global.state.closed{/lang}',
290 'wcf.conversation.label.assignLabels': '{lang}wcf.conversation.label.assignLabels{/lang}'
291 });
292
293 WCF.Clipboard.init('wcf\\page\\ConversationListPage', {@$hasMarkedItems}, { });
294
295 var $editorHandler = new WCF.Conversation.EditorHandler();
296 var $inlineEditor = new WCF.Conversation.InlineEditor('.conversation');
297 $inlineEditor.setEditorHandler($editorHandler, 'list');
298
299 new WCF.Conversation.Clipboard($editorHandler);
300 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}');
301 new WCF.Conversation.Preview();
302 new WCF.Conversation.MarkAsRead();
303 new WCF.Conversation.MarkAllAsRead();
304
305 // mobile safari hover workaround
306 if ($(window).width() <= 800) {
307 $('.sidebar').addClass('mobileSidebar').hover(function() { });
308 }
309
310 UiItemListUser.init('participants', {
311 excludedSearchValues: ['{$__wcf->user->username|encodeJS}']
312 });
313 });
314 </script>
315
316 {include file='footer'}