From: Joshua Rüsweg Date: Mon, 13 May 2019 19:28:54 +0000 (+0200) Subject: Improve UI of reaction overview list X-Git-Tag: 5.2.0_Alpha_1~90 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e768ff98ef2a70167a1036c13d927b863a83e25c;p=GitHub%2FWoltLab%2FWCF.git Improve UI of reaction overview list See #2508 --- 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') ]; }