{foreach from=$queues item=queue}
- <li>
- <a href="{@$queue->getLink()}" class="box24">
+ <li class="moderationQueueEntry{if $queue->isNew()} interactiveDropdownItemOutstanding{/if}" data-link="{$queue->getLink()}" data-object-id="{@$queue->queueID}" data-is-read="{if $queue->isNew()}false{else}true{/if}">
+ <div class="box32">
<div class="framed">
- {@$queue->getUserProfile()->getAvatar()->getImageTag(24)}
+ {@$queue->getUserProfile()->getAvatar()->getImageTag(32)}
</div>
<div>
- <h3>{$queue->getAffectedObject()->getTitle()}</h3>
- <small>{$queue->getAffectedObject()->getUsername()} - {@$queue->getAffectedObject()->getTime()|time}</small>
+ <h3><a href="{@$queue->getLink()}">{$queue->getAffectedObject()->getTitle()}</a></h3>
+ <small>{if $queue->getUserProfile()->userID}<a href="{link controller='User' object=$queue->getUserProfile()->getDecoratedObject()}{/link}">{$queue->getAffectedObject()->getUsername()}</a>{else}{$queue->getAffectedObject()->getUsername()}{/if} - {@$queue->getAffectedObject()->getTime()|time}</small>
</div>
- </a>
+ </div>
</li>
{/foreach}
\ No newline at end of file
<script data-relocate="true">
//<![CDATA[
$(function() {
- WCF.Language.addObject({
+ /*WCF.Language.addObject({
'wcf.moderation.noMoreItems': '{lang}wcf.moderation.noMoreItems{/lang}',
'wcf.moderation.showAll': '{lang}wcf.moderation.showAll{/lang}',
'wcf.moderation.showDeletedContent': '{lang}wcf.moderation.showDeletedContent{/lang}'
- });
+ });*/
+
+ //new WCF.Moderation.UserPanel('{link controller='ModerationList' encode=false}{/link}', '{link controller='DeletedContentList' encode=false}{/link}');
- new WCF.Moderation.UserPanel('{link controller='ModerationList' encode=false}{/link}', '{link controller='DeletedContentList' encode=false}{/link}');
+ new WCF.User.Panel.Moderation({
+ deletedContent: '{lang}wcf.moderation.showDeletedContent{/lang}',
+ deletedContentLink: '{link controller='DeletedContentList' encode=false}{/link}',
+ markAllAsReadConfirmMessage: '{lang}wcf.moderation.markAllAsRead.confirmMessage{/lang}',
+ noItems: '{lang}wcf.moderation.noMoreItems{/lang}',
+ title: '{lang}wcf.moderation.moderation{/lang}'
+ });
});
//]]>
</script>
$('<a href="' + data.returnValues.link + '" data-user-id="' + data.returnValues.userID + '" class="userLink">' + WCF.String.escapeHTML(data.returnValues.username) + '</a>').appendTo($span);
}
else {
- $span.append(data.returnValues.username)
+ $span.append(data.returnValues.username);
}
$span.append(' ');
});
/**
- * Provides a dropdown for user panel.
+ * User Panel implementation for moderation queues.
*
- * @see WCF.UserPanel
+ * @see WCF.User.Panel.Abstract
*/
-WCF.Moderation.UserPanel = WCF.UserPanel.extend({
+WCF.User.Panel.Moderation = WCF.User.Panel.Abstract.extend({
/**
- * link to show all outstanding queues
- * @var string
+ * @see WCF.User.Panel.Abstract.init()
*/
- _showAllLink: '',
+ init: function(options) {
+ options.enableMarkAsRead = true;
+
+ this._super($('#outstandingModeration'), 'outstandingModeration', options);
+ },
/**
- * link to deleted content list
- * @var string
+ * @see WCF.User.Panel.Abstract._initDropdown()
*/
- _deletedContentLink: '',
+ _initDropdown: function() {
+ var $dropdown = this._super();
+
+ $('<li><a href="' + this._options.deletedContentLink + '" title="' + this._options.deletedContent + '" class="jsTooltip"><span class="icon icon16 fa-trash-o" /></a></li>').appendTo($dropdown.getLinkList());
+
+ return $dropdown;
+ },
/**
- * @see WCF.UserPanel.init()
+ * @see WCF.User.Panel.Abstract._load()
*/
- init: function(showAllLink, deletedContentLink) {
- this._noItems = 'wcf.moderation.noMoreItems';
- this._showAllLink = showAllLink;
- this._deletedContentLink = deletedContentLink;
-
- this._super('outstandingModeration');
+ _load: function() {
+ this._proxy.setOption('data', {
+ actionName: 'getOutstandingQueues',
+ className: 'wcf\\data\\moderation\\queue\\ModerationQueueAction'
+ });
+ this._proxy.sendRequest();
},
/**
- * @see WCF.UserPanel._addDefaultItems()
+ * @see WCF.User.Panel.Abstract._markAsRead()
*/
- _addDefaultItems: function(dropdownMenu) {
- this._addDivider(dropdownMenu);
- $('<li><a href="' + this._showAllLink + '">' + WCF.Language.get('wcf.moderation.showAll') + '</a></li>').appendTo(dropdownMenu);
- this._addDivider(dropdownMenu);
- $('<li><a href="' + this._deletedContentLink + '">' + WCF.Language.get('wcf.moderation.showDeletedContent') + '</a></li>').appendTo(dropdownMenu);
+ _markAsRead: function(event, objectID) {
+ this._proxy.setOption('data', {
+ actionName: 'markAsRead',
+ className: 'wcf\\data\\moderation\\queue\\ModerationQueueAction',
+ objectIDs: [ objectID ]
+ });
+ this._proxy.sendRequest();
},
/**
- * @see WCF.UserPanel._getParameters()
+ * @see WCF.User.Panel.Abstract._markAllAsRead()
*/
- _getParameters: function() {
- return {
- actionName: 'getOutstandingQueues',
+ _markAllAsRead: function(event) {
+ this._proxy.setOption('data', {
+ actionName: 'markAllAsRead',
className: 'wcf\\data\\moderation\\queue\\ModerationQueueAction'
- };
+ });
+ this._proxy.sendRequest();
+ },
+
+ /**
+ * @see WCF.User.Panel.Abstract._success()
+ */
+ _success: function(data) {
+ this._super(data);
+
+ if (data.actionName === 'markAllAsConfirmed') {
+ this.resetItems();
+ this.updateBadge(0);
+ }
}
});