From e768ff98ef2a70167a1036c13d927b863a83e25c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Joshua=20R=C3=BCsweg?= Date: Mon, 13 May 2019 21:28:54 +0200 Subject: [PATCH] Improve UI of reaction overview list See #2508 --- .../templates/groupedUserReactionList.tpl | 36 +++++++++++++++++++ .../data/reaction/ReactionAction.class.php | 5 +-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 com.woltlab.wcf/templates/groupedUserReactionList.tpl diff --git a/com.woltlab.wcf/templates/groupedUserReactionList.tpl b/com.woltlab.wcf/templates/groupedUserReactionList.tpl new file mode 100644 index 0000000000..25a5a5d0c2 --- /dev/null +++ b/com.woltlab.wcf/templates/groupedUserReactionList.tpl @@ -0,0 +1,36 @@ +{foreach from=$groupedUsers item=group} + {if $group} +
+

{@$group}

+ {/if} + + {if $group|count} +
    + {foreach from=$group item=user} + {include file='userListItem'} + {/foreach} +
+ {else} +

{$group->getNoUsersMessage()}

+ {/if} + + {if $group} +
+ {/if} +{/foreach} + +
+ + \ No newline at end of file diff --git a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php index d950f3b7c0..b6b946fa84 100644 --- a/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php +++ b/wcfsetup/install/files/lib/data/reaction/ReactionAction.class.php @@ -21,6 +21,7 @@ use wcf\system\reaction\ReactionHandler; use wcf\system\user\activity\point\UserActivityPointHandler; use wcf\system\user\GroupedUserList; use wcf\system\WCF; +use wcf\util\StringUtil; /** * Executes reaction-related actions. @@ -99,7 +100,7 @@ class ReactionAction extends AbstractDatabaseObjectAction { // we cast the reactionTypeID to a string, so that we can sort the array if (!isset($data[(string)$item->getReactionType()->reactionTypeID])) { - $data[(string)$item->getReactionType()->reactionTypeID] = new GroupedUserList($item->getReactionType()->getTitle()); + $data[(string)$item->getReactionType()->reactionTypeID] = new GroupedUserList($item->getReactionType()->renderIcon() . ' ' . StringUtil::encodeHTML($item->getReactionType()->getTitle())); } $data[(string)$item->getReactionType()->reactionTypeID]->addUserIDs([$item->userID]); @@ -116,7 +117,7 @@ class ReactionAction extends AbstractDatabaseObjectAction { }); return [ - 'template' => WCF::getTPL()->fetch('groupedUserList', 'wcf', ['groupedUsers' => $data]), + 'template' => WCF::getTPL()->fetch('groupedUserReactionList', 'wcf', ['groupedUsers' => $data]), 'title' => WCF::getLanguage()->get('wcf.reactions.summary.title') ]; } -- 2.20.1