From ac4529def6ad444b9822867c003ba526111c9594 Mon Sep 17 00:00:00 2001 From: Cyperghost Date: Fri, 7 Feb 2025 12:27:04 +0100 Subject: [PATCH 01/20] Migrate `ModerationListPage` to grid view --- com.woltlab.wcf/templates/moderationList.tpl | 252 +----------------- .../lib/page/ModerationListPage.class.php | 165 +----------- .../user/ModerationQueueGridView.class.php | 224 ++++++++++++++++ 3 files changed, 238 insertions(+), 403 deletions(-) create mode 100644 wcfsetup/install/files/lib/system/gridView/user/ModerationQueueGridView.class.php diff --git a/com.woltlab.wcf/templates/moderationList.tpl b/com.woltlab.wcf/templates/moderationList.tpl index ab00eda10c2..b54de60994a 100644 --- a/com.woltlab.wcf/templates/moderationList.tpl +++ b/com.woltlab.wcf/templates/moderationList.tpl @@ -1,15 +1,11 @@ -{capture assign='pageTitle'}{if $status == 2}{lang}wcf.moderation.doneItems{/lang}{else}{lang}wcf.moderation.outstandingItems{/lang}{/if}{if $pageNo > 1} - {lang}wcf.page.pageNo{/lang}{/if}{/capture} +{capture assign='pageTitle'}{*{if $status == 2}{lang}wcf.moderation.doneItems{/lang}{else}{lang}wcf.moderation.outstandingItems{/lang}{/if}*}{if $gridView->getPageNo() > 1} - {lang pageNo=$gridView->getPageNo()}wcf.page.pageNo{/lang}{/if}{/capture} -{capture assign='contentTitle'}{if $status == 2}{lang}wcf.moderation.doneItems{/lang}{else}{lang}wcf.moderation.outstandingItems{/lang}{/if} {#$items}{/capture} +{capture assign='contentTitle'}{*{if $status == 2}{lang}wcf.moderation.doneItems{/lang}{else}{lang}wcf.moderation.outstandingItems{/lang}{/if}*} {#$gridView->countRows()}{/capture} {capture assign='sidebarRight'} {event name='sidebarBoxes'} {/capture} -{capture assign='contentInteractionPagination'} - {pages print=true assign=pagesLinks controller='ModerationList' link="definitionID=$definitionID&assignedUserID=$assignedUserID&status=$status&pageNo=%d&sortField=$sortField&sortOrder=$sortOrder"} -{/capture} - {capture assign='contentInteractionButtons'} {icon name='trash-can'} {lang}wcf.moderation.showDeletedContent{/lang} @@ -17,249 +13,11 @@ {include file='header'} -{if $objects|count} -
-
    -
  1. -
      -
    1. - -
    2. - -
    3. - {hascontent} -
    4. -
        - {content} - {if $definitionID} -
      • - {icon name='tag'} - {lang}wcf.moderation.type.{$availableDefinitions[$definitionID]}{/lang} -
      • - {/if} - - {if !$assignedUserID || $assignedUserID == $__wcf->getUser()->userID} -
      • - {icon name='user'} - {if !$assignedUserID} - {lang}wcf.moderation.filterByUser.nobody{/lang} - {else} - {lang}wcf.moderation.filterByUser.myself{/lang} - {/if} -
      • - {/if} - - {if $status == -1 || $status == 2} -
      • - {if $status == -1} - {icon name='circle'} - {lang}wcf.moderation.status.outstanding{/lang} - {else} - {icon name='circle-check'} - {lang}wcf.moderation.status.done{/lang} - {/if} -
      • - {/if} - {/content} -
      -
    5. - {/hascontent} -
    6. - -
    7. -
    -
  2. - - {foreach from=$objects item=entry} -
  3. -
      -
    1. - -
    2. -
    3. -
      - isNew()} title="{lang}wcf.moderation.markAsRead.doubleClick{/lang}"{/if}>{@$entry->getUserProfile()->getAvatar()->getImageTag(48)}

      - - {if $entry->assignedUserID} - {@$entry->getAssignedUserProfile()->getAvatar()->getImageTag(24)} - {/if} -
      -
    4. -
    5. -
        -
      • {$entry->getLabel()}
      • -
      - -

      - {$entry->getTitle()} - {if $entry->comments} - {@$entry->comments|shortUnit} - {/if} -

      - -
        -
      • {if $entry->getAffectedObject()->getUserID()}{user object=$entry->getUserProfile()}{else}{$entry->getAffectedObject()->getUsername()}{/if}
      • -
      • {@$entry->getAffectedObject()->getTime()|time}
      • -
      • {lang}wcf.moderation.type.{@$entry->getObjectTypeName()}{/lang}
      • - - {event name='messageGroupInfo'} -
      - -
        -
      • {$entry->getAffectedObject()->getUsername()}
      • -
      • {if $entry->lastChangeTime}{@$entry->lastChangeTime|time}{/if}
      • -
      - - {if $entry->assignedUserID} - - {lang}wcf.moderation.assignedUser{/lang}: {$entry->assignedUsername} - - {/if} - - {event name='moderationQueueEntryData'} -
    6. -
    7. -
      -
      {lang}wcf.global.comments{/lang}
      -
      {@$entry->comments|shortUnit}
      -
      - -
      {if $entry->comments}{icon name='comment'} {@$entry->comments|shortUnit}{/if}
      -
    8. -
    9. - {if $entry->lastChangeTime}{@$entry->lastChangeTime|time}{/if} -
    10. - - {event name='columns'} -
    -
  4. - {/foreach} -
-
- - -{else} - {lang}wcf.moderation.noEntries{/lang} -{/if} - -
-
-
-
-
-
- -
-
- -
-
-
- -
-
- -
-
-
- -
-
-
- - -
+
+ {unsafe:$gridView->render()}
- - +