From cd358fd9b916aed852375543eff81c708b2594a7 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 12 Apr 2016 11:37:16 +0200 Subject: [PATCH] Improved avatar list visuals --- com.woltlab.wcf/templates/userSidebar.tpl | 6 +-- .../install/files/lib/page/UserPage.class.php | 44 +++++++++---------- .../install/files/style/layout/layout.scss | 4 -- .../install/files/style/layout/sidebar.scss | 4 ++ .../install/files/style/ui/userProfile.scss | 19 ++++++-- 5 files changed, 44 insertions(+), 33 deletions(-) diff --git a/com.woltlab.wcf/templates/userSidebar.tpl b/com.woltlab.wcf/templates/userSidebar.tpl index e14508eaab..1777068eb2 100644 --- a/com.woltlab.wcf/templates/userSidebar.tpl +++ b/com.woltlab.wcf/templates/userSidebar.tpl @@ -10,7 +10,7 @@ {/foreach} - {if $followingCount > 8} + {if $followingCount > 7} {lang}wcf.global.button.showAll{/lang} {/if} @@ -28,7 +28,7 @@ {/foreach} - {if $followerCount > 8} + {if $followerCount > 7} {lang}wcf.global.button.showAll{/lang} {/if} @@ -46,7 +46,7 @@ {/foreach} - {if $visitorCount > 8} + {if $visitorCount > 7} {lang}wcf.global.button.showAll{/lang} {/if} diff --git a/wcfsetup/install/files/lib/page/UserPage.class.php b/wcfsetup/install/files/lib/page/UserPage.class.php index 9eb871443e..b2c870f5ca 100644 --- a/wcfsetup/install/files/lib/page/UserPage.class.php +++ b/wcfsetup/install/files/lib/page/UserPage.class.php @@ -22,7 +22,7 @@ use wcf\system\WCF; * Shows the user profile page. * * @author Marcel Werk - * @copyright 2001-2015 WoltLab GmbH + * @copyright 2001-2016 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage page @@ -44,7 +44,7 @@ class UserPage extends AbstractPage { * overview editable content object type * @var \wcf\data\object\type\ObjectType */ - public $objectType = null; + public $objectType; /** * profile content for active menu item @@ -62,25 +62,25 @@ class UserPage extends AbstractPage { * user object * @var UserProfile */ - public $user = null; + public $user; /** * follower list * @var \wcf\data\user\follow\UserFollowerList */ - public $followerList = null; + public $followerList; /** * following list * @var \wcf\data\user\follow\UserFollowingList */ - public $followingList = null; + public $followingList; /** * visitor list * @var \wcf\data\user\profile\visitor\UserProfileVisitorList */ - public $visitorList = null; + public $visitorList; /** * @see \wcf\page\IPage::readParameters() @@ -100,7 +100,7 @@ class UserPage extends AbstractPage { if (isset($_REQUEST['editOnInit'])) $this->editOnInit = true; - $this->canonicalURL = LinkHandler::getInstance()->getLink('User', array('object' => $this->user)); + $this->canonicalURL = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]); } /** @@ -125,25 +125,25 @@ class UserPage extends AbstractPage { // get followers $this->followerList = new UserFollowerList(); - $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', array($this->userID)); - $this->followerList->sqlLimit = 12; + $this->followerList->getConditionBuilder()->add('user_follow.followUserID = ?', [$this->userID]); + $this->followerList->sqlLimit = 7; $this->followerList->readObjects(); // get following $this->followingList = new UserFollowingList(); - $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', array($this->userID)); - $this->followingList->sqlLimit = 12; + $this->followingList->getConditionBuilder()->add('user_follow.userID = ?', [$this->userID]); + $this->followingList->sqlLimit = 7; $this->followingList->readObjects(); // get visitors if (PROFILE_ENABLE_VISITORS) { $this->visitorList = new UserProfileVisitorList(); - $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', array($this->userID)); - $this->visitorList->sqlLimit = 12; + $this->visitorList->getConditionBuilder()->add('user_profile_visitor.ownerID = ?', [$this->userID]); + $this->visitorList->sqlLimit = 7; $this->visitorList->readObjects(); } - MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', array('object' => $this->user->getDecoratedObject(), 'appendSession' => false)), true); + MetaTagHandler::getInstance()->addTag('og:url', 'og:url', LinkHandler::getInstance()->getLink('User', ['object' => $this->user->getDecoratedObject(), 'appendSession' => false]), true); MetaTagHandler::getInstance()->addTag('og:type', 'og:type', 'profile', true); MetaTagHandler::getInstance()->addTag('profile:username', 'profile:username', $this->user->username, true); MetaTagHandler::getInstance()->addTag('og:title', 'og:title', $this->user->username . ' - ' . WCF::getLanguage()->get('wcf.user.members') . ' - ' . WCF::getLanguage()->get(PAGE_TITLE), true); @@ -156,7 +156,7 @@ class UserPage extends AbstractPage { public function assignVariables() { parent::assignVariables(); - WCF::getTPL()->assign(array( + WCF::getTPL()->assign([ 'editOnInit' => $this->editOnInit, 'overviewObjectType' => $this->objectType, 'profileContent' => $this->profileContent, @@ -166,11 +166,11 @@ class UserPage extends AbstractPage { 'followerCount' => $this->followerList->countObjects(), 'following' => $this->followingList->getObjects(), 'followingCount' => $this->followingList->countObjects(), - 'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : array()), + 'visitors' => ($this->visitorList !== null ? $this->visitorList->getObjects() : []), 'visitorCount' => ($this->visitorList !== null ? $this->visitorList->countObjects() : 0), 'allowSpidersToIndexThisPage' => true, 'isAccessible' => UserGroup::isAccessibleGroup($this->user->getGroupIDs()) - )); + ]); } /** @@ -180,22 +180,20 @@ class UserPage extends AbstractPage { // update profile hits if ($this->user->userID != WCF::getUser()->userID && !WCF::getSession()->spiderID && !$this->user->isProtected()) { $editor = new UserEditor($this->user->getDecoratedObject()); - $editor->updateCounters(array('profileHits' => 1)); + $editor->updateCounters(['profileHits' => 1]); // save visitor if (PROFILE_ENABLE_VISITORS && WCF::getUser()->userID && !WCF::getUser()->canViewOnlineStatus) { if (($visitor = UserProfileVisitor::getObject($this->user->userID, WCF::getUser()->userID)) !== null) { $editor = new UserProfileVisitorEditor($visitor); - $editor->update(array( - 'time' => TIME_NOW - )); + $editor->update(['time' => TIME_NOW]); } else { - UserProfileVisitorEditor::create(array( + UserProfileVisitorEditor::create([ 'ownerID' => $this->user->userID, 'userID' => WCF::getUser()->userID, 'time' => TIME_NOW - )); + ]); } } } diff --git a/wcfsetup/install/files/style/layout/layout.scss b/wcfsetup/install/files/style/layout/layout.scss index 841d343a90..db6e312de5 100644 --- a/wcfsetup/install/files/style/layout/layout.scss +++ b/wcfsetup/install/files/style/layout/layout.scss @@ -1,7 +1,3 @@ -/* @TODO */ -.userAvatarImage { border-radius: 50%; } -/* @TODO END */ - html, body { height: 100%; diff --git a/wcfsetup/install/files/style/layout/sidebar.scss b/wcfsetup/install/files/style/layout/sidebar.scss index 421f8b566a..40cf02d7d2 100644 --- a/wcfsetup/install/files/style/layout/sidebar.scss +++ b/wcfsetup/install/files/style/layout/sidebar.scss @@ -67,6 +67,10 @@ > div, > fieldset, > section { + .boxContent { + @include clearfix; + } + .button.more { float: right; margin-top: 15px; diff --git a/wcfsetup/install/files/style/ui/userProfile.scss b/wcfsetup/install/files/style/ui/userProfile.scss index fd6da7c2ad..fec2f719ea 100644 --- a/wcfsetup/install/files/style/ui/userProfile.scss +++ b/wcfsetup/install/files/style/ui/userProfile.scss @@ -113,18 +113,31 @@ } } +.userAvatarImage { + background-color: rgba(255, 255, 255, 1); + border-radius: 50%; +} + .userAvatarList { display: flex; flex-wrap: wrap; - margin-bottom: -15px; + margin-bottom: -10px; > li { - flex: 0 0 25%; - margin-bottom: 15px; + flex: 0 0 48px; + margin-bottom: 10px; text-align: center; + &:not(:last-child) { + margin-right: -12px; + } + > a { display: block; + + > img { + padding: 2px; + } } } } -- 2.20.1